generate_image
Generate an image from a text prompt. Control size, ratio, and optionally use reference images for style or character consistency. Returns and saves the PNG to a specified path.
Instructions
Generate an image from a text prompt. Returns the image itself.
HOW MANY reference_images you pass decides whether the model obeys you. This matters more than prompt wording:
0 refs -> art style and composition instructions are followed exactly. The look of any character must be described in words. 1 ref -> keeps the referenced character's likeness AND follows pose instructions, BUT the art style will follow the reference, not your prompt. Use for expression sets / same character, new pose. 3+ refs -> the model starts copying instead of creating. Pose and style instructions stop working; it reproduces the reference, including its background props and artifacts. Avoid.
Style control and likeness control cannot both be had in one call. Decide which one this image needs. To get both: generate once with 0 refs to fix the style, then use that output as the single ref for follow-ups.
Hard limit: 6 reference images, more returns HTTP 400.
Args: prompt: what to draw. Put the full art-style description here. reference_images: local file paths or public https URLs. Read the rule above. size: e.g. "1024x1024", or a tier like "1K" / "2K". ratio: e.g. "1:1", "16:9". save_path: where to write the png. Defaults to a temp file; the path is always reported so the user can find the file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | 1024x1024 | |
| ratio | No | 1:1 | |
| prompt | Yes | ||
| save_path | No | ||
| reference_images | No |