Load pi-Flow Model
The loader behind pi-Flow's 4-step party trick
- MODEL
Load pi-Flow Model is the front door to the pi-Flow half of this pack - the one that gets you Qwen-Image, FLUX.1 dev, or FLUX.2 dev generating in 4 steps while keeping seed diversity. pi-Flow (arXiv 2510.14974) is a flow-based few-step method that treats the model as predicting a policy over velocity directions rather than a single velocity, which is why it avoids the "every seed is the same image" flatness that DMD-style and Lightning-style speedups get dinged for. The whole thing hangs on a small GMFlow adapter file, loaded on top of a normal base model by this node.
The mechanism: the node loads the base diffusion model from models/diffusion_models, then applies the pi-Flow adapter (a compact LoRA-style file in models/loras carrying the Gaussian-mixture heads) at adapter_strength. It rebuilds the model config so ComfyUI sees the GMFlow policy architecture, and hands you back a MODEL that only the pi-Flow Sampler node knows how to drive - this is not a KSampler model.
The inputs that matter
- model_name - base model from
models/diffusion_models. Pick the one matching your adapter family:- pi-Qwen-Image →
qwen_image_fp8_e4m3fn.safetensors+gmqwen_k8_piid_4step.safetensors - pi-FLUX.1 →
flux1-dev.safetensors+gmflux_k8_piid_4step.safetensors(or the 8-step variant) - pi-FLUX.2 →
flux2_dev_fp8mixed.safetensors+gmflux2_k8_piid_4step.safetensors
- pi-Qwen-Image →
- weight_dtype -
default,fp8_e4m3fn,fp8_e4m3fn_fast,fp8_e5m2. On consumer cards fp8 is the sensible default; the pack also supports scaled-FP8 base models. - adapter_name (optional) - the pi-Flow adapter from
models/loras. - adapter_strength - default 1.0. The author's guidance: if you run a 4-step adapter at 8 steps, contrast shifts - re-calibrate with this knob (1.0–1.4 range) rather than fighting the sampler.
Output: one MODEL, which flows through ModelSamplingPiFlow (shift 3.2) into the pi-Flow Sampler in the shipped workflows.
The rules that actually matter
Guidance is fixed. The adapters only work with guidance set to 3.5 (FLUX.1) or 4.0 (FLUX.2) - the workflow labels the FluxGuidance node "(DO NOT MODIFY)" and the author means it; stray from it and output turns noisy. And use the 4-step adapter for any step count ≥ 4, or the 8-step one at 8 - mismatches amplify or flatten contrast.
Install and files
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 newer. You also need the base model, text encoder, and VAE per the family you chose - the pi-Flow adapter itself is small, but the base FLUX.2 dev + Mistral text encoder stack is a real download. For GGUF base models, install ComfyUI-GGUF first and the Load pi-Flow Model (GGUF) node appears automatically. Also uninstall any non-official pi-Flow extensions before installing, per the README - collisions with this loader are a known complaint.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | 0 options: | |
| weight_dtype | COMBO | 4 options: default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2 | |
| adapter_nameopt | COMBO | 0 options: | |
| adapter_strengthopt | FLOAT | 1.00-100–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |