TBG KSampler Advanced (Inpaint Split Aware)
A KSampler Advanced that finally talks about inpainting windows
- model
- positive
- negative
- latent_image
- sampler_state
- LATENT
- sampler_state
At a glance this looks like the standard KSamplerAdvanced with extra sliders bolted on, and in a good way. TBG's take on the advanced sampler keeps everything you'd expect - start_at_step, end_at_step, add_noise, return_with_leftover_noise - then adds three genuinely useful controls the stock node doesn't have: an explicit inpainting window, a sharpen/soften stage, and a detail enhancer that changes how the sampler evaluates at each step.
Where people get burned by stock ComfyUI inpainting is timing. The classic KSamplerAdvanced blends the original latent back into the masked area for the whole run, which is often not what you want - you want the model free to invent during the noisy early steps and only pinned to the original in the detail phase, or the reverse. This node gives you inpaint_start and inpaint_end, literally "step numbers where inpainting injection begins/ends." Set inpaint_start higher to delay mask enforcement and let the model improvise; lower inpaint_end to let late steps refine without the mask clamping them. It's the difference between "blend this region" and "redraw this region, then lock it."
What the extra controls do
smoother_sharper(slider, −1 to 1) - a dual-stage effect: at high sigma it adds structured noise for detail invention, at low sigma it applies high-pass edge sharpening. Positive sharpens, negative softens, zero off. It's adaptive, not a fixed unsharp mask.detail_enhancer(slider, −1 to 1) - substep lookahead/lookback. Positive values peek at the next sigma to add coherent detail; negative values look back for creative variation. Zero is disabled, and it's worth knowing it's the fastest setting - the tooltip is honest that this roughly doubles cost on affected steps.sampler_state(optional) - a chaining token. Leave empty on the first sampler, connect the output to the next sampler'ssampler_statefor multi-pass workflows. This is the "split aware" part: the state carries the sigma schedule across passes so chained samplers stay coherent.
Everything else behaves like the stock advanced sampler: cfg defaults to 1 (right for Flux, wrong for SD1.5-style guidance - bump it if your checkpoint expects CFG), denoise, sampler_name, scheduler, and the 44 sampler choices that ship with ComfyUI. Outputs are LATENT plus sampler_state.
Install and setup
Same story as the rest of the pack - ComfyUI Manager, search TBG Takeaways, install, restart. Manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/Ltamann/ComfyUI-TBG-Takeaways
Restart and it appears under TBG/Sampler. No Python deps beyond stock ComfyUI, no model files to fetch.
Two honest caveats. First, this is a Patreon-backed experimental node from a single developer (the pack is literally his "development takeaways" - snippets extracted from his ETUR upscaler), so the docs are the tooltips and little else. Second, detail_enhancer at non-zero can visibly slow a 20+ step run, so start at zero, tune the inpainting window first, and only then dial in the fancy controls. For plain inpainting with a defined injection window, this is a genuinely nicer drop-in than stitching together the stock nodes.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| add_noise | BOOLEAN | true | Enable: add random noise (first sampler). Disable: no noise added (sampler chaining/img2img). Use 'enable' for first sampler, 'disable' for subsequent ones. |
| noise_seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 1.000–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| denoise | FLOAT | 1.000–1 | — |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| latent_image | LATENT | — | |
| start_at_step | INT | 00–10000 | — |
| end_at_step | INT | 100000–10000 | — |
| inpaint_start | INT | 00–10000 | Step number where inpainting injection begins. Inpainting blends the original latent with the denoised latent within the masked area. Set to 0 to start inpainting from the first step. Higher values delay inpainting, allowing more creative freedom before preserving masked regions. |
| inpaint_end | INT | 100000–10000 | Step number where inpainting injection ends. Set to a high value (e.g., 1000) to inpaint through all steps. Lower values allow later steps to refine without mask constraints. Works with inpaint_start to define the inpainting window. |
| smoother_sharper | FLOAT | 0.00-1–1 | Dual-stage adaptive sharpening. At high sigma (early steps), adds structured noise for detail invention. At low sigma (late steps), applies high-pass edge sharpening. Positive values sharpen and add details. Negative values soften and blur. Zero disables sharpening. Higher absolute values create stronger effects. |
| detail_enhancer | FLOAT | 0.00-1–1 | Substep evaluation for detail control. Positive values (0.1-1.0): lookahead to next sigma, adds coherent details and refinement, reduces variation. Negative values (-0.1 to -1.0): lookback to previous sigma, adds creative variation and texture complexity. Zero = disabled (single pass, fastest). Performance cost: 2x slower on affected steps. |
| return_with_leftover_noise | BOOLEAN | false | Enable: keeps noise for sampler chaining. Disable: fully denoise output. Use 'enable' for split workflows, 'disable' for final step. |
| sampler_stateopt | sampler_state | Chain state from previous sampler. Leave empty for first sampler, connect for subsequent samplers in multi-pass workflows. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |
| sampler_state | sampler_state | — |