Nodes/ComfyUI-MixMod/MixMod Dynamic Mask Guider
ComfyUI Node

MixMod Dynamic Mask Guider

Masks that evolve during sampling

By kantsche·Created about a year ago·Updated 11 months ago· 31
MixMod Dynamic Mask Guider
  • component
  • GUIDER
decay_factor0.90
threshold0.10
blur_sigma0.50

Every MixMod mode so far assumes you know how to divide up the work. The Dynamic Mask guider is the one that tries to figure it out for you: instead of a fixed mask or a fixed weight, it builds a per-region allocation on the fly and lets each model take the pixels where it has the strongest opinion.

Here's the mechanism, and it's genuinely clever. At each step, for each model, the guider computes |conditional − unconditional| - the magnitude of the guidance signal. Where model A's prediction is far from its own unconditional and model B's isn't, that's a region A "cares" about, and the mask shifts that way. Where B dominates, B takes it. The winning model's mask is then blended with the previous step's mask using decay_factor - so the allocation drifts smoothly instead of flickering - and the masks get Gaussian-blurred with blur_sigma to avoid hard seams. Then normal masked blending applies each model inside its region. The pack's author calls this experimental, and it is: you're handing control of the composition to a magnitude heuristic mid-sample.

Inputs

  • decay_factor (default 0.9, 0.1–0.99) - how much of the previous step's mask sticks around. High values = slow, stable evolution; low values = the mask chases the predictions aggressively (and can thrash).
  • threshold (default 0.1, 0.01–0.5) - a fraction of the max magnitude a model must exceed to be allowed to claim a pixel. It filters out noise where nobody has a strong opinion.
  • blur_sigma (default 0.5, 0–10) - edge softening on the masks. Zero gives crisp borders (seams); 1–3 gives gentle territory transitions.
  • component (required) - the chained COMPONENT set. Output: GUIDER, into a guider-accepting sampler.

Two or more models is the whole point; with one model there's no one to compete for pixels.

Installing

Part of ComfyUI-MixMod. ComfyUI Manager → search "ComfyUI-MixMod" → install and restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/kantsche/ComfyUI-MixMod

No requirements.txt, no model downloads. It even writes debug mask images to a local debug/ folder as it runs, which is the pack telling you it expects you to iterate.

Troubleshooting

If the result looks like a single model won everywhere, your threshold is likely too high - nobody clears the bar, so the first model keeps everything. If masks are flipping wildly between steps, decay is too low; raise it toward 0.95. And if you see hard boundaries where regions meet, that's blur_sigma sitting at 0 - bump it to 1+ before you blame the models. One more: since masks are derived from guidance magnitude, models with very different CFG settings will naturally dominate their high-CFG regions; that's expected, tune CFGs alongside the mask knobs rather than fighting them.

Categorymixmod/special

Inputs (4)

NameTypeDefaultDescription
componentCOMPONENT
decay_factorFLOAT0.900.1–0.99
thresholdFLOAT0.100.01–0.5
blur_sigmaFLOAT0.500–10

Outputs (1)

NameTypeDescription
GUIDERGUIDER