CustomOpenAi icon

CustomOpenAi

Custom Open AI

Actions2

Overview

The node enables generating images based on textual prompts using an AI image generation service. Users provide a descriptive text prompt, and the node returns one or more images that visually represent the description. This is useful for creative projects, marketing materials, concept art, or any scenario where quick visual content creation from text is needed.

For example, you could input "A cute cat eating a dinosaur" as a prompt, and the node will generate an image matching that description. You can specify how many images to generate and their resolution.

Properties

Name Meaning
Prompt A text description of the desired image(s). Maximum length is 1000 characters.
Response Format The format in which to return the image(s): either Binary Data (image data encoded in base64) or Image Url (a URL pointing to the generated image).
Number of Images How many images to generate (1 to 10).
Resolution The size of the generated images. Options: 256x256, 512x512, or 1024x1024 pixels.

Output

The output contains a JSON field with the generated image data:

  • If Response Format is set to Binary Data, the output includes the image(s) encoded in base64 format within the JSON.
  • If Response Format is set to Image Url, the output provides URLs pointing to the generated image(s).

This allows downstream nodes to either directly use the image data or fetch the image from the provided URL.

Dependencies

  • Requires an API key credential for authenticating with the external AI image generation service.
  • The node expects the base URL of the API to be configured in the credentials.
  • No other external dependencies are indicated.

Troubleshooting

  • Common issues:

    • Invalid or missing API key: The node will fail to authenticate with the image generation service.
    • Exceeding prompt length limit (over 1000 characters) may cause errors.
    • Requesting too many images (more than 10) or unsupported resolutions may result in validation errors.
    • Network or service downtime can cause request failures.
  • Error messages:

    • Authentication errors typically indicate invalid or missing API credentials.
    • Validation errors mention incorrect parameter values such as prompt length or number of images.
    • HTTP errors might occur if the API endpoint is unreachable or returns an error status.

To resolve these, verify your API credentials, ensure parameters meet the specified constraints, and check network connectivity.

Links and References

Discussion