BMAB KSampler with Kohya Deep Shrink
High resolution without a second sampling pass
- bind
- image
- lora
- BMAB bind
- image
Every model has a native resolution it was trained at, and pushing past it directly tends to get you tiling, duplicated limbs, or a second head growing out of a shoulder. The usual fix is a two-pass hires fix: generate small, upscale, run a second low-denoise pass. Deep Shrink is a different answer to the same problem - instead of two full sampling passes, it shrinks the U-Net's internal working resolution for the early part of a single denoising run, then lets it scale back up for the rest, so the model spends its early, structure-defining steps at something closer to the resolution it actually knows. This is the technique behind ComfyUI core's own PatchModelAddDownscale (Kohya Deep Shrink) node, and it traces back to the same kohya-ss behind the well-known LoRA training scripts - a distinct trick from that trainer, not part of it, but the same author's name attached to both. BMAB folds the technique into its own sampler node so it fits directly into a BMAB bind pipeline instead of needing a separate model-patching node wired in beforehand.
The parameters that make it work
This is the densest input list in the whole pack, but it maps cleanly onto "when" and "how much":
scale(0-4, default 2) - how much the internal resolution gets shrunk during the affected window. Higher means a more aggressive shrink, which pushes the sampler further from your target resolution during those early steps.block_number(1-32, default 3) - which U-Net block the downscale gets applied at. This is a genuinely technical knob; the default is a reasonable starting point and most people won't need to touch it unless they're chasing a specific artifact.start_percent/end_percent(default 0 / 0.35) - the window, as a fraction of total denoising steps, where the shrink is active. 0 to 0.35 means the first third or so of the run happens at reduced resolution, and the rest proceeds normally - this is deliberately front-loaded, since the early steps are what establish overall composition and are the most damaging to get wrong at the wrong resolution.downscale_after_skip(boolean, default true) - a structural detail of exactly where in the block the downscale is applied.downscale_method/upscale_method- five interpolation choices each (bicubic,nearest-exact,bilinear,area,bislerp), controlling how the resize itself is done going down and coming back up.bislerpandbicubicare the common choices when smoothness matters more than speed.width/height- your actual target generation resolution, unlike BMAB KSampler Hires. Fix, which has no resolution fields of its own and instead relies on whatever's already been resized upstream.
Everything else - steps, cfg_scale, sampler_name, scheduler (defaulting to "Use same sampler"/"Use same scheduler," inheriting from the bind), denoise (default 0.4) - matches the shape of BMAB's other refinement-style sampler nodes.
Inputs, outputs, install
Optional inputs are image and lora, same as the rest of BMAB's sampler family. Output is the standard bind plus image pair.
ComfyUI Manager: search comfyui_bmab, install, restart. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/portu-sim/comfyui_bmab.git
cd comfyui_bmab
pip install -r requirements.txt
plus comfyui_controlnet_aux and ComfyUI_IPAdapter_plus, the two companion packs the README lists as required for comfyui_bmab overall.
Deep Shrink versus a plain hires fix, in practice
Deep Shrink's real advantage is speed - one sampling pass instead of two, since you're not paying for a full second denoise the way BMAB KSampler Hires. Fix requires. The trade-off is that it's a blunter instrument: you're picking a window and a scale rather than directly controlling a second pass's own strength, so getting a specific look sometimes takes more trial and error on start_percent/end_percent/scale than just running a conventional two-pass hires fix would. If your images are coming out with structure baked in wrong (bad overall composition, not just soft detail), try narrowing the window or lowering scale before reaching for anything else - that window is doing the structural work, and too aggressive a shrink for too long can undercook exactly the steps that decide the composition.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| bind | BMAB bind | — | |
| steps | INT | 200–10000 | — |
| cfg_scale | FLOAT | 8.00–100 | — |
| sampler_name | COMBO | 45 options: Use same sampler, euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, +39 | |
| scheduler | COMBO | 10 options: Use same scheduler, simple, sgm_uniform, karras, exponential, ddim_uniform, +4 | |
| denoise | FLOAT | 0.400–1 | — |
| scale | FLOAT | 2.0000–4 | — |
| width | INT | 5120–16384 | — |
| height | INT | 5120–16384 | — |
| block_number | INT | 31–32 | — |
| start_percent | FLOAT | 0.0000–1 | — |
| end_percent | FLOAT | 0.3500–1 | — |
| downscale_after_skip | BOOLEAN | true | — |
| downscale_method | COMBO | 5 options: bicubic, nearest-exact, bilinear, area, bislerp | |
| upscale_method | COMBO | 5 options: bicubic, nearest-exact, bilinear, area, bislerp | |
| imageopt | IMAGE | — | |
| loraopt | BMAB lora | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| BMAB bind | BMAB bind | — |
| image | IMAGE | — |