Qwen-Image 图像编辑节点
Qwen-Image editing in ComfyUI — but it's an API call, not a local model
- image
- edited_image
The name sounds like it runs the 20B Qwen-Image-Edit model on your GPU. It doesn't. Look at the required inputs and the first thing you see is api_token, and the default model string - Qwen/Qwen-Image-Edit - is the identifier Alibaba's DashScope API serves, not a local checkpoint. This node edits your image with Qwen-Image-Edit through a hosted API. You get the model's full quality with zero VRAM cost, and in exchange you need a DashScope API key, you're billed per image, and your source image leaves your machine.
That trade is worth taking seriously. Qwen-Image-Edit is the open instruction editor that made masks optional for a huge class of jobs: hand it a picture and a sentence - "change her dress to blue", "remove the watermark", "make this man lie down on his back in an ice cave" - and the change just happens. It's Apache 2.0 and famously good, and this node is the lazy path to using it without installing GGUF quants, the ComfyUI-Qwen node pack, and a big chunk of VRAM.
How it works
The node takes your image, encodes it, and sends the edit request to the DashScope endpoint with your token. The model returns a whole new image - not a patched one - and the node decodes that back to an IMAGE tensor for the rest of your graph. That "whole new image" bit is the single most important thing to understand, because it's the model's built-in weakness: every pixel gets re-emitted, so things you didn't ask about drift, and faces wander on a chain of edits. People who rely on it bolt a mask back on (crop-and-stitch, or an inpaint pass) to keep the untouched areas actually untouched.
The inputs that matter
- image (IMAGE) - what gets edited.
- prompt (STRING, default "修改图片中的内容" - "edit the content in the image") - the plain-language instruction. This is the whole point: no mask, no ControlNet, just words.
- api_token (STRING) - your DashScope key. Get it from Alibaba Cloud's 百炼/DashScope console; this is a paid service, so mind the billing.
Worth touching:
- guidance (FLOAT, default 3.5) - 3.5–4 is the usual band for this model. Raise it only if edits come out wishy-washy.
- width / height (INT, 64–1664, step 8) - input resolution matters more than it feels like it should. Qwen-Image-Edit is sensitive to input size; keep it near the source's native resolution and sane multiples of 8.
- steps (default 30), seed (default -1 = random) - standard knobs. Set the seed if you're iterating toward a specific result.
- negative_prompt (STRING, empty) - honestly near-useless on this model. Instructions-in-negative-space isn't how Qwen-Image-Edit reasons. Don't fight it.
Output is edited_image (IMAGE) - wire it into a preview or save node. If you're doing sequential edits, run the output back through a preview, look at it, then feed it into the next pass. That's also where the drift compounds, so check each hop.
Install
Nothing special to download for this node - it's part of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam
and restart. You do not need the models the README talks about (lama, SadTalker, face-fusion weights) for this node. You need the API token, which is the real prerequisite. The pack's install.bat pins an ancient dependency set (numpy 1.23.4, tensorflow 2.12) - on a modern ComfyUI I'd skip running it entirely and only pip-install what actually errors.
Common issues
- 401 / auth errors - the token is wrong, expired, or not a DashScope token. This is the #1 failure and it's almost always the key.
- Billing surprises - it's per-call. A chain of 30 edit passes is 30 API calls.
- Faces drift / backgrounds shift between passes - that's the model's whole-frame re-emission, not a bug in the node. Work in smaller steps or protect regions with a mask.
- Slow on long prompts - the model re-reasons about the whole image; that's expected on a hosted API, not something to tune away.
If you want the same power with no token and no cloud, run Qwen-Image-Edit locally (GGUF quant, ~8–12 GB) - but then you don't need this node. This one is for people who want the model without the plumbing.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| prompt | STRING | 修改图片中的内容 | — |
| api_token | STRING | — | |
| modelopt | STRING | Qwen/Qwen-Image-Edit | — |
| negative_promptopt | STRING | — | |
| widthopt | INT | 51264–1664 | — |
| heightopt | INT | 51264–1664 | — |
| stepsopt | INT | 301–100 | — |
| guidanceopt | FLOAT | 3.51.5–20 | — |
| seedopt | INT | -1-1–2147483647 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| edited_image | IMAGE | — |