Nodes/ComfyUI ModelScope API Node/ModelScope-Image 图像编辑节点
ComfyUI Node

ModelScope-Image 图像编辑节点

Instruction editing without masks, on someone else's GPU

By hujuying·Created 12 months ago·Updated 8 months ago· 67
ModelScope-Image 图像编辑节点
  • image
  • edited_image
prompt修改图片中的内容
api_tokens
image_gen_modefalse
gen_modelQwen/Qwen-Image
edit_modelQwen/Qwen-Image-Edit
negative_prompt
width512
height512
steps30
guidance3.5
seed-1
lora1_id
lora1_w0.8
lora2_id
lora2_w0.8
lora3_id
lora3_w0.8

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 (default Qwen/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_wlora3_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.

CategoryModelScopeAPI

Inputs (18)

NameTypeDefaultDescription
imageIMAGE
promptSTRING修改图片中的内容
api_tokensSTRING
image_gen_modeBOOLEANfalse
gen_modeloptCOMBOQwen/Qwen-Image9 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_modeloptCOMBOQwen/Qwen-Image-Edit5 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_promptoptSTRING
widthoptINT51264–1664
heightoptINT51264–1664
stepsoptINT301–100
guidanceoptFLOAT3.51.5–20
seedoptINT-1-1–2147483647
lora1_idoptSTRING
lora1_woptFLOAT0.80–2
lora2_idoptSTRING
lora2_woptFLOAT0.80–2
lora3_idoptSTRING
lora3_woptFLOAT0.80–2

Outputs (1)

NameTypeDescription
edited_imageIMAGE