Actions7
Image Generation
AI-generatedOverview
This node operation generates images based on text prompts using a specified AI model. It is useful for creating visual content from descriptive text, such as generating artwork, concept images, or design ideas. Users provide a prompt describing the desired image, select a model, and can customize image generation parameters like size, quality, style, and background.
Use Case Examples
- Generate a fantasy landscape image by providing a detailed prompt and selecting a high-quality model.
- Create multiple variations of a product design by specifying the image count and using negative prompts to avoid unwanted elements.
Properties
| Name | Meaning |
|---|---|
| Model Name or ID | Select the AI model to use for image generation or specify a model ID via expression. |
| Prompt | Text description of the image to be generated by the model. |
| Extract From Response | Choose which part of the API response to return, such as URLs or base64-encoded images. |
| Image Options | Additional parameters to customize image generation, including background, image count, negative prompt, quality, response format, size, and style. |
Output
JSON
imageUrls- Array of URLs for generated images, if response format is URL.imageBase64- Array of base64-encoded images, if response format is base64 JSON.rawResponse- Full raw JSON response from the image generation API.
Dependencies
- An API key credential for the AI/ML API service is required to authenticate requests.
Troubleshooting
- Common issues include invalid or unsupported model IDs, which result in errors indicating unsupported operations.
- Errors may occur if the prompt is empty or improperly formatted; ensure the prompt is a valid descriptive string.
- Network or authentication errors can happen if the API URL or credentials are incorrect; verify the API endpoint and credentials configuration.
Links
- n8n Expressions Documentation - Documentation on how to use expressions to specify dynamic values such as model IDs.