Nodes/KIE.ai Nodes Next/Qwen 2.1 - Image to Image
ComfyUI Node

Qwen 2.1 - Image to Image

Instruction editing without the 20B download

By felipederosilva·Created about a month ago·Updated a day ago· 3
Qwen 2.1 - Image to Image
  • image_urls
  • image
  • url
  • all_urls_json
  • task_id
  • raw_json
  • credits_consumed
  • credits_left
◄promptReplace the backpack in the first image with the colour scheme from the second image, and leave everything else unchanged►
◄aspect_ratioauto►
◄resolution1K►
◄backgroundopaque►
◄output_formatpng►
◄enhance_prompttrue►
◄seed20260921►
◄mask_urlhttps://example.com/room-mask.png►
◄nsfw_checkerfalse►
◄timeout_seconds1200►
◄callback_url►

What it is

This is KIE's hosted Qwen instruction editor, exposed as a native ComfyUI node: you hand it one or more images plus a sentence and it returns the edited image. If you've been following the local scene, you already know why that name is a big deal - Qwen-Image-Edit became the open instruction editor, the Apache-2.0 answer to Flux Kontext, and by mid-2026 it had eaten a pile of jobs that used to need a mask plus a ControlNet plus an IP-Adapter. See docs/knowledge/ecosystems/qwen.md for that whole story.

So why call it instead of running it? Same reasons as any API node: no 20B model to download, no 12–24GB of VRAM tied up, no ComfyUI Qwen stack to keep in sync with your torch version. You're trading per-call cost and your images leaving your machine for zero setup. If you already run Qwen-Image-Edit 2511 locally, this node is mostly for when you want the job done on a laptop.

How it works

The node is generated from KIE's published request schema for the Qwen 2.1 image-to-image endpoint, so the widgets map one-to-one onto the API fields. image_urls is a native IMAGE socket, so you can pipe a batch in and the pack uploads each image to KIE's storage and swaps in the returned URLs; you never paste a URL. The job is submitted as a task and the node polls until it finishes or timeout_seconds expires, then downloads the result back as a ComfyUI IMAGE.

Inputs and outputs

The two required ones carry the whole idea:

  • image_urls (IMAGE) - one or more reference images. A batch is fine.
  • prompt (STRING, required, up to 5000 characters) - what you want changed. The author's example is the classic multi-reference case: "Replace the backpack in the first image with the colour scheme from the second image, and leave everything else unchanged."

Optional, in rough order of how often you'll touch them:

  • aspect_ratio (auto by default, which inherits the first reference image's ratio snapped to the nearest supported one). Ignored in local-edit mode.
  • resolution - 1K is the fast option; 2K is four times the pixels and, with reference images, can take minutes.
  • background (opaque / transparent) and output_format (png/webp/jpeg). Transparency needs PNG or WebP - JPEG has no alpha.
  • enhance_prompt (on by default) rewrites your sentence into a fuller scene description before generating, and it genuinely helps. Turn it off if you're after something deliberately terse.
  • mask_url - paste a public URL to a black-and-white mask and the request switches into local-edit mode: white is the area to change, black is preserved. Use it with exactly one image in image_urls, or the API returns 422.
  • seed, nsfw_checker, timeout_seconds, callback_url.

Outputs are image (wire it onward or into a preview/save node), url, all_urls_json, task_id, raw_json, credits_consumed and credits_left. The two credit outputs are worth watching on image models - they're how you find out what your iteration habit actually costs.

Install

Manager: search KIE-Nodes-Next, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next

Then paste your KIE.ai key once in Settings → KIE.ai Nodes Next → Connection. The pack validates the key before saving it and shows a masked fingerprint plus the live credit balance, so you know it took. No key means every KIE node errors immediately - nothing gets called.

Where people get burned

The mask is a URL, not a socket. mask_url stays a text field because KIE wants a hosted file. Piping an image into it won't work; you need the mask uploaded somewhere KIE can fetch. The pack's upload utility nodes hand you a URL for a ComfyUI IMAGE, which is the cleanest way to do it.

Resolution creep. 2K with references is not "slightly slower". If you're exploring, stay on 1K and only promote the keeper.

Transparent background plus a scene description gives you a background. The tooltip says it plainly: when you want alpha, describe the subject and nothing else.

422s are input errors, not outages. Over 5000 characters, a mask with more than one reference image, or 4K (only 1K and 2K are accepted) all come back as 422. Read the message before assuming KIE is down.

CategoryKIE Next/Image/Qwen

Inputs (12)

NameTypeDefaultDescription
image_urlsIMAGE—
promptSTRINGReplace the backpack in the first image with the colour scheme from the second image, and leave everything else unchangedThe prompt describing the result you want. Required. Any language is supported, up to 5000 characters; longer input returns 422. When `mask_url` is supplied, use it to describe what should be generated inside the white area of the mask.
aspect_ratiooptCOMBOautoOutput aspect ratio. Defaults to `auto`, which takes the aspect ratio of the first reference image and snaps it to the nearest supported ratio. The actual pixel size also depends on `resolution` — see the aspect ratio table above. Ignored in local-edit mode.
resolutionoptCOMBO1KOutput resolution tier. `1K` is the faster option; `2K` produces four times the pixels and takes considerably longer, up to about 3 minutes with reference images. Only `1K` and `2K` are accepted — any other value, including `4K`, returns 422.
backgroundoptCOMBOopaqueBackground type. transparent outputs a PNG or WebP with a real alpha channel and cannot be used with JPEG. When using transparent, describe only the subject — prompts that mention a background, scene, surface, etc. may produce a non-transparent result.
output_formatoptCOMBOpngOutput image format. `png` (default) and `webp` both carry an alpha channel and can be used with `background: transparent`. `jpeg` has no alpha channel and cannot be combined with a transparent background.
enhance_promptoptBOOLEANtrueRewrites the prompt into a fuller scene description before generating, which noticeably improves quality. Enabled by default (also when the parameter is omitted); pass false to turn it off.
seedoptINT20260921-2147483648–2147483647The random seed. Omit it to generate with a random seed; the seed actually used is returned with the result. Passing the same seed together with the same prompt and parameters reproduces the same image within the same service version.
mask_urloptSTRINGhttps://example.com/room-mask.pngInpainting mask that switches the request into local-edit mode. A black and white image where **white marks the area to change and black is kept unchanged**, with a few pixels of feathering along the boundary. It must be used with exactly one entry in `image_urls`, otherwise the request returns 422. The mask should have the same aspect ratio as that reference image; a mask of a different size is scaled to it. In local-edit mode the output ratio follows the reference image, so `aspect_ratio` and `enhance_prompt` are ignored and reported in the `ignored` field of the result. It cannot be combined with `background: transparent`, which returns 422.
nsfw_checkeroptBOOLEANfalseDefaults to false. You can set it to false based on your needs. If set to false, our content filtering will be disabled, and all results will be returned directly by the model itself. Note: There is no guarantee that everything can be filtered out; if you are not satisfied with the results, you will need to make your own arrangements.
timeout_secondsoptINT120030–7200—
callback_urloptSTRINGOptional KIE callback URL. Leave empty for normal ComfyUI use.

Outputs (7)

NameTypeDescription
imageIMAGE—
urlSTRING—
all_urls_jsonSTRING—
task_idSTRING—
raw_jsonSTRING—
credits_consumedFLOAT—
credits_leftFLOAT—