Table of Contents
Overview

AI image generation has improved a lot in a short period. These images have become more realistic and the only limit is the creativity. Also, you no longer need to know technical parameters or special prompts to generate good images, plain English will suffice.
The Dall-e 3 model was a big improvement over Dall-e 2 and with AI for Gravity Forms, you can create dynamic prompts for generating images.
Gravity Forms Integration with AI
AI for Gravity Forms addon integrates OpenAI and Gravity Forms deeply. You just have to generate and add your OpenAI API to take advantage of all the different features this plugin provides. With the addon, you can automate AI image generation.
Consider if you have a form that your employees or users use for submitting posts then it can be used to automatically add images to the post or set a featured image. The possibilities are endless. Do let us know your use case in the comments below so we can further enhance the plugin’s features.
Setting up Gravity Form for Image Generation

You will need the following addons to set your Gravity forms for image generation.
Gravity Booster is a free plugin for Gravity Forms that lets you style the form as you like with easy-to-use controls and without any code. AI for Gravity Forms is an addon for Gravity Booster to further enhance the capabilities of Gravity Forms with AI.
Enabling AI Image Generation in Gravity Forms

- After installing and activating AI for Gravity Forms, navigate to Forms -> Booster.
- Choose the form for which you want to enable image generation.
- After the page reloads navigate to the AI panel and then the Image Generation section.
- Here enable the feed, give it a name, select AI model, image size, and prompt. Also don’t forget to map the image generation result to a form field.
Use Gravity Forms Merge Tags in Image Generation Prompt

Let’s assume you have an anime-related website and you want to allow users to generate their favorite anime characters. So, you can have a form with the following fields
Name of Anime Character: This field defines the character that needs to be generated.
Environment Details: The field defines the environment in which the character should be. It could be a war scene, or on top of the mountain, etc. Let’s make it a dropdown field for this tutorial.
Additional Details: This is a textarea field where you let the users put in additional information like they may want to show the character with a cowboy hat or a mask etc. You can also put a limit to a few words that can be entered in this field, say 120 characters, etc.
Once you have this form ready in the backend you can write your prompt using the merge tags. The prompt tag could be
Generate an anime image for {merge_tag_anime_characte} in an {merge_tag_envirnoment_details} environment. The additional details for this are {merge_tag_additoinal_details}.In the above prompt I have used dummy merge tags but in your AI image generation feed you should replace them with actual Gravity Forms merge tags.
Show AI Image in Form Confirmation and Notification
Once you have set up the prompt then you should also map the results of the image generation to the form field. This can be a hidden form field so, that users don’t see this field while filling out the form. However when the form is submitted then it will automatically get populated with the generated AI image URL.
This automatic population of image URLs happens before showing the confirmation message or any notification emails are sent. This way we can include this URL in any of these and show the image to users immediately.

So, to show the URL of the image to the user all you need is to include the merge tag for the hidden field in confirmation or notification feeds.

Frequently Asked Questions
Can I add multiple feeds for different forms or use cases?
Yes, you can add any number of feeds to cover all the use cases. There is no limit to the number of feeds or the number of forms on which you can use this addon.
Difference between Dall-e 2 and Dall-e 3 models?
The Dall-e 3 is the latest model by OpenAI for image generation. It has major improvements to Dall-e 2 models in terms of image quality, and sizes and also provides the ability to generate HD images. There are also options to choose between natural and vivid style image generation.
What are Gravity Forms merge tags?
Merge tags can be considered as placeholder text that automatically gets field values when the form is submitted. So, whatever the user enters in a specific field will replace the merge tag placeholder. This makes the AI image generation prompt dynamic.
Are AI-generated Images also uploaded to the WP media library?
Yes, all the generated images will be available in the WP media library as well. So, you can also use them at any place on your website as well.
Can I store Images in Entry Notes?
Yes, you can map the results of AI image generation to Gravity Forms entry notes. The entry note will also include the name of the feed that generated the image.

0 Comments