VNCCS QWEN Detailer
Fix faces and hands without a mask brush
- image
- bbox_detector
- model
- clip
- vae
- controlnet_image
- image2
- sam_model_opt
- segm_detector_opt
- image
The classic ComfyUI detailer loop - detect a face, crop it, re-render it at proper resolution, paste it back - was built for SD-era inpainting. VNCCS QWEN Detailer is that same loop re-engineered for Qwen-Image-Edit, and the difference is the refinement step isn't a masked diffusion pass, it's a vision-guided instruction edit. You tell it in plain language what's wrong, and the Qwen edit model fixes the region while the node handles the crop, the alignment, and the seam.
This is the node to reach for when your faces come out smudged, hands are a mess, or you want to change an expression in a specific detected region - all the things the KB's detailing doc says a good detailer exists for, except instead of a fixed inpainting model you're driving an instruction editor.
How it works
It follows the four-step loop the KB describes as the universal detailer pattern, with Qwen-specific surgery at each step:
- Detect - an Impact Pack–style
BBOX_DETECTORfinds the regions (face, hand, person, whatever detector you plug in). - Crop & square - each region is cropped and, when
distortion_fixis on, squared into a padded square. This matters: Qwen-Image-Edit re-emits the whole frame it's given, and an unsquared crop drifts. The KB's Qwen panel calls out geometric offset and drift as the model's known failure modes - squaring is the mitigation. - Generate - the crop is encoded through the Qwen edit model (the model, clip, and vae you plug in) with your
promptand an optionalinstruction, then sampled with the standard sampler/scheduler/CFG/denoise controls. - Paste back - the result is unsquared, optionally color-matched (
kornia_reinhard), and composited with Poisson blending (seam_fixon by default) so the patch melts into the original.
The inputs that matter
The essentials: image, a bbox_detector, the model/clip/vae trio, and your prompt. Then the knobs you'll actually touch:
threshold(0.5) - detector confidence.dilation(0) - grow/shrink the region.drop_size(10) - minimum object size.steps/cfg/sampler_name/scheduler/denoise- the sampling pass. For Qwen-Edit the recommended starting point is aggressive:steps=4,cfg=1.0,denoise=1.0,target_size=1024. These models are trained for low-step guidance.distortion_fix(on) - square-then-unsquare cropping to stop aspect drift. Leave it on for faces and hands.color_match_method(kornia_reinhard) - matches the patch's colors to the source so it doesn't look bolted on.seam_fix(on) - Poisson blending on paste.qwen_2511(on) - applies the 2511-stylereference_latents_method=index_timestep_zeroconditioning patch. Leave it on unless you're deliberately running an older revision.instruction- the system-style instruction prepended to the edit template. The default tells the model to describe the input and then apply your change while keeping everything else consistent.inpaint_mode- optional black-box inpaint mode if you'd rather constrain the edit to a box.- Optional upgrades:
sam_model_opt/segm_detector_optrefine detection with SAM,controlnet_imageadds a conditioning image,image2adds a second visual reference.
Output is a single image - the original with the detected regions regenerated (or the original unchanged if nothing matched).
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/AHEKOT/ComfyUI_VNCCS_Utils.git
cd ComfyUI_VNCCS_Utils
pip install -r requirements.txt
or VNCCS Utils in ComfyUI Manager, restart. Then make sure Impact Pack is installed (the BBOX_DETECTOR type lives there) and you have a Qwen-Image-Edit checkpoint loaded.
Common issues
- No batches.
image,controlnet_image, andimage2all reject batches - one image at a time. - Missing kornia. Color matching silently skips with a console warning if kornia isn't installed; it's in the pack's requirements, so a normal install has it.
- Drift is the model, not the node. Qwen-Edit re-emits whole frames, so unedited pixels move. The node's crop-and-paste architecture limits that to the detected region, but if you chain many edits on one image, expect the KB's known failure mode: faces drifting on a chain of edits. The
color_match+seam_fixcombination is your best defense.
Inputs (38)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| bbox_detector | BBOX_DETECTOR | — | |
| model | MODEL | — | |
| clip | CLIP | — | |
| vae | VAE | — | |
| prompt | STRING | — | |
| threshold | FLOAT | 0.500–1 | — |
| dilation | INT | 0-512–512 | — |
| drop_size | INT | 101–16384 | — |
| feather | INT | 00–300 | — |
| steps | INT | 41–10000 | — |
| cfg | FLOAT | 1.000–100 | — |
| seed | INT | 00–18446744073709550000 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| denoise | FLOAT | 1.000.01–1 | — |
| tiled_vae_decode | BOOLEAN | false | — |
| tile_size | INT | 51264–2048 | — |
| controlnet_imageopt | IMAGE | — | |
| image2opt | IMAGE | — | |
| sam_model_optopt | SAM_MODEL | — | |
| segm_detector_optopt | SEGM_DETECTOR | — | |
| sam_detection_hintopt | COMBO | center-1 | 9 options: center-1, horizontal-2, vertical-2, rect-4, diamond-4, mask-area, +3 |
| sam_dilationopt | INT | 0-512–512 | — |
| sam_thresholdopt | FLOAT | 0.930–1 | — |
| sam_bbox_expansionopt | INT | 00–1000 | — |
| sam_mask_hint_thresholdopt | FLOAT | 0.700–1 | — |
| sam_mask_hint_use_negativeopt | COMBO | False | 3 options: False, Small, Outter |
| target_sizeopt | COMBO | 1024 | 6 options: 1024, 1344, 1536, 2048, 768, 512 |
| upscale_methodopt | COMBO | 5 options: nearest-exact, bilinear, area, bicubic, lanczos | |
| crop_methodopt | COMBO | 2 options: disabled, center | |
| instructionopt | STRING | Describe the key features of the input image (color, shape, size, texture, objects, background), then explain how the user's text instruction should alter or modify the image. Generate a new image that meets the user's requirements while maintaining consistency with the original input where appropriate. | — |
| inpaint_modeopt | BOOLEAN | false | — |
| inpaint_promptopt | STRING | [!!!IMPORTANT!!!] Inpaint mode: draw only inside black box. | — |
| color_match_methodopt | COMBO | kornia_reinhard | 2 options: disabled, kornia_reinhard |
| seam_fixopt | BOOLEAN | true | — |
| qwen_2511opt | BOOLEAN | true | — |
| distortion_fixopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |