Brutal AI
Get an API keyPrepaid, from $10

Brutal AIModelsGuidesEdit images by API with reference images

Guide5 min read

Edit images by API with reference images

One instruction and up to three reference images in, one edited image out. The requests to copy for Qwen Image Edit 2511 on XField, and what makes an instruction work.

Qwen Image Edit 2511 changes a picture from a plain instruction. You can also hand it two or three pictures and have it combine them: this person in that room, this product on that table. On XField no classifier checks the instruction, the pictures or the result, so the edit you ask for is the edit you get.

What you need

  • An XField API key. Create an account, add prepaid credits from $10 and create a key.
  • One to three images, as https URLs, data URIs or uploaded files.

1. Look up the model id

# the id of the editing model: the image model named "Qwen Image Edit"
curl -H "Authorization: Bearer $XFIELD_API_KEY" "https://xfield.cloud.brutal.ai/api/v1/models?kind=image"
export MODEL="<its id>"

2. Edit one image

curl -X POST https://xfield.cloud.brutal.ai/api/v1/queue/$MODEL \
  -H "Authorization: Bearer $XFIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "prompt": "Turn the scene in image 1 into a snowy winter morning. Keep the lighthouse and the coastline as they are.",
        "image_urls": [
          "https://example.com/lighthouse.png"
        ],
        "image_size": "landscape"
      }'

Every run goes through a queue. The request returns at once with a request_id, a status_url, a response_url and a cancel_url. Poll the status until it says COMPLETED, then fetch the result. Or pass a webhook_url and we call you when the run settles.

# the answer to the request above contains status_url and response_url
curl -H "Authorization: Bearer $XFIELD_API_KEY" "$STATUS_URL"     # IN_QUEUE, IN_PROGRESS, COMPLETED
curl -H "Authorization: Bearer $XFIELD_API_KEY" "$RESPONSE_URL"   # the result, once COMPLETED

The result lists the edited image with a signed URL that is valid for an hour. Fetch the result again for a fresh URL.

3. Combine two or three images

Send the pictures in the order you want to name them. The model reads them as image 1, image 2 and image 3.

curl -X POST https://xfield.cloud.brutal.ai/api/v1/queue/$MODEL \
  -H "Authorization: Bearer $XFIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "prompt": "Put the armchair from image 2 into the room from image 1, next to the window. Keep the light of image 1.",
        "image_urls": [
          "https://example.com/room.png",
          "https://example.com/armchair.png"
        ],
        "image_size": "landscape"
      }'

How to write the instruction

DoWhy
Name each reference by numberThe model knows the pictures only as image 1, image 2 and image 3
Say what must stay the sameFor example "keep the face and the pose"; the rest is free to change
Ask for one change per runYou see which instruction did what, and can keep the seed of the result you like
Put unwanted things in negative_promptIt keeps them out without cluttering the instruction

What to change when the edit is off

ProblemFieldTry
The edit ignores part of the instructionguidance_scaleRaise it from the default 4, up to 20
The picture changed more than you askedguidance_scaleLower it, and say in the instruction what stays
Details look roughnum_inference_stepsRaise it from the default 40, up to 60
You want the same result againseedSend the seed that the result reported
Wrong shapeimage_sizesquare, portrait, landscape, wide or an exact width and height

Use your own files

Images that are not on a public URL can be uploaded first. List your uploads with GET /api/v1/files and pass the file's URL in image_urls.

From edited still to clip

An edited still makes a good start for video. Give it to LTX-2.3 as the first frame, or to MiniMax H3 as a reference image when the same person or product has to appear in several clips. Keep a character consistent across AI video clips.

What the rules are

No content filter does not mean no rules. What is allowed is set by a short written acceptable use policy, not by a classifier. Anything that sexualizes minors is banned, and so are fraud and impersonation aimed at real people.

Questions and answers

How do I edit an image by API without a content filter?

Call Qwen Image Edit 2511 on XField with an instruction and one to three reference images. No classifier checks the instruction or the result. Qwen Image Edit 2511.

How do I refer to my reference images?

As image 1, image 2 and image 3, in the order of image_urls.

Can I combine several images into one?

Yes, up to three. Say in the instruction which part comes from which image.

How do I repeat an edit exactly?

Send the same instruction and images with the seed that the first result reported.

Access

Create an account on XField, add prepaid credits from $10, create a key and call any model. One key works for all of them.

Uncensored models don't change what is allowed: you stay responsible for use and results under our acceptable use policy.

More guides