Nodes/ComfyUI-Apt_Preset/chx_Ksampler_dual_paint
ComfyUI Node

chx_Ksampler_dual_paint

Two independent denoise dials, one for the mask, one for everything else

By cardenluo·Created 2 years ago·Updated 18 days ago· 309
chx_Ksampler_dual_paint
  • context
  • image
  • mask
  • context
  • image
smoothness0
mask_area_denoise0.10
image_area_denoise0.90
refinetrue
refine_denoise0.10
seed0

Most inpaint nodes give you one denoise value that applies inside the mask and leaves everything outside it alone. chx_Ksampler_dual_paint gives you two - a denoise strength for the masked region and a separate one for the rest of the image - plus an optional low-denoise refine pass on top. It's a more aggressive tool than a standard mask-and-fix workflow: it's built for touching the whole canvas, not just protecting everything outside a mask.

What "dual" actually buys you

A conventional inpaint keeps the unmasked area bit-identical and only regenerates inside the mask. This node's two denoise dials - mask_area_denoise and image_area_denoise - mean both regions can change, just by different amounts. The defaults hint at the intended use: mask_area_denoise defaults low (0.1) and image_area_denoise defaults high (0.9), which points at a workflow where the region you've masked is what you want to preserve with minimal change, while everything else gets a strong repaint around it - the inverse of the "protect everything outside the mask" instinct a standard inpaint node trains into you. Treat those defaults as a starting point to experiment from rather than a fixed rule; which region should get the higher number depends entirely on what you're trying to protect versus change in your specific image.

There's also a built-in refine pass: with refine on (the default), the node runs a second low-denoise pass (refine_denoise, default 0.1) after the main sampling, the same "hi-res fix" logic as a standard two-pass generation - clean up and add coherent detail without another full-strength regeneration.

The inputs and outputs that matter

  • context, image, mask, seed - required. Standard inpaint inputs: the base image, the region mask, and a seed.
  • smoothness (0–150, default 0) - feathers the mask edge, same role as out_smoothness on the pack's other inpaint sampler; raise it if you see a hard seam.
  • mask_area_denoise (default 0.1) and image_area_denoise (default 0.9) - the two independent strength dials described above. This pair is what you'll actually spend time tuning.
  • refine (boolean, default true) and refine_denoise (default 0.1) - whether to run the secondary low-denoise cleanup pass, and how strong it is.

Outputs: context and the resulting image - this node composites and returns a single finished image rather than exposing separate cropped intermediates.

Installing it

Through ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

then install.bat on Windows for dependencies, restart. No model files beyond your base checkpoint/VAE are specific to this node.

Common issues

The masked region changed more than expected, or the rest of the image changed when you wanted it protected. Re-check both denoise values - it's easy to assume this behaves like a normal inpaint node (mask = protected-by-default) and get surprised when the un-masked area moves too, since image_area_denoise defaults high. If you want a conventional "only touch the mask" result, push image_area_denoise down toward 0 and mask_area_denoise up instead.

Visible seam at the mask boundary. Raise smoothness - it starts at 0 here, unlike the pack's other inpaint sampler which defaults to a small nonzero value, so you'll likely need to add some deliberately.

Result looks over-smoothed or loses fine detail. That's the refine pass doing its job a bit too aggressively, or refine_denoise set too high for a cleanup pass. Try turning refine off first to isolate whether the base dual-denoise result is what you want, then reintroduce refine at a lower value if needed.

CategoryApt_Preset/chx_ksample/ksample

Inputs (9)

NameTypeDefaultDescription
contextRUN_CONTEXT
imageIMAGE
maskMASK
smoothnessINT00–150
mask_area_denoiseFLOAT0.100–1
image_area_denoiseFLOAT0.900–1
refineBOOLEANtrue
refine_denoiseFLOAT0.100–1
seedINT00–18446744073709550000

Outputs (2)

NameTypeDescription
contextRUN_CONTEXT
imageIMAGE