Nodes/SpicyAPI/Qwen Image 2.1 · Image Editing
ComfyUI Node

Qwen Image 2.1 · Image Editing

Instruction editing with an optional mask for the pixels you care about

By spicyapi-ai·Created 21 days ago·Updated 2 days ago· 2
Qwen Image 2.1 · Image Editing
  • image_urls
  • mask_url
  • images
  • alpha
  • task id
◄prompt►
◄aspect_ratio1:1►
◄resolution1k►
◄enable_prompt_expansiontrue►
◄backgroundopaque►
◄output_formatjpeg►
◄seed0►

If you've been using ComfyUI for a while, this node replaces a pile of things at once. Object removal, a garment swap, relighting, re-posing, a camera-angle change - the KSAMpler/ControlNet/IP-Adapter/Inpaint stack those used to take is exactly what instruction editing collapsed. You give Qwen Image 2.1 a picture and a sentence, and the change happens.

The catch is the same one the whole category has: the model re-emits the frame. Pixels nobody asked about move. Faces drift if you chain edits. That's not a bug in this node, it's how the architecture works - the image goes into the vision encoder for semantics and the VAE for appearance, and nothing in that design pins the untouched pixels. Which is why the smart version of this node takes a mask.

The inputs

  • prompt - what to change, in plain language. "Change her jacket to navy leather, keep the background" is a valid instruction. So is "make it snow".
  • image_urls - an autogrow group taking one to ten reference images. Sockets grow as you connect things, and a batch counts as multiple images. Each image you add raises the quote, per the node's own tooltip, so add deliberately.
  • mask_url (optional, IMAGE) - black and white: white is the area to repaint, black is kept. This is the answer to drift, and it's the 2026 hybrid everyone lands on: run the edit on a defined region instead of hoping the whole frame holds still. It only works with exactly one reference image, so don't wire a batch into image_urls and then wonder why the run is rejected.
  • aspect_ratio - default 1:1. Set it; the output doesn't inherit the source's shape unless the model happens to agree.
  • resolution - 1k, 1.5k or 2k.
  • enable_prompt_expansion - on by default. It rewrites your instruction into something fuller, which is usually fine for "make it snow" and occasionally catastrophic for "change the sign text to read CLOSED".
  • background / output_format - opaque or transparent, and jpeg/png/webp. Transparent needs png or webp, or you get nothing you can use.
  • seed - fixed by default so a re-queue reuses the first result rather than paying for a second.

Outputs

images, alpha (transparency; 1 is opaque), and task id. The mask is an input - there's no mask output here, so if you want a soft-edged composite you build the feathered mask yourself and feed it in.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/spicyapi-ai/comfyui-spicyapi

Restart, add a key from spicyapi.ai/console/keys under Settings > SpicyAPI, restart once more. No weights, no GPU, no extra packages. On a remote box, SPICY_API_KEY in the environment beats typing the key into a browser.

What to expect and what to watch

Multi-image edits want you to name your pictures. When you feed in two or three images, refer to them positionally - "put the jacket from Picture 2 on the person in Picture 1". Vagueness makes the model average your inputs into a person who is a blend of everyone.

Faces are the weak spot, and it's the whole point of the node. This is well-documented behaviour for the family: faces outside the model's training distribution drift on each pass. A chain of five edits will give you five subtly different people. Mask, crop, and edit small.

Per-image pricing, and editing usually means passes. At roughly $0.036 each, a three-pass edit session with a few reference images is real money. Set Max cost per run in the SpicyAPI settings - every run is quoted before submission, and anything over your ceiling aborts with nothing charged.

Cancelling stops the wait, not the job. Finish-or-refund still happens server-side. A failed run returns a task id, which is what support asks for; 40004 means the parameter combination you picked isn't served, and 40310 means your account's email isn't verified yet.

CategorySpicyAPI/Image/Alibaba

Inputs (9)

NameTypeDefaultDescription
promptSTRINGDescribe the subject, composition, lighting, and any wording to render.
image_urlsCOMFY_AUTOGROW_V3One to ten reference images. Each one you add raises the quote.
aspect_ratioCOMBO1:1Output aspect ratio.
resolutionCOMBO1kOutput resolution tier.
enable_prompt_expansionBOOLEANtrueRewrite the prompt into a fuller scene description before generating. On by default; turn it off to have the prompt followed word for word.
backgroundCOMBOopaqueopaque keeps a normal background; transparent returns the subject alone on a real alpha channel (needs output_format png or webp).
output_formatCOMBOjpegContainer of the returned image.
seedINT00–2147483647Same seed and settings, same result. Set 'control after generate' to randomize to get a new result on every run; every run is billed.
mask_urloptIMAGEOptional black-and-white mask for local editing: white is the area to repaint, black is kept. Use it with exactly one reference image.

Outputs (3)

NameTypeDescription
imagesIMAGE—
alphaMASKTransparency of each image: 1 is opaque.
task idSTRINGThe SpicyAPI task id, for the console logs or support.