Nodes/ComfyUI-SimpleTunerFlux2/Load Flux 2 Pipeline (SimpleTuner)
ComfyUI Node

Load Flux 2 Pipeline (SimpleTuner)

Loading Flux 2 the way SimpleTuner needs it (and why the normal loader won't work)

By flowers6421·Created 9 months ago·Updated 9 months ago· 1
Load Flux 2 Pipeline (SimpleTuner)
    • pipeline
    model_path
    torch_dtypebfloat16
    deviceauto
    model_dropdownnone
    use_safetensorstrue
    hf_token

    Every workflow from this pack starts here. SimpleTunerFlux2PipelineLoader (displayed as "Load Flux 2 Pipeline (SimpleTuner)") is the node that loads a Flux 2 base model using SimpleTuner's own pipeline implementation instead of ComfyUI's standard Flux stack - and that distinction is the whole point of the pack. SimpleTuner-trained Flux 2 LoRAs target fused to_qkv_mlp_proj attention layers, which standard ComfyUI Flux nodes can't apply. This loader brings in the SimpleTuner code that understands them, so the LoRA and sampler nodes downstream actually work.

    What it's doing under the hood

    The loader imports SimpleTuner's custom classes - Flux2Pipeline, Flux2Transformer2DModel, and AutoencoderKLFlux2 - from the submodule, then assembles the components: a Mistral-3 text encoder via transformers, FlowMatchEulerDiscreteScheduler for sampling, and the Flux 2 VAE. It can pull from Hugging Face by repo ID or from a local diffusers-style directory, and it caches aggressively: the loaded pipeline is kept in memory and keyed by model_id + dtype + device, so re-queuing a workflow with the same settings is fast, while changing any of those three forces a reload.

    The inputs that matter:

    • model_path - a Hugging Face repo ID (e.g. black-forest-labs/FLUX.2-dev) or a local path to a diffusers folder. Leave empty to use the dropdown.
    • torch_dtype - bfloat16 (default), float16, or float32. Note there is no fp8 option here, which is relevant to the VRAM reality check below.
    • device - auto (default), cuda, or cpu.
    • model_dropdown - scans ComfyUI/models/diffusion_models, checkpoints, and a few root/home dirs for anything containing a valid model_index.json.
    • use_safetensors - on by default; the loader falls back to .bin if the preferred format is missing.
    • hf_token - needed for gated repos like FLUX.2-dev.

    Output is the ST_FLUX2_PIPELINE object, wired into the LoRA loader.

    Installing the pack

    ComfyUI Manager: search "ComfyUI-SimpleTunerFlux2". Or by hand - the --recursive matters, because SimpleTuner ships as a submodule:

    cd ComfyUI/custom_nodes
    git clone --recursive https://github.com/flowers6421/ComfyUI-SimpleTunerFlux2.git
    cd ComfyUI-SimpleTunerFlux2
    ./install.sh          # Linux/macOS
    # python install.py   # Windows
    

    This installs SimpleTuner's requirements (transformers, diffusers≥0.28, peft, accelerate) plus the pack's own, then restart ComfyUI.

    Where people get burned

    • The shipped example workflow points at FLUX.1-dev. True: the workflow.json bundled with the pack has black-forest-labs/FLUX.1-dev as its model path, and this node will refuse to load it. The loader reads model_index.json and raises a clear error if it detects FLUX.1's CLIP+T5 architecture instead of Flux 2's Mistral-3 encoder. This is a leftover in the pack's example, not a bug in your setup - point it at a real Flux 2 model.
    • "No model selected" - that's the error when model_dropdown is on none and model_path is empty. Fill one of them.
    • SimpleTuner import failures - if the console complains it can't find SimpleTuner, the submodule never got initialized. Rerun git submodule update --init --recursive or install.sh, and check the SIMPLETUNER_PATH env var isn't pointing somewhere stale.
    • VRAM, and the README's ~24GB number. The README says ~24GB for Flux 2, and that's the optimistic end - realistic for a Klein-class 9B model, optimistic for the full 32B Dev whose fp8 weights alone run ~50GB. With only bf16/fp16 available here, the full Dev needs a big card. If you're on a 24GB GPU, a Klein 9B is the sane target.
    • Gated downloads - FLUX.2-dev requires accepting the license on Hugging Face and passing a token. Use the hf_token field or huggingface-cli login. Downloads land in ComfyUI/models/diffusion_models/.

    Flux 2 is a heavy ecosystem - the model that won benchmarks and lost the launch over hardware. If you have the card, this loader is how you get SimpleTuner's version of it into a graph.

    CategorySimpleTuner/Flux2

    Inputs (6)

    NameTypeDefaultDescription
    model_pathSTRING
    torch_dtypeCOMBObfloat163 options: bfloat16, float16, float32
    deviceCOMBOauto3 options: cuda, cpu, auto
    model_dropdownoptCOMBOnone1 options: none
    use_safetensorsoptBOOLEANtrue
    hf_tokenoptSTRING

    Outputs (1)

    NameTypeDescription
    pipelineST_FLUX2_PIPELINE