Gufo
View on GitHub
Pages
Home / Documentation / v0.37.0

Qwen-Image-2.1

Qwen-Image-2.1 generates images from text and edits images you upload. Gufo runs the BF16 checkpoint and its eight-step Turbo variant behind the OpenAI Images API.

Warning: The weights use the non-commercial Qwen Research License, not Gufo’s MIT license. See the pinned sources and model contract.

Files

The checkpoint is about 33.1 GB:

gufo model install qwen-image-2.1
MODEL=qwen-image-2.1

Run

gufo serve image --model "$MODEL" \
  --served-model-name Qwen-Image-2.1 --port 8080
curl --fail-with-body http://127.0.0.1:8080/v1/images/generations \
  -H 'Content-Type: application/json' \
  -d '{"model":"Qwen-Image-2.1","prompt":"A red ceramic teapot on a wooden table",
       "size":"1024x1024","seed":42}' > response.json
jq -r '.data[0].b64_json' response.json | base64 --decode > output.png

To edit, upload one or more references; the prompt refers to them in upload order:

curl --fail-with-body http://127.0.0.1:8080/v1/images/edits \
  -F model=Qwen-Image-2.1 \
  -F 'image[][email protected]' -F 'image[][email protected]' \
  -F 'prompt=Place the object from the first image in the room from the second image' \
  -F size=1024x1024 -F seed=42 > response.json

Settings

SettingBehavior
sizeauto (the default) gives 1024 × 1024, or the reference’s aspect ratio when editing. Sides must be multiples of 32, at most 4096, and 4.5 megapixels in total, which covers every recommended aspect ratio.
steps40 by default, from 2 to 100. Fewer steps are faster and lower quality.
seedThe same seed, settings and build give the same image, also after a restart.
n1 to 10 images, each with its own seed, made one after another.
backgroundauto, transparent, or opaque (over white).
ReferencesUp to 10 PNG or JPEG files, 20 MiB and 32 megapixels in total.
negative_promptText the image should move away from, used when guidance_scale is above 1.
guidance_scale0 to 100, default 1 (off). Above 1 turns on true classifier-free guidance; each step runs twice, so it takes about twice as long. Without negative_prompt, the negative side is an empty prompt.
strength0.01 to 1 (the default). Below 1, as Diffusers’ image to image, only the last steps × strength steps run, from the noised start image. With size auto, the output keeps the start image’s size, rounded to multiples of 32.
imageStart image of a JSON generation: base64 PNG or JPEG, or a data: URL. URLs are not fetched.

Output is base64 PNG. URL output, separate masks, streaming and input_fidelity aren’t supported. With the OpenAI SDK, pass seed, steps, negative_prompt, guidance_scale and strength through extra_body (both endpoints). Below full strength, an edit’s first image is the start image and further images stay references. Unknown fields are ignored.

The upstream project recommends 2048 × 2048; Gufo defaults to 1024 × 1024, like the pinned Diffusers version. Set size for larger images.

Qwen-Image-2.1-Turbo

Turbo is a separately trained checkpoint (about 32.5 GB, same license) that always uses eight steps. It runs on the same server, API and editing paths:

gufo model install qwen-image-2.1-turbo
MODEL=qwen-image-2.1-turbo
gufo serve image --model "$MODEL" \
  --served-model-name Qwen-Image-2.1-Turbo --port 8080

Omit steps or pass 8; any other value returns HTTP 400.

Serving behind llama-swap

models:
  Qwen-Image-2.1:
    cmd: >
      /path/to/gufo serve image --model /path/to/snapshot
      --served-model-name Qwen-Image-2.1 --port ${PORT}

For large uploads, raise --max-request-bytes and the proxy’s body limit. See llama-swap for the general setup.

LoRA adapters

Register LoRA safetensors published for Qwen/Qwen-Image-2.1 at startup and select them per request by name:

gufo serve image --model "$MODEL"   --lora voxel=/models/loras/Qwen-Image-2.1-Voxel-Style-3000.safetensors   --lora-default voxel:0.8

Generation JSON and edit forms accept "loras": [{"name": "voxel", "scale": 0.8}]; omitting it applies the --lora-default set and [] applies none. The A1111 API that Open WebUI and SillyTavern speak lists them at GET /sdapi/v1/loras. Layouts, limits and the merge: LoRA adapters.

Performance

As of November 1, 2026, on Strix Halo, one 1024 × 1024 image takes:

CheckpointStepsTime
Qwen-Image-2.14089.9 s
Qwen-Image-2.1, editing one reference40130.2 s
Qwen-Image-2.1-Turbo818.6 s

See the full benchmarks and the quality report.

Synced from docs/models/qwen-image-2.1.md at v0.37.0, 2026-11-25.