Image Generation
Text-to-image
POST /v1/images/generations· Image-to-imagePOST /v1/images/edits· Token groupmedia / media-gen
Available Models
| Model name | Description | Resolution | Reference images |
|---|---|---|---|
gpt-image-2 | OpenAI image model | 1K | ≤3 |
firefly-gpt-image-2 | Firefly × GPT image | 1K · 2K · 4K | ≤6 |
nano-banana-2 | Google — strong at both creating and editing images | 1K · 2K · 4K | ≤6 |
seedream-4.5 | ByteDance Seedream 4.5 | 2K · 4K | ≤6 |
flux-kontext-max | Flux — great at editing images on command | 1K | ≤4 |
flux-klein-2 | Krea Flux Klein | 1K · 2K | ≤4 |
firefly-image-5 | Adobe Firefly 5 | 1K · 2K | ≤1 |
imagine-1.5 | Imagine text-to-image | 2K | — |
imagine-1.5pro | Imagine Pro text-to-image | 4K | — |
Express resolution / aspect ratio via the size parameter
In the API, pass size (width x height in pixels) to specify both the aspect ratio and the resolution tier at once: long side ≈1024 → 1K, ≈2048 → 2K, ≈3840 → 4K. Example: "2048x1152" = 16:9 at 2K. In the playground, just click to select. See the live per-tier pricing in the Generation Playground.
Easiest: Use the Generation Playground
- Open the Generation Playground and stay on the "🖼 Image" tab
- Enter your token (from the
media / media-gengroup) - Pick a model → write your prompt → choose an aspect ratio / resolution → click "Generate"
- Once the image is ready you can download it directly, and your history is kept too
Image-to-Image (Reference Images)
Upload reference images and let the model generate or edit based on them (change the style, tweak details, combine multiple images, and more):
- Playground: click the "Reference image" area to upload — multiple images supported (limits per the table above, each ≤8MB)
- API: use
POST /v1/images/edits(multipart; theimagefile field can be passed multiple times), see Calling via the API
Supported Aspect Ratios
Commonly 1:1 · 16:9 · 9:16 · 4:3 · 3:4; some models also support 21:9, 3:2, 2:3, etc. — go by the options shown for that model in the Generation Playground.
How to Write Prompts
- Be specific: subject + scene + style + lighting. Example: "At dusk, a golden retriever running through a golden wheat field, cinematic, shallow depth of field"
- If you want a certain quality or style (realistic, illustration, 3D, cyberpunk, etc.), just say so
- Both Chinese and English work
Integrating Into Your Program
For the full API format plus code examples, see Calling via the API. If something goes wrong, check Common Errors.
