Create Image Tasks
POST /api/tasks/image-generation
X-Api-Key: sk-live-xxxx
Content-Type: application/json
Idempotency-Key: optional, see below
Generate images from a text description or reference images. Three models are currently available, each for a different purpose:
| Model | Purpose | Input images | Image size |
|---|---|---|---|
| YUYU_C1 | Applies a style template to generate a new image from reference images, with adjustable quality | Optional; only the first 2 are used | Not adjustable |
| YUYU_M3 | Generates a brand-new image from text only | Not needed; including any returns 422 |
Choose from 6 ratios with aspect_ratio, up to 1024×1024 |
| YUYU_M4 | Edits an existing image based on a text instruction | Exactly 1 image to edit is required | Choose from 6 ratios with aspect_ratio, up to 1024×1024 |
How to choose:
- To apply a specific style using reference images: use
YUYU_C1 - No images, text only: use
YUYU_M3 - To edit an existing image: use
YUYU_M4
All three models use the same API; specify the model with the model parameter. See each model's page for its parameters and examples.
Note: whenever the request includes images (even with YUYU_M3, which doesn't use images), the age of the people in the images is checked before generation. If a minor is detected, the task is blocked and fully refunded. You can also pass the age_declared parameter when you create a task; see Pre-generation Age Check.