ModelSamplingPiFlow
The one knob that decides how pi-Flow spends its steps
- model
- MODEL
ModelSamplingPiFlow is the shift knob for pi-Flow models - the equivalent of ModelSamplingFlux or ModelSamplingAuraFlow, but tuned for the pi-Flow schedule. If you've spent time on flow-matching models, you know the drill: on these architectures you don't hunt for a scheduler, you adjust the shift, because that's what controls how sampling effort splits between composition and fine detail. This node is where that adjustment happens for the few-step pi-Flow adapters.
For a beginner the practical answer is short: leave it at 3.2. The shipped pi-Flux workflow wires it between Load pi-Flow Model and pi-Flow Sampler with the default and calls it a day. You touch this node when output starts looking off - and the range matters more than you'd think, because a shift tuned for one model can look visibly wrong on another.
How it works
The node clones your model and swaps in a custom model_sampling object that combines the pack's pi-Flow sampling math with ComfyUI's CONST schedule. The key method is a warp on the timestep: shift * t / (1 + (shift - 1) * t), which redistributes where along the noise→image trajectory the sampling effort lands. A higher shift pushes more resolution toward the early, structure-setting part of the flow; lower shift does the opposite. The node also preserves the multiplier and patch_size already baked into the model config (relevant for the patched FLUX.2 models), so patching doesn't clobber anything the loader set up.
Two inputs: model (the MODEL from your pi-Flow loader) and shift - a float from 0 to 100, default 3.2, in 0.01 steps. Output is a patched MODEL that feeds straight into the pi-Flow Sampler.
When to actually touch it
- Noisy or washed-out at 4 steps: before you blame the sampler, check your FluxGuidance value is exactly 3.5 (FLUX.1) or 4.0 (FLUX.2). Shift tuning won't fix a wrong guidance - the pack hard-wires guidance and tells you not to modify it.
- Composition feels off at your native resolution: nudge shift up in small steps (0.1–0.3) and compare seeds. There's no universal sweet spot; 3.2 is the author's default and it's well-chosen.
- You swapped base models: pi-Flow adapters are trained per base model, and the optimal shift can shift. If you're using a non-standard base, budget some seed-farming time to re-tune.
Install
It ships with the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Lakonik/ComfyUI-piFlow
Restart ComfyUI, or use ComfyUI Manager → search "ComfyUI-piFlow". Requires ComfyUI 0.17.0+; the pack pins a newer floor in its current release, so if you're on an old build, update ComfyUI first or the loader nodes will throw before you even get here. No extra Python dependencies - this pack is pure ComfyUI-native.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| shift | FLOAT | 3.200–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |