Nodes/ComfyUI-FluxExt-MZ/MinusZone - Flux1PartialLoad_Patch
ComfyUI Node

MinusZone - Flux1PartialLoad_Patch

Run Flux on a card it shouldn't fit on — without quantizing

By MinusZoneAI·Created 2 years ago·Updated 2 years ago· 344
MinusZone - Flux1PartialLoad_Patch
  • model
  • MODEL
double_blocks_cuda_size7
single_blocks_cuda_size7

Flux is a 12-billion-parameter transformer, and "12B" is the whole problem: the full fp16 stack doesn't fit on most consumer cards, which is why the community defaulted to fp8 and GGUF within weeks of release. But there's a different trick that keeps full precision - load the model into system RAM and page its blocks onto the GPU just-in-time, one chunk at a time. That's exactly what MZ_Flux1PartialLoad_Patch does. The three "cpuDynOffload" loaders in the same pack are just this patch bolted onto ComfyUI's normal loaders.

What it actually does

Flux's diffusion transformer isn't one monolith. It's 19 "double" (multimodal DiT) blocks, 38 "single" blocks, and a handful of input/embedding layers on top. This node takes an already-loaded Flux MODEL and registers forward hooks that shuffle those blocks between CPU and CUDA while the sampler runs. Before the model's forward pass, everything except the embedding layers is parked on CPU. Then, right before the first block of each chunk is about to run, a hook swaps: the previous chunk goes to CPU, the next chunk goes to CUDA, and the embed layers that just finished their job get evicted too.

Default of 7 means the 19 double blocks run in 7/7/5 chunks and the 38 single blocks in 7/7/7/7/7/3. At any moment you're holding maybe a quarter of the transformer in VRAM instead of all of it. That's how people get Flux moving on cards that should be too small - you're trading bandwidth for capacity.

The inputs that matter

  • model - a MODEL from any Flux loader. This is the thing being patched.
  • double_blocks_cuda_size - INT, 0–16, default 7. Blocks of the 19-block double (attention) stack kept resident at once.
  • single_blocks_cuda_size - INT, 0–37, default 7. Same idea for the 38-block single stack.

Bigger number = more VRAM, fewer PCIe swaps, faster. Smaller = less VRAM, more paging, noticeably slower. There's exactly one output: MODEL, same model with hooks attached, which wires straight into your sampler. No CLIP, no VAE - this only touches the transformer.

Installing it

From ComfyUI Manager, search ComfyUI-FluxExt-MZ (or "MinusZone"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/MinusZoneAI/ComfyUI-FluxExt-MZ

Restart ComfyUI. That's it - there's no requirements.txt, no extra pip packages, nothing to download. The whole pack is one __init__.py and one core file, GPL-3.0, and it's been sitting untouched since August 2024. A hobbyist's one-trick pack, and the one trick is this patch.

Where people get burned

  • Setting a size to 0 crashes. The code does range(0, depth, 0), which Python refuses. The field's minimum is 0, but "0" is not a clever way to keep everything on CPU - it's an error.
  • The author's README says it plainly: after you modify the parameters and run again, "there will be bugs" (roughly). The hooks mutate the model in place, so a patched model isn't safe to re-patch or reuse. Restart ComfyUI to get a clean model before changing sizes.
  • It only pages the transformer. The T5-XXL text encoder and VAE still load normally and still want VRAM. On a genuinely small card, pair this with an fp8 T5 or a quantized clip - this node is the complement to quantization, not a replacement for it.
  • The whole model has to fit in system RAM, since that's where the parked chunks live. And it's slow - every chunk swap is a trip over PCIe. Fine for a 20-step image; you'll feel it on long or batch runs.
CategoryMinusZone - FluxExt

Inputs (3)

NameTypeDefaultDescription
modelMODEL
double_blocks_cuda_sizeINT70–16
single_blocks_cuda_sizeINT70–37

Outputs (1)

NameTypeDescription
MODELMODEL