> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Image editing and multi-image fusion

> Send 1–3 reference images with one instruction to edit text, add or remove objects, restyle, change outfits or scenes, and fuse images.

The same endpoint does image-to-image and editing: put 1–3 `{"image": "..."}` items and exactly one `{"text": "instruction"}` in `content`. The model can edit text in the image, add, delete or move objects, change a subject's action, transfer styles, enhance details, and fuse elements of several images into one.

## Input image requirements

| Item | Requirement |
| - | - |
| Count | 1–3 images |
| Formats | JPG, JPEG, PNG, BMP, TIFF, WEBP, GIF (only the first frame of an animated GIF) |
| Resolution | Width and height 1–8,000 px each, best at 384–2,048 px; too small looks blurry, too large is slower |
| Aspect ratio | Long side : short side at most 10 : 1 |
| File size | Up to 10 MB each |
| How to send | A public `http` / `https` link, or a Base64 data URI `data:{MIME type};base64,{data}`, e.g. `data:image/png;base64,iVBORw0...` |

The output is PNG.

## Image order

Images are numbered in the order they appear in `content`: the first is "image 1", the second "image 2" ("\[image 1]" works too). `text` can come before or after the images.

## Edit one image

Keep the person and change only the outfit and background; `n: 2` returns two candidates:

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/api/v1/services/aigc/multimodal-generation/generation" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-3.0-pro",
    "input": {
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "image": "https://your-cdn.example.com/portrait.png"
            },
            {
              "text": "Keep the face and hairstyle, change the outfit to an off-white suit and the background to a modern minimalist cafe"
            }
          ]
        }
      ]
    },
    "parameters": {
      "n": 2,
      "prompt_extend": true
    }
  }'
```

```python Python theme={null}
import os

import requests

URL = "https://api.dreamto.ai/api/v1/services/aigc/multimodal-generation/generation"
HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}

payload = {
    "model": "qwen-image-3.0-pro",
    "input": {
        "messages": [
            {
                "role": "user",
                "content": [
                    {
                        "image": "https://your-cdn.example.com/portrait.png"
                    },
                    {
                        "text": "Keep the face and hairstyle, change the outfit to an off-white suit and the background to a modern minimalist cafe"
                    }
                ]
            }
        ]
    },
    "parameters": {
        "n": 2,
        "prompt_extend": True
    }
}

result = requests.post(URL, headers=HEADERS, json=payload, timeout=300).json()
if "output" not in result:
    raise SystemExit(result)
for item in result["output"]["choices"][0]["message"]["content"]:
    print(item["image"])
```

```json theme={null}
{
  "request_id": "req_7c1e9a4b2d3f5a6b8c9d0e1f",
  "output": {
    "choices": [
      {
        "finish_reason": "stop",
        "message": {
          "role": "assistant",
          "content": [
            {
              "type": "image",
              "image": "https://dashscope-463f.oss-accelerate.aliyuncs.com/1d/bd/20261117/2299ae9b/qwen_image3_serving_output_0.png?Expires=1794997284&Signature=..."
            },
            {
              "type": "image",
              "image": "https://dashscope-463f.oss-accelerate.aliyuncs.com/1d/bd/20261117/2299ae9b/qwen_image3_serving_output_1.png?Expires=1794997284&Signature=..."
            }
          ]
        }
      }
    ],
    "rewrite_status": "success"
  },
  "usage": {
    "output_width": 1328,
    "output_height": 1328,
    "input_image_count": 1,
    "input_image_type": "qima_input_1k",
    "output_image_count": 2,
    "output_image_type": "qima_output_1k"
  }
}
```

## Fuse several images

Say what each image is for with "image 1", "image 2", "image 3":

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/api/v1/services/aigc/multimodal-generation/generation" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-3.0-pro",
    "input": {
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "image": "https://your-cdn.example.com/girl.png"
            },
            {
              "image": "https://your-cdn.example.com/necklace.png"
            },
            {
              "image": "https://your-cdn.example.com/bag.png"
            },
            {
              "text": "The girl in image 1 wears the necklace from image 2 and carries the bag from image 3 on her left shoulder"
            }
          ]
        }
      ]
    },
    "parameters": {
      "size": "1104*1472",
      "seed": 42
    }
  }'
```

```python Python theme={null}
import os

import requests

URL = "https://api.dreamto.ai/api/v1/services/aigc/multimodal-generation/generation"
HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}

payload = {
    "model": "qwen-image-3.0-pro",
    "input": {
        "messages": [
            {
                "role": "user",
                "content": [
                    {
                        "image": "https://your-cdn.example.com/girl.png"
                    },
                    {
                        "image": "https://your-cdn.example.com/necklace.png"
                    },
                    {
                        "image": "https://your-cdn.example.com/bag.png"
                    },
                    {
                        "text": "The girl in image 1 wears the necklace from image 2 and carries the bag from image 3 on her left shoulder"
                    }
                ]
            }
        ]
    },
    "parameters": {
        "size": "1104*1472",
        "seed": 42
    }
}

result = requests.post(URL, headers=HEADERS, json=payload, timeout=300).json()
if "output" not in result:
    raise SystemExit(result)
for item in result["output"]["choices"][0]["message"]["content"]:
    print(item["image"])
```

## Common instructions

| Use | Example instruction |
| - | - |
| Edit text | Change "Take a Breather" on the note to "Relax and Recharge" |
| Text style | Change "Qwen-Image" to a black handwriting font / a blue-purple gradient / metal |
| Add an element | Add a small wooden sign saying "Welcome to Penguin Beach" in front of the penguin |
| Delete an element | Remove the hair from the plate |
| Subject consistency | Turn the photo into an ID photo with a blue background; the person wears a white shirt, black suit and striped tie |
| Viewpoint | Show the front view / face left / show the back view |
| Old photo restoration | Restore the old photo: remove scratches, reduce noise, enhance details, natural skin tone, clear features |
| Line art / depth map / pose | Generate an image that matches the outline in image 1 and this description: … |
| Creative products | Print this design on a T-shirt and a paper tote bag, shown by a female model |

> [!NOTE]
>
> Editing only supports `prompt_extend_mode: direct` (the default); `agent` returns 400. Without `size` the model picks the output size; pass `size` to fix it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.