Actions7
- Chat Actions
- Image Actions
- Audio Actions
Overview
The node "AIConnect" provides integration with OpenAI-compatible API functions, supporting multiple resources including Chat, Image, and Audio. For the Image - Create operation specifically, it generates images based on a textual prompt using a selected AI model.
This node is beneficial when you want to automate image generation tasks such as creating illustrations, concept art, or visual content from descriptive text prompts. For example, marketing teams can generate product visuals from descriptions, or developers can create placeholder images dynamically during app development.
Properties
| Name | Meaning |
|---|---|
| Model | The AI model used for image generation. Models are loaded dynamically via getImageModels. |
| Prompt | A required text description of the desired image(s). |
| Number of Images | How many images to generate (1 to 10). |
| Size | The resolution of generated images: 256x256, 512x512, or 1024x1024 pixels. |
| Response Format | Format of returned images: either URLs pointing to the images or Base64-encoded JSON data. |
| Additional Options | Collection of optional parameters: |
| - Quality: "Standard" or "HD" image quality. | |
| - Style: "Vivid" or "Natural" style for the image appearance. | |
| - User: A unique identifier representing the end-user (for tracking or personalization). | |
| Simplify Output | Whether to return a simplified response instead of raw API data (default: true). |
Output
The output contains a JSON field with the generated image data:
- If Response Format is set to
"url", the output JSON includes URLs pointing to the generated images. - If set to
"b64_json", the output JSON contains Base64-encoded image data. - When Simplify Output is enabled, the node returns a streamlined version of the response focusing on essential image information rather than the full raw API response.
If multiple images are requested, the output will include an array of images accordingly.
Dependencies
- Requires an API key credential for an OpenAI-compatible service that supports image generation.
- The node dynamically loads available image generation models from the connected API.
- No additional environment variables are explicitly required beyond the API authentication.
Troubleshooting
Common issues:
- Invalid or missing API key: Ensure the API credential is correctly configured in n8n.
- Unsupported model name: Verify the model list is up-to-date by refreshing options.
- Exceeding image count limits: The number of images must be between 1 and 10.
- Incorrect prompt format: The prompt must be a non-empty string describing the desired image.
Error messages:
"The resource \"image\" is not supported!"— This indicates a misconfiguration of the resource parameter; ensure "image" is selected.- API errors related to quota or permissions should be resolved by checking your API subscription and credentials.