BlehModelPatchConditional
Turn a model patch on and off mid-generation
- model_default
- model_matched
- MODEL
Most model patches in ComfyUI are all-or-nothing: you apply HyperTile, or SageAttention, or some other patch to your model, and it's active for the entire generation. BlehModelPatchConditional exists because "the entire generation" is often the wrong scope - maybe you want a speedup patch active only for the middle chunk of steps, or only every third step, or active everywhere except a window near the end where it hurts quality. The pack's own words: it "lets you control when other model patches are active."
The node itself doesn't apply any patch - it decides which of two already-patched model inputs gets used at each step.
How it works
You give it two models: model_default (the fallback, used whenever the timing condition doesn't match) and model_matched (used when it does). Both should be the same underlying loaded checkpoint - one with your patch(es) applied, one without (or with different ones). The node picks between them based on a time window plus a step interval:
- The first sampling step inside the
start_percent/end_percentwindow always usesmodel_matched. - After that,
intervaldecides the cadence. A positive interval like3meansmodel_matchedfires every third step. A negative interval like-3flips it: two out of every three steps getmodel_matched, the third getsmodel_default.
The pack is upfront that this is "very experimental" - not every kind of model modification can be intercepted this cleanly, and you almost certainly shouldn't mix genuinely different models through it (both inputs need to be instances of the same loaded model). It's also not meant to have further patches stacked on top of its output - treat it as the last thing before a sampler.
Inputs and outputs
model_default- fallback model patches, used when start/end/interval don't match.model_matched- model patches used when start/end/interval do match.start_percent/end_percent- floats0–1, defaults0and1. Sampling percentage, not step count, and both bounds are inclusive.interval- integer, default1, range-999to999. Positive activatesmodel_matchedevery N steps; negative skips it every N steps (see above).base_on_default- boolean, defaulttrue. Controls which of the two inputs the active patch set gets applied to internally (model_defaultwhen true,model_matchedwhen false). This is an implementation detail more than a creative knob - leave it on the default unless you're deep enough into the mechanics to know why you'd flip it.
Output is a single MODEL, ready to plug straight into your sampler.
Installing it
- ComfyUI Manager - search "ComfyUI-bleh", install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/blepping/ComfyUI-bleh, restart ComfyUI.
No extra dependencies for this node. (Whatever patch you're conditionally applying - HyperTile, SageAttention, etc. - may have its own requirements; that's on the patch, not on this node.)
Common issues
Garbage output or a crash mid-sampling. The most likely cause is feeding it two models that aren't really the same loaded checkpoint underneath. The node isn't a model mixer - it's a scheduler for two variants of one model. If you've got two genuinely different checkpoints wired in, that's the bug.
A patch you expected to apply conditionally just doesn't seem to toggle. Per the pack's own notes, not every type of model patch can be intercepted by a wrapper like this one - some patches do things this node's interception point can't see. If a patch behaves identically regardless of your interval/percent settings, that patch may simply not be compatible with conditional switching.
You stacked another patch node after this one and things got weird. Don't - the README specifically calls this out as something that should be the last node before your sampler, not a mid-chain link.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model_default | MODEL | Fallback model patches, used when start/end/interval do not match. | |
| model_matched | MODEL | Model patches used when start/end/interval match. | |
| start_percent | FLOAT | 0.0000–1 | Start time as sampling percentage (not percentage of steps). Percentages are inclusive. |
| end_percent | FLOAT | 1.0000–1 | End time as sampling percentage (not percentage of steps). Percentages are inclusive. |
| interval | INT | 1-999–999 | Step interval to use model_matched. If positive 3 would mean activate every third step, if negative -3 would mean skip every third step. |
| base_on_default | BOOLEAN | true | When true, the active set of patches will be applied to model_default, otherwise they will be applied to model_matched. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |