OpenAI

Consume Open AI

Actions5

Overview

This node enables the creation of images using an AI image generation service. Users provide a textual prompt describing the desired image, select an AI model for generation, and specify output preferences such as format and image quality. The node then sends these parameters to the AI service and returns generated images accordingly.

Common scenarios include:

  • Generating creative or illustrative images from text descriptions for content creation.
  • Producing unique artwork or concept visuals based on user prompts.
  • Automating image generation workflows in marketing, design, or social media contexts.

For example, a user might input the prompt "A cute cat eating a dinosaur" and receive one or more AI-generated images matching that description.

Properties

Name Meaning
Prompt A text description of the desired image(s). Maximum length is 1000 characters.
Model The AI model used for image generation. Options are dynamically loaded and filtered to models starting with "dall-".
Response Format The format to return the image(s): either as a binary file or as an image URL.
Number of Images How many images to generate (1 to 10).
Quality Image quality setting, available only for certain models (e.g., "HD" or "Standard").
Resolution The resolution of the generated image. Options vary by model, e.g., "256x256", "512x512", "1024x1024", etc.
Style The style of the image, available for some models (e.g., "Natural" or "Vivid").

Output

The node outputs JSON data containing the generated image(s). Depending on the selected response format:

  • Binary File: The image data is returned as binary data suitable for further processing or saving as files within n8n.
  • Image URL: The node returns URLs pointing to the generated images hosted by the AI service.

The exact structure includes fields corresponding to the generated images, either as base64-encoded binary data or URLs.

Dependencies

  • Requires an API key credential for authenticating with the AI image generation service.
  • The node makes HTTP requests to the AI provider's API endpoints to fetch available models and generate images.
  • No additional external dependencies beyond standard HTTP and credential configuration in n8n.

Troubleshooting

  • Invalid Prompt Errors: If the prompt exceeds 1000 characters or contains unsupported characters, the API may reject the request. Ensure prompt length and content comply with limits.
  • Model Not Found: Selecting a model not supported or unavailable can cause errors. Use the dynamically loaded model list to avoid this.
  • API Authentication Failures: Missing or invalid API credentials will prevent successful calls. Verify the API key is correctly configured.
  • Response Format Issues: Choosing an unsupported response format or mismatched handling of binary vs URL output may cause downstream errors.
  • Rate Limits or Quotas: Exceeding usage limits imposed by the AI service can result in errors; monitor usage accordingly.

Links and References

Discussion