Qwen Edit Config Preparer
Build per-image configs for Qwen edit, one node at a time
- image
- configs
- mask
- configs
- config
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, defaultpad. 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.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| configsopt | LIST | Configs list | |
| to_refopt | BOOLEAN | true | Add image to reference latent |
| ref_main_imageopt | BOOLEAN | true | Set image as main image which would return the latent as output. |
| ref_longest_edgeopt | INT | 102464–4096 | Longest edge of the output latent |
| ref_cropopt | COMBO | pad | Crop method for reference image |
| ref_upscaleopt | COMBO | lanczos | Upscale method for reference image |
| to_vlopt | BOOLEAN | true | Add image to qwenvl 2.5 encode |
| vl_resizeopt | BOOLEAN | true | Resize image before qwenvl 2.5 encode |
| vl_target_sizeopt | INT | 384384–2048 | Target size of the qwenvl 2.5 encode |
| vl_cropopt | COMBO | center | Crop method for reference image |
| vl_upscaleopt | COMBO | lanczos | Upscale method for reference image |
| maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| configs | LIST | — |
| config | ANY | — |