ModelScope-Image 图像编辑节点
Instruction editing without masks, on someone else's GPU
- image
- edited_image
You know the classic ComfyUI edit ritual: mask the region, drop in a ControlNet, load an IP-Adapter, cross your fingers. Qwen-Image-Edit made a large chunk of that ceremony obsolete - you hand it a picture and a sentence, and the change just happens. This node is that model as a cloud call: input an image, type "make it look like a watercolor" or "remove the person in the background", and out comes an edited IMAGE with zero local VRAM spent and zero weights downloaded.
How it works
The mechanism has one extra step you should know about. Before the request goes out, the node tries to upload your input image to a third-party image host (ai.kefan.cn in the current source - the README still says "freeimage.host", but the code wins on that one) so the API has a public URL to work from. If the upload fails, it falls back to embedding the image as a base64 data URL. Both paths get the job done; the first one means your image briefly passes through a host you don't control, which is worth knowing if you're editing anything private.
Two modes, one node
The node actually contains two modes behind one switch:
- image_gen_mode (boolean, default off) - off means "图像编辑" (instruction edit) using edit_model, which defaults to
Qwen/Qwen-Image-Edit. On means "图生图" (img2img) using gen_model (defaultQwen/Qwen-Image). Same node, two jobs: describe a change, or restyle the whole image from a prompt. Flip it and the model dropdowns swap which one is active.
The rest of the inputs
The rest of the inputs are familiar: image, prompt, and api_tokens are required; then negative_prompt, width/height (64–1664, step 8 - note the ceiling is lower than the generation node's 2048), steps, guidance (default 3.5), seed (-1 random), and three lora1_id/lora1_w … lora3_id/lora3_w slots that accept the pack's hosted-LoRA loader outputs. Output is a single edited_image tensor, straight into PreviewImage or a save node.
The tip that actually works
The one genuinely useful tip from the author's own docs: for editing, prompt the change, not the content. "Make it look like a watercolor" beats "a watercolor cat" every time, because the edit model is already looking at the cat - it needs to know what to do to it, not what's in it.
Installing it
Installing is the shared pack routine - ComfyUI Manager, searching "ComfyUI ModelScope API Node", or:
cd ComfyUI/custom_nodes
git clone https://github.com/hujuying/ComfyUI-ModelScope-API
then restart. Only extra dependency is openai if you also use the text/vision nodes; the edit node itself is fine with ComfyUI's bundled requests and Pillow.
The honest expectations
Two honest expectations, grounded in how Qwen-Image-Edit actually behaves: it re-emits the whole frame, so pixels you didn't ask about will move, and faces can drift if you chain several edits on the same image - the community's fix is bolting a mask back on around it, which this node doesn't offer. And remember this is a paid, queue-based cloud API: each edit is a network round trip plus task polling, so it's slower than a local 20B would be, but it runs on hardware you don't own.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| prompt | STRING | 修改图片中的内容 | — |
| api_tokens | STRING | — | |
| image_gen_mode | BOOLEAN | false | — |
| gen_modelopt | COMBO | Qwen/Qwen-Image | 9 options: Qwen/Qwen-Image, MusePublic/Qwen-image, Qwen/Qwen-Image-2512, MusePublic/489_ckpt_FLUX_1, MusePublic/flux-high-res, black-forest-labs/FLUX.1-Krea-dev, +3 |
| edit_modelopt | COMBO | Qwen/Qwen-Image-Edit | 5 options: Qwen/Qwen-Image-Edit, MusePublic/Qwen-Image-Edit, Qwen/Qwen-Image-Edit-2511, MusePublic/FLUX.1-Kontext-Dev, black-forest-labs/FLUX.1-Kontext-dev |
| 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 | — |
| lora1_idopt | STRING | — | |
| lora1_wopt | FLOAT | 0.80–2 | — |
| lora2_idopt | STRING | — | |
| lora2_wopt | FLOAT | 0.80–2 | — |
| lora3_idopt | STRING | — | |
| lora3_wopt | FLOAT | 0.80–2 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| edited_image | IMAGE | — |