pi-Flow Sampler
The 4-step sampler that doesn't flatten every seed into the same image
- model
- conditioning
- latent_image
- LATENT
pi-Flow Sampler is the engine of the whole pack - the node that turns a pi-Flow model into 4-step generation that keeps seed diversity. Where most speedup techniques (Lightning, Turbo, DMD2-style adapters) trade variety for speed and can make "every seed is the same image," pi-Flow frames the model as predicting a policy - a Gaussian mixture over possible velocity directions - and the sampler integrates that policy instead of following a single velocity. That's the whole difference, and it's why the pi-Flow release threads got 148+ upvotes in days: quality at 4 steps, but the seeds still vary like a full model.
You replace your KSampler with this node in a pi-Flow workflow. Don't try to run a pi-Flow model through a normal sampler - the author is blunt that pi-Flow doesn't use standard diffusion samplers, and the model outputs a policy a KSampler has no idea what to do with.
The inputs that matter
You'll set maybe four of these and never touch the rest.
- steps - default 4. The 4-step adapter works at 4 or more; the community finds 8 steps noticeably better for coherence on complex scenes while staying way faster than base. Anything ≥ 4 is fair game.
- seed - standard noise seed.
- conditioning - your positive prompt conditioning. Wire the FluxGuidance node in front of it and don't change its value: 3.5 for FLUX.1, 4.0 for FLUX.2. Wrong guidance = noisy output, and the workflow marks it "(DO NOT MODIFY)" for a reason.
- latent_image - the empty latent to denoise (EmptySD3LatentImage in the shipped workflows).
- denoise - default 1.0. Lower it for img2img-style work; it preserves the structure of the input latent.
Then the policy internals: substeps (128) is how many sub-integrations each network step gets along the policy rollout - leave it. final_step_size_scale (0.5) shrinks the last step relative to the others - leave it. diffusion_coefficient (0) controls stochasticity; 0 is fully deterministic, 1 is standard DDPM-style noise - most people leave it at 0. gm_temperature (auto) and manual_gm_temperature (1.0) shape the Gaussian mixture; auto picks a sensible value from your step count.
Output: a single LATENT that goes into VAE Decode.
Install and models
cd ComfyUI/custom_nodes
git clone https://github.com/Lakonik/ComfyUI-piFlow
Restart ComfyUI (or ComfyUI Manager → search "ComfyUI-piFlow"). Requires ComfyUI 0.17.0+; current releases pin a newer floor, so update ComfyUI first. Model files come from the Load pi-Flow Model node's README section - base model, text encoder, VAE, and the small GMFlow adapter per family. On an 8GB card people do run pi-Flow (Flux.2 at 4 steps in under a minute, per one 3060 Ti report), but expect offloading slowness - pi-Flow uses as much VRAM as the base model.
Troubleshooting
Noisy output at 4 steps: check your FluxGuidance value first - this is the #1 cause, not the sampler. Contrast looks wrong: you're probably running a 4-step adapter at 8 steps (or vice versa) - adjust adapter_strength on the loader (1.0–1.4) rather than the sampler. And if the image looks structurally broken at high resolution, that's the adapter's 1MP training resolution showing - bump to 8 steps or upscale progressively.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The model used for denoising the input latent. | |
| seed | INT | 00–18446744073709550000 | The random seed used for creating the noise. |
| steps | INT | 41–10000 | The number of network steps used in the denoising process. |
| substeps | INT | 1281–10000 | The number of policy sub-steps used in the denoising process. |
| final_step_size_scale | FLOAT | 0.500–1 | The size of the final step relative to other steps. |
| diffusion_coefficient | FLOAT | 0.000–1000000 | The coefficient controlling the stochasticity of the sampling process. 0.0 is deterministic. 1.0 is standard DDPM stochasticity. |
| gm_temperature | COMBO | auto | The GMFlow temperature setting. |
| manual_gm_temperature | FLOAT | 1.000–1 | The GMFlow temperature to use if gm_temperature is set to manual. |
| conditioning | CONDITIONING | The conditioning describing the attributes you want to include in the image. | |
| latent_image | LATENT | The latent image to denoise. | |
| denoise | FLOAT | 1.000–1 | The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | The denoised latent. |