Nodes/Comfyui-QwenEditUtils/Qwen Edit Config Preparer
ComfyUI Node

Qwen Edit Config Preparer

Build per-image configs for Qwen edit, one node at a time

By lrzjason·Created 11 months ago·Updated 7 months ago· 835
Qwen Edit Config Preparer
  • image
  • configs
  • mask
  • configs
  • config
to_reftrue
ref_main_imagetrue
ref_longest_edge1024
ref_croppad
ref_upscalelanczos
to_vltrue
vl_resizetrue
vl_target_size384
vl_cropcenter
vl_upscalelanczos

If you're using TextEncodeQwenImageEditPlusCustom, this is the node that feeds it. Custom wants a list of per-image configs, and hand-writing those as JSON is nobody's idea of fun - so ConfigPreparer gives you widgets. One node per image: plug in the picture, set how it should be processed, and out comes a config you chain to the next one. Stack a few and you've described exactly how each reference in your edit should be handled, all with dropdowns instead of a text blob.

The clever bit is that it's chainable. Each ConfigPreparer takes an optional existing configs list and appends to it, so three of them in a row build a three-image list you drop straight into Custom. It's the ergonomic front door to the pack's most powerful node.

How it works

Qwen-Image-Edit reads each input image two ways - through Qwen2.5-VL for meaning and through the VAE for appearance - and a config is just a per-image instruction sheet covering both. ConfigPreparer packages your widget settings into one config object, appends it to any incoming list, and passes the growing list along. Nothing is encoded here; it's pure config assembly. The actual work happens later when Custom consumes the finished list.

The inputs and outputs that matter

Required is just image. The optionals are the config itself, and the ones that earn their keep:

  • configs - the list from an upstream ConfigPreparer. Leave it empty on the first node in the chain, connect it on every one after.
  • ref_main_image - is this the subject of the edit? Default true. In a multi-image chain, exactly one should be true.
  • to_ref / to_vl - whether this image joins the VAE appearance pass and/or the VL semantic pass. Both default true.
  • ref_longest_edge - the VAE-side size for this image (64–4096, default 1024). This is your per-image resolution dial.
  • ref_crop - pad / center / disabled, default pad. Pad preserves the whole image (and keeps the geometry Qwen wants); center crops to fill.
  • mask - an optional region-of-interest mask, so this image only steers the area you care about.

Plus finer knobs - vl_resize, vl_target_size (default 384), vl_crop, ref_upscale, vl_upscale - that you can mostly ignore at first.

Outputs: configs (the updated list - chain it onward or send it to Custom) and config (just this one image's config, if you want it standalone).

Installing it

Comes with the pack. ComfyUI Manager: search Comfyui-QwenEditUtils, install, restart. Or cd ComfyUI/custom_nodes && git clone https://github.com/lrzjason/Comfyui-QwenEditUtils, restart. No models or pip deps of its own - it's a pure helper node under advanced/conditioning.

Common issues

The chain order is where people slip: the first ConfigPreparer leaves configs unconnected, and every subsequent one takes the previous node's configs output as its input. Wire it backwards and you get a list of one. Second, mind the main-image flag - with ref_main_image defaulting to true, a naive three-node chain declares three main images, which is not what you want; set it true on exactly one. If you'd rather define a config as a JSON block than click through widgets, QwenEditConfigJsonParser is the sibling node that does the same job from a string. And since the pack's image scaling has changed across versions, the ref_longest_edge and crop settings that looked right on an older build are worth re-checking after an update.

Categoryadvanced/conditioning

Inputs (13)

NameTypeDefaultDescription
imageIMAGE
configsoptLISTConfigs list
to_refoptBOOLEANtrueAdd image to reference latent
ref_main_imageoptBOOLEANtrueSet image as main image which would return the latent as output.
ref_longest_edgeoptINT102464–4096Longest edge of the output latent
ref_cropoptCOMBOpadCrop method for reference image
ref_upscaleoptCOMBOlanczosUpscale method for reference image
to_vloptBOOLEANtrueAdd image to qwenvl 2.5 encode
vl_resizeoptBOOLEANtrueResize image before qwenvl 2.5 encode
vl_target_sizeoptINT384384–2048Target size of the qwenvl 2.5 encode
vl_cropoptCOMBOcenterCrop method for reference image
vl_upscaleoptCOMBOlanczosUpscale method for reference image
maskoptMASK

Outputs (2)

NameTypeDescription
configsLIST
configANY