D2 Refiner Steps
Stop doing SDXL refiner math in your head — it's end + 1
- steps
- start
- end
- refiner_start
Two-stage SDXL (base checkpoint + refiner) works by splitting your step range between two KSamplers: the base does the first chunk, the refiner takes over at some step and does the rest. That means every time you change the total step count, you have to recompute where the handoff happens. D2 Refiner Steps is a three-input calculator that does that arithmetic for you.
This is a "slightly convenient" node in the purest sense - it won't make better images, it'll just stop you from wiring end into one KSampler and end + 1 into the next, then forgetting to update both when you bump the steps.
How it works
Three inputs, all integers:
steps- total step count (default 25).start- the step the first KSampler (base) begins at (default 0).end- the step the first KSampler finishes at (default 5).
It does exactly one calculation: refiner_start = end + 1. And it passes everything through:
steps,start,end- passthrough of the inputs.refiner_start- the handoff step for the second KSampler.
So the wiring is: first KSampler runs start to end, second KSampler runs refiner_start to steps. Change steps or end in one place and the refiner's start follows. In D2's own KSampler, that's the start_at_step / end_at_step pair - this node is built to feed exactly those.
The trap and the sibling you might actually want
There's a sibling node, D2 Refiner Steps A1111, that does percentage-based switching (a switch_at like 0.2, meaning "hand off at 20%"). This plain version is pure integer passthrough - good for t2i where you want an absolute step count, not great when you're doing img2img with partial denoise, because your real step range is affected by denoise. If you're upscaling or img2img-ing, that's the node to grab instead.
Installing
It ships in the D2-nodes-ComfyUI pack - install the pack, not the node.
- ComfyUI Manager → search "D2-nodes-ComfyUI" → Install → restart.
- Or
cd ComfyUI/custom_nodes && git clone https://github.com/da2el-ai/D2-nodes-ComfyUIand restart.
Dependencies: piexif and charset-normalizer, no model downloads. Pack gotcha: v32.0.0+ needs the newer ComfyUI V3 schema; older ComfyUI → use a pre-32.0.0 release. Remove the old standalone ComfyUI-d2-steps pack if you have it - it merged in here.
Verifying your numbers
refiner_start = end + 1 is simple enough that you'd think nobody needs a calculator for it, and you'd be right. The reason it exists is the wiring, not the math - one node that outputs all four values means you never desync the two samplers. If you want to eyeball the outputs before you commit, the pack also has D2 Refiner Steps Tester, which just displays whatever lands on its inputs. Not a bad habit when you're building a refiner workflow for the first time: compute once, verify once, then forget the numbers exist.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| steps | INT | 25 | — |
| start | INT | 0 | — |
| end | INT | 5 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| steps | INT | — |
| start | INT | — |
| end | INT | — |
| refiner_start | INT | — |