Nodes/ComfyUI-piFlow/Load pi-Flow Model
ComfyUI Node

Load pi-Flow Model

The loader behind pi-Flow's 4-step party trick

By Lakonik·Created 10 months ago·Updated 17 days ago· 186
Load pi-Flow Model
    • MODEL
    model_name
    weight_dtype
    adapter_name
    adapter_strength1.00

    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
    • 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.

    CategoryLakonLab

    Inputs (4)

    NameTypeDefaultDescription
    model_nameCOMBO0 options:
    weight_dtypeCOMBO4 options: default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2
    adapter_nameoptCOMBO0 options:
    adapter_strengthoptFLOAT1.00-100–100

    Outputs (1)

    NameTypeDescription
    MODELMODEL