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

MixMod Dynamic Mask Alternative Guider

The no-depth-model foreground/background splitter

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

MixMod has two ways to split a mix into foreground and background. The Depth Guider uses a real depth-estimation model. This one - the "Alternative" - does it with no extra models at all: it estimates a saliency-style mask straight off the first model's conditional prediction, thresholds it, and hands the two halves to your two models.

The mechanism is a heuristic, and it's worth being honest about that. It looks at the first model's conditional prediction magnitude, normalized to 0–1, and treats bright regions as "foreground the model feels strongly about." That becomes a binary mask (above threshold is foreground), which is then blurred with blur_sigma. Model 1 gets the foreground mask, model 2 gets its inverse, and masked blending proceeds. No depth model, no TAESD, no extra VRAM - which is the entire reason it exists as an "alternative" to the depth route.

Inputs

  • threshold (default 0.1, 0.01–0.5) - the cutoff between foreground and background. Lower thresholds give the first model a bigger share.
  • blur_sigma (default 0.5, 0–10) - edge softening between the two regions.
  • invert (default false) - flips which model gets the foreground. If your subject keeps going to the "wrong" model, this is the one-tap fix.
  • component (required) - the chained COMPONENT set; needs at least two models or it falls back to standard mixing. Output: GUIDER.

When to reach for it

It's the cheap version of the Depth Guider: instant, zero dependencies, no model download. That also means it's cruder. The magnitude heuristic doesn't know what a "foreground" is - it knows where the first model's prediction is loud. For a subject-vs-background composition where the subject genuinely dominates the guidance, it works surprisingly well. For scenes with lots of mid-ground detail or where the model is indifferent about what should be the subject, the mask lands in the wrong place and you're better off with the real depth route or just a hand-drawn Mask option.

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 files - this is one of the few special guiders with literally no extra install cost.

Troubleshooting

If the split looks backwards, hit invert before touching anything else. If the two regions blend with visible seams, raise blur_sigma. And the fallback trap: with a single model chained in, the node silently returns standard mixing, so a "nothing happened" result usually means you only wired one model in. Beyond that, when the mask just isn't where you want it, that's the heuristic's limit - reach for the Depth Guider or a static mask instead of fighting it.

Categorymixmod/special

Inputs (4)

NameTypeDefaultDescription
componentCOMPONENT
thresholdFLOAT0.100.01–0.5
blur_sigmaFLOAT0.500–10
invertBOOLEANfalse

Outputs (1)

NameTypeDescription
GUIDERGUIDER