Actions7
- Chat Actions
- Image Actions
- Audio Actions
Overview
The node "AIConnect" provides access to OpenAI-compatible API functions for multiple AI resources, including chat, image, and audio. Specifically, for the Image resource with the Variation operation, it generates variations of a given input image using a selected AI model.
This is useful when you want to create multiple stylistic or content variations of an existing image automatically. For example, designers can generate different versions of a concept art piece, marketers can produce diverse ad visuals from one base image, or developers can experiment with AI-driven image augmentation.
Practical examples:
- Upload a product photo and generate several stylistic variations for A/B testing.
- Provide a sketch or base image and get multiple AI-generated interpretations.
- Create multiple resolution options or styles of an image for different platforms.
Properties
| Name | Meaning |
|---|---|
| Model | The AI model used for image generation. Options are dynamically loaded via getImageModels. |
| Image | The base image to edit or use as the source for generating variations. |
| Number of Images | How many image variations to generate (1 to 10). |
| Size | The resolution of generated images. Options: "256x256", "512x512", "1024x1024". |
| Response Format | Format of the returned images: either URLs pointing to the images or Base64-encoded JSON strings. |
| Additional Options | Collection of optional parameters: - Quality: "Standard" or "HD" - Style: "Vivid" or "Natural" - User: Unique identifier string representing the end-user. |
| Simplify Output | Whether to return a simplified response containing only essential data instead of full raw output. |
Output
The node outputs an array of JSON objects, each representing one generated image variation. The key fields in the json output typically include:
- If
Response Formatis "URL": URLs pointing to the generated images. - If
Response Formatis "Base64": Base64-encoded image data strings.
If Simplify Output is enabled, the output is a streamlined version focusing on the core image data rather than verbose metadata.
Binary data is not directly output by this node; images are provided as URLs or Base64 strings depending on configuration.
Dependencies
- Requires an API key credential for accessing an OpenAI-compatible image generation service.
- The node dynamically loads available image models via an internal method.
- Network connectivity to the external AI service endpoint is necessary.
- No additional environment variables are explicitly required beyond the API credential.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Providing an invalid image format or corrupted image string may result in errors.
- Requesting more images than allowed (above 10) will be rejected.
- Unsupported model names or unavailable models can cause operation failure.
- Network timeouts or service unavailability will interrupt execution.
Error messages:
"The resource \"image\" is not supported!"— indicates a misconfiguration of the resource parameter.- API error messages related to quota limits, invalid parameters, or authentication should be checked against the external service documentation.
Resolutions:
- Verify API key validity and permissions.
- Ensure the input image is correctly formatted and accessible.
- Use valid model names as listed by the node's model loading method.
- Reduce the number of requested images if hitting limits.
- Check network connectivity and retry on transient failures.
Links and References
- OpenAI Image Generation API Documentation
- n8n Documentation on Creating Custom Nodes
- General info on Base64 encoding: https://en.wikipedia.org/wiki/Base64