Zenlayer icon

Zenlayer

For advanced usage with an AI Gateway from Zenlayer

Actions3

Image → Generate an Image

AI-generated

Summary

Generate images from textual prompts using various supported AI models, returning either image URLs or binary image data.

Inputs

  • Model (required) — Select the AI model to use for generating images. Options include DALL·E 2, DALL·E 3, GPT Image 1, and GPT Image 1.5.
  • Prompt (required) — Enter a text description of the desired image(s). The maximum prompt length varies by model (1000 characters for DALL·E 2, 4000 for DALL·E 3).
  • Options — Configure additional image generation parameters. These include number of images (for DALL·E 2), image quality (model-dependent), resolution (model-dependent), whether to return image URLs instead of binaries (for DALL·E models), style selection (for DALL·E 3), and the name of the output binary field when returning binary data.

Output shape

a list of image data items corresponding to each generated image.

If the 'Respond with Image URL(s)' option is enabled (available for DALL·E 2 and DALL·E 3 models), each output item contains the image URL in JSON. Otherwise, the images are returned as binary data placed in the specified output field (default 'data'). The number of output items matches the number of images generated.

Examples

Example 1: Generate a single image of a cute cat eating a dinosaur using DALL·E 3 with standard quality and 1024x1024 resolution, returning the image as binary data.

Set Model to 'DALL·E 3', enter the prompt text, leave default options with 'Respond with Image URL(s)' disabled.

Example 2: Generate multiple images using DALL·E 2 and receive image URLs instead of binaries.

Set Model to 'DALL·E 2', enter prompt text, set 'Number of Images' as desired, enable 'Respond with Image URL(s)' option.

Links

Discussion