Qwen2 - Image Edit
Endpoint
POST /images/generations
Full URL: https://modelfold.ai/v1/images/generations
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Send model parameters directly in the JSON body. Do not wrap them in input. This request waits for generation to finish and returns data[].url; supported media models also offer async jobs, polling and callbacks. Replace example media URLs with your own publicly accessible files. See API gateway for billing and errors.
Input parameters for the generation task
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name to use for generation. Required field. - Must be qwen2/image-edit for this endpoint Default:"qwen2/image-edit"。 Allowed values:qwen2/image-edit。 Example:qwen2/image-edit。 |
prompt | string | Yes | Prompt required by the ModelFold gateway; at most 2000 characters. The prompt to generate the image with (Max length: 800 characters) maxLength: 800. Example:Make the sky a warm sunset.。 |
image_url | array<string> | Yes | URLs of the images to edit. Supports up to 3 images. (File URL after upload, not file content; Accepted types: image/jpeg, image/png, image/webp; Max size: 10.0MB) maxItems: 3. |
image_size | string | No | The size of the generated image. Default value: 16:9 Default:"16:9"。 Allowed values:1:1 / 2:3 / 3:2 / 3:4 / 4:3 / 9:16 / 16:9 / 21:9。 Example:16:9。 |
seed | integer | No | The same seed and the same prompt given to the same version of the model will output the same image every time. |
output_format | string | No | Output format: png or jpeg. Set this field explicitly. Allowed values:jpeg / png。 Example:png。 |
nsfw_checker | boolean | No | Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model. |
Request Example
bash
curl -X POST "https://modelfold.ai/v1/images/generations" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen2/image-edit",
"prompt": "Make the sky a warm sunset.",
"image_url": [
"https://example.com/reference.png"
],
"image_size": "16:9"
}'json
{
"model": "qwen2/image-edit",
"prompt": "Make the sky a warm sunset.",
"image_url": [
"https://example.com/reference.png"
],
"image_size": "16:9"
}Response
200 — Generation completed. usage contains actual billing details; result URLs are illustrative.
json
{
"ok": true,
"created": 1792134000,
"data": [
{
"url": "https://modelfold.ai/uploads/outputs/result.png"
}
],
"usage": {}
}