Generate Images
Generates images from text prompts using Google's Imagen models.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Connection Id - The connection ID obtained from the Connect node.
- Prompt - The text prompt describing the image to generate.
Options
- Model - The Imagen model to use for image generation. Options include:
- Imagen 3.0 Generate (Latest)
- Imagen 3.0 Generate v1
- Imagen 3.0 Fast Generate
- Custom Model
- Custom Model - Custom model name when "Custom Model" is selected.
- Number of Images - Number of images to generate (1-4). Default is 1.
- Aspect Ratio - Image aspect ratio. Options are:
- 1:1
- 3:4
- 4:3
- 9:16
- 16:9
- Negative Prompt - Describe what you don't want in the image.
- Person Generation - Control generation of adult content. Options are:
- Allow Adult
- Don't Allow
- Output Format - Format for the output images. Options are:
- PNG
- JPEG
- GIF
- WebP
- BMP
- TIFF
- ICO
- Output Quality - JPEG quality (1-100, only for JPEG format).
Output
- Images - The generated images with file paths and metadata.
How It Works
The Generate Images node creates images from text prompts using Google's Imagen models. When executed, the node:
- Validates the provided connection ID and prompt
- Configures the selected model with all specified parameters
- Sets up generation parameters including number of images, aspect ratio, and safety settings
- Sends an image generation request to the Imagen API
- Saves the generated images to a temporary directory
- Returns structured information about the generated images including file paths and metadata
Requirements
- A valid Google Gemini API key
- Connection ID from a successful Connect node execution
- Valid text prompt describing the desired image
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Connection ID
- Empty Prompt
- Prompt too long (maximum 1000 characters)
- Invalid number of images value
- Invalid output quality value (must be between 1 and 100 for JPEG)
- Invalid custom model name
- Negative prompt too long (maximum 1000 characters)
- API errors from Google's Imagen service
Usage Notes
- The maximum length for prompts and negative prompts is 1000 characters
- Images are saved to a temporary directory with unique names
- For JPEG output, quality can be adjusted between 1-100
- The default aspect ratio is 1:1
- Person generation settings control adult content filtering
- The node returns file paths to the generated images, which can be used by other nodes
- Different models offer different capabilities and performance characteristics
- The default model is "imagen-3.0-generate-002" (latest version)