BlehRefinerAfter
Swap to a refiner model mid-sampling, inline
- model
- refiner_model
- MODEL
The classic SDXL base-then-refiner pattern is usually built with two separate KSampler (or KSamplerAdvanced) nodes chained together, handing the latent from one to the other partway through the schedule. BlehRefinerAfter does the same job a different way: it patches a single model so that partway through sampling, it silently starts routing calls to a different model instead. One sampler node, one patched model input, and the swap happens transparently inside it.
How it works
You give it a model (active from the start of sampling) and a refiner_model (the one it switches to), plus a start_time that defines when the handoff happens. Once you cross that point, the model this node outputs starts calling refiner_model under the hood instead of model - same sampler node, same latent flowing through, just a different network doing the denoising work partway through.
Three ways to express when the switch happens, controlled by time_mode:
timestep- the model's internal noise-level scale, running from999at the very start of sampling down to0at the end. It's roughly the inverse of sampling percentage: high numbers are early, low numbers are late. This is the default mode.percent- plain sampling percentage,0.0at the start and1.0at the end. Not based on step count, based on where you are in the schedule.sigma- an advanced option pitched at people who already know what raw sigma values mean for their scheduler; skip it if that's not you.
The one hard limitation worth internalizing: this only patches the function that actually applies the U-Net. Everything else - conditioning, the sampling type, how the latent is structured - still comes from the base model. That means the two models need to be closely related. The README's own example of what won't work: swapping from SD 1.5 to SDXL mid-sampling. Different architectures, different latent spaces, different conditioning - the patch has no way to bridge that gap. This is for staying inside one model family (base checkpoint to its own refiner, or to a closely related fine-tune), not for hopping architectures.
Inputs and outputs
model- the model to patch; this is also what's active untilstart_timeis reached.refiner_model- the model that takes over oncestart_timeis reached.time_mode-timestep,percent, orsigma, per above.start_time- float, default199, range0–999. What this number means depends entirely ontime_mode-199as a default timestep value means the refiner kicks in fairly late, since timesteps count down to0at the end.
Output is a single MODEL, ready to plug into your sampler exactly like any other model input - no second sampler node, no manual latent handoff required.
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.
Common issues
Output turns to noise or nonsense right around the swap point. This is the number one failure mode, and it's almost always model incompatibility, not a settings mistake. If refiner_model doesn't share the same sampling type and conditioning expectations as model, the handoff produces garbage. Stick to models from the same family.
start_time doesn't seem to do what you expect. Check time_mode first - a value like 0.8 means something completely different depending on whether you're in timestep mode (where it'd be interpreted as a near-zero, very-late-sampling value) versus percent mode (where 0.8 means 80% through sampling). Mixing up which mode you're in is the easiest way to get a swap that happens at the wrong point, or seemingly not at all.
You're trying to jump between genuinely different architectures. Per the README, that's out of scope by design - this patches the U-Net apply function only, and conditioning/sampling-type differences between unrelated architectures will break the result regardless of timing settings.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| time_mode | COMBO | Controls how start_time is interpreted. Timestep will be 999 at the start of sampling and 0 at the end - it is basically the inverse of the sampling percentage with a multiplier. Percent is the percent of sampling (not steps) and will be 0.0 at the start of sampling and 1.0 at the end. Sigma is an advanced option - if you don't know what it is, you don't need to use it. | |
| start_time | FLOAT | 199.000–999 | Time the refiner_model will become active. The type of value you enter here will depend on what time_mode is set to. |
| model | MODEL | Model to patch. This will also be the active model until the start_time condition is met. | |
| refiner_model | MODEL | Model to switch to after the start_time condition is met. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |