Nodes/ComfyUI_VNCCS_Utils/VNCCS QWEN Detailer
ComfyUI Node

VNCCS QWEN Detailer

Fix faces and hands without a mask brush

By AHEKOT·Created 12 months ago·Updated 4 days ago· 1,093
VNCCS QWEN Detailer
  • image
  • bbox_detector
  • model
  • clip
  • vae
  • controlnet_image
  • image2
  • sam_model_opt
  • segm_detector_opt
  • image
◄prompt—►
◄threshold0.50►
◄dilation0►
◄drop_size10►
◄feather0►
◄steps4►
◄cfg1.00►
◄seed0►
◄sampler_name▾►
◄scheduler▾►
◄denoise1.00►
◄tiled_vae_decodefalse►
◄tile_size512►
◄sam_detection_hintcenter-1►
◄sam_dilation0►
◄sam_threshold0.93►
◄sam_bbox_expansion0►
◄sam_mask_hint_threshold0.70►
◄sam_mask_hint_use_negativeFalse►
◄target_size1024►
◄upscale_method▾►
◄crop_method▾►
◄instructionDescribe 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_modefalse►
◄inpaint_prompt[!!!IMPORTANT!!!] Inpaint mode: draw only inside black box.►
◄color_match_methodkornia_reinhard►
◄seam_fixtrue►
◄qwen_2511true►
◄distortion_fixtrue►

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:

  1. Detect - an Impact Pack–style BBOX_DETECTOR finds the regions (face, hand, person, whatever detector you plug in).
  2. Crop & square - each region is cropped and, when distortion_fix is 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.
  3. Generate - the crop is encoded through the Qwen edit model (the model, clip, and vae you plug in) with your prompt and an optional instruction, then sampled with the standard sampler/scheduler/CFG/denoise controls.
  4. Paste back - the result is unsquared, optionally color-matched (kornia_reinhard), and composited with Poisson blending (seam_fix on 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-style reference_latents_method=index_timestep_zero conditioning 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_opt refine detection with SAM, controlnet_image adds a conditioning image, image2 adds 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, and image2 all 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_fix combination is your best defense.
CategoryVNCCS/detailing

Inputs (38)

NameTypeDefaultDescription
imageIMAGE—
bbox_detectorBBOX_DETECTOR—
modelMODEL—
clipCLIP—
vaeVAE—
promptSTRING—
thresholdFLOAT0.500–1—
dilationINT0-512–512—
drop_sizeINT101–16384—
featherINT00–300—
stepsINT41–10000—
cfgFLOAT1.000–100—
seedINT00–18446744073709550000—
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
denoiseFLOAT1.000.01–1—
tiled_vae_decodeBOOLEANfalse—
tile_sizeINT51264–2048—
controlnet_imageoptIMAGE—
image2optIMAGE—
sam_model_optoptSAM_MODEL—
segm_detector_optoptSEGM_DETECTOR—
sam_detection_hintoptCOMBOcenter-19 options: center-1, horizontal-2, vertical-2, rect-4, diamond-4, mask-area, +3
sam_dilationoptINT0-512–512—
sam_thresholdoptFLOAT0.930–1—
sam_bbox_expansionoptINT00–1000—
sam_mask_hint_thresholdoptFLOAT0.700–1—
sam_mask_hint_use_negativeoptCOMBOFalse3 options: False, Small, Outter
target_sizeoptCOMBO10246 options: 1024, 1344, 1536, 2048, 768, 512
upscale_methodoptCOMBO5 options: nearest-exact, bilinear, area, bicubic, lanczos
crop_methodoptCOMBO2 options: disabled, center
instructionoptSTRINGDescribe 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_modeoptBOOLEANfalse—
inpaint_promptoptSTRING[!!!IMPORTANT!!!] Inpaint mode: draw only inside black box.—
color_match_methodoptCOMBOkornia_reinhard2 options: disabled, kornia_reinhard
seam_fixoptBOOLEANtrue—
qwen_2511optBOOLEANtrue—
distortion_fixoptBOOLEANtrue—

Outputs (1)

NameTypeDescription
imageIMAGE—