flux2_load_pipeline

Load the FLUX.2 klein pipeline

Description

Loads the quantized transformer artifact plus the FLUX.2 VAE decoder, Qwen3 text encoder, and tokenizer from the HuggingFace cache populated by download_flux2_klein. With fp8 precision the ~4 GB transformer stays GPU-resident.

Usage

flux2_load_pipeline(model_dir = NULL, device = "cuda",
                    precision = c("fp8", "nf4"), text_device = NULL,
                    attn_chunk = NULL, phase_offload = TRUE, verbose = TRUE)

Arguments

  • model_dir: Quantized artifact directory (default: the download_flux2_klein location for precision), or a raw diffusers transformer directory.
  • device: Character. Compute device.
  • precision: “fp8” (default) or “nf4”.
  • text_device: Device for the Qwen3 encoder (default: device; it encodes in its own phase and offloads).
  • attn_chunk: Integer or NULL. Attention query-chunk override.
  • phase_offload: Logical. One GPU tenant per phase.
  • verbose: Logical.

Value

A flux2_pipeline list.