Skip to content
A small, square minimalist illustration shows a geometric computer interface using colorful flat shapes. A paintbrush and an image icon are arranged in a simple design, with symbolic elements alluding to technology, large language model providers, and cloud connectivity. The image is abstract, highly stylized, and uses only five solid colors without any text, people, shadow, or background, highlighting a clean, modern, corporate aesthetic.

Image Generation

GenAIScript support LLM providers with OpenAI-compatible image generation APIs.

You will need to configure a LLM provider that support image generation.

The top-level script (main) cannot be configured to generate an image at the moment; it has be done a function call to generateImage.

generateImage takes a prompt and returns an image URL and a revised prompt (optional).

const { image, revisedPrompt } = await generateImage(
`a cute cat. only one. photographic, high details. 4k resolution.`
)

The image object is an image file that can be passed around for further processing.

env.output.image(image.filename)