Skip to main content
Generate and edit images through the chat completions endpoint using LLMs that natively support image output.

Overview

Some LLMs can produce images directly as part of a chat response — no separate endpoint required. Instead of calling a dedicated image API, you send a normal chat completion request and the model returns a base64-encoded image in the assistant message. The main image-capable LLM available through Eden AI is Google’s Gemini Flash Image family: It supports:
  • Text-to-image — generate an image from a prompt
  • Image editing — modify a provided input photo
The endpoint stays the same:
Image-capable LLMs are different from Expert Model image generation — which wraps dedicated image APIs like DALL-E or Stable Diffusion. Use LLM image generation when you want the model to reason about the prompt and output an image in the same turn.

Google Gemini Image Models

Gemini image models accept a standard text prompt plus an optional image_config block that controls the output resolution and aspect ratio.

Text-to-image

Supported image_config values

Allowed values vary slightly per model — check the Gemini image generation docs for per-model support.

Image editing (with input photo)

Pass an existing image to the model alongside your edit instruction. Use the standard OpenAI multimodal content format:
You can also pass a remote URL directly instead of base64:

Response Format

The generated image is returned as a base64-encoded data URL inside the assistant message content.

Saving the image to disk

Next Steps

Expert Image Generation

Use dedicated image APIs like DALL-E or Stable Diffusion

Chat Completions

Standard text chat completions reference