ComfyUI nodes for the promoted XPO3 runtime stack.
The current release supports
Mage-Flow-Turbo-XPO3-NVFP4,
a four-step derivative of Microsoft Mage-Flow-Turbo for native Blackwell
NVFP4 execution with the validated ComfyUI runtime stack bundled in this
plugin.
XPO3: three precisions, one fused runtime. NVFP4 provides transformer speed, FP8 compresses the text encoder, and BF16 is retained where our matched testing found that lower precision caused visible damage.
The v0.3.0 ComfyUI runtime includes the validated composed stack:
- fused GELU-up on eligible NVFP4 up projections;
- calibrated FP4 image-MLP bridge on image blocks
0-8; - official Sparge/Sage2 attention on steps
1-2across all 12 blocks; - the CFG1, batch-one direct-HND attention processor on that routed path;
- exact packaged fallback on steps
0and3; - exact fallback when a toggle is off or the runtime envelope is unsupported.
Each feature remains independently configurable from the Mage-Flow Turbo XPO3 Generate node:
enable_fused_gelu_upenable_fp4_bridgebridge_blocksenable_attention_accelenable_direct_hndattention_stepsattention_blocks
Fallback rules are explicit:
- disabling fused GELU-up restores the original activation module call;
- disabling the bridge, removing a bridge block, or hitting an unsupported shape keeps that block on the packaged path;
- attention routing is enabled only for four-step, CFG1 generations on the supported pipe, with Sparge available;
- steps
0and3always stay on the packaged exact attention path; - unsupported attention envelopes fall back to the original packaged route.
Place the three release files in the normal ComfyUI model directories:
ComfyUI/models/
├── diffusion_models/
│ └── Mage-Flow-Turbo-XPO3-NVFP4.safetensors
├── text_encoders/
│ └── qwen3vl_4b_fp8_scaled.safetensors
└── vae/
└── Mage-Flow-VAE.safetensors
| Component | Size |
|---|---|
| XPO3 diffusion model | 4.87 GB |
| Scaled-FP8 Qwen3-VL text encoder | 5.24 GB |
| Mage VAE | 345 MB |
Use a dedicated ComfyUI virtual environment:
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/AJH-Code/ComfyUI-XPO3.git
cd ComfyUI-XPO3
python -m pip install -r requirements-runtime-cu130.txt
CUDA_HOME=/usr/local/cuda-13.1 \
python -m pip install --no-build-isolation flash-attn==2.8.3
python -m pip install -r /path/to/ComfyUI/requirements.txtRestart ComfyUI, then add:
- Load Mage-Flow Turbo XPO3
- Mage-Flow Turbo XPO3 Generate
- Preview Image or Save Image
The starter API workflow is
example_workflows/mage_flow_turbo_xpo3_api.json.
The starter workflow and node default to 1280x1280. Recommended settings are
four steps, CFG 1.0, and static shift 6.0.
The promoted stack was validated on a robust matrix of 3 prompts x 3 fixed seeds per GPU/resolution, with one warmup and three measured iterations per row. Table values below are candidate warm-generation medians across the nine case/seed rows at each GPU/resolution.
| GPU | Resolution | Warm generation | Vs. packaged FA2 baseline |
|---|---|---|---|
| RTX 5080 | 1024×1024 | 0.5996 s | 1.1862x |
| RTX 5080 | 1280×1280 | 0.9570 s | 1.2116x |
| RTX 5060 Ti | 1024×1024 | 1.3012 s | 1.1771x |
| RTX 5060 Ti | 1280×1280 | 2.1308 s | 1.2034x |
Across the matrix, end-to-end throughput ranged from 1.177x to 1.212x versus the previous packaged resident FA2 baseline. This is not a comparison to Microsoft's BF16 pipeline.
benchmark.py runs the promoted node defaults through the actual ComfyUI
loader/generator surface. It uses the fixed retriever, fisherman, and
glass-house prompts; four steps; CFG 1; static shift 6; a fresh-cache
warm-up; and repeated hot generations. From the plugin directory and the same
ComfyUI Python environment:
python benchmark.py --width 1024 --height 1024 \
--output xpo3_1024_benchmark.jsonThe JSON report records every prompt/seed, timing distribution, environment, load/placement time, and active-feature report. It will not overwrite an existing report. Results vary by GPU, driver, and ComfyUI environment.
Peak allocated memory increased modestly versus the packaged baseline:
- 1024: about +51.0 MiB
- 1280: about +78.6 MiB
The composed stack still stayed under 16 GB on both validated Blackwell cards.
The bundled runtime is an exact binary release for this environment:
| Component | Required |
|---|---|
| Operating system | Linux x86-64 |
| GPU | NVIDIA Blackwell SM120 |
| VRAM | Under 16 GB on the validated stack; 16 GB class validated |
| Python | 3.11 |
| PyTorch | 2.13.0+cu130 |
| TorchVision | 0.28.0+cu130 |
| TorchAudio | 2.11.0+cu130 |
| CUDA ABI used to build bundled binaries | 13.1 |
| Diffusers | 0.38.0 |
| Transformers | 5.5.0 |
| comfy-kitchen | 0.2.22 |
| flash-attn | 2.8.3 |
Windows, WSL, pre-Blackwell GPUs, Python 3.12/3.13, and other PyTorch/CUDA ABIs are not supported by this packaged runtime.
The weights use ComfyUI's normal diffusion-model, text-encoder, and VAE folders and dropdowns. Mage-Flow is not currently implemented by ComfyUI's generic diffusion loader, so the checkpoint still requires these XPO3 custom nodes. It does not yet connect directly to stock KSampler, LoRA, ControlNet, or native Comfy conditioning nodes.
- XPO3 custom-node and packaging code: MIT.
- Mage-Flow-Turbo and Mage source: upstream MIT terms.
- Qwen3-VL and the scaled-FP8 text checkpoint: Apache-2.0.
- Bundled SpargeAttn runtime code and extensions under
runtime/spas_sage_attn/: Apache-2.0.
The SpargeAttn license text is included at
third_party_licenses/SpargeAttn-LICENSE.
The upstream project is
thu-ml/SpargeAttn.
Additional bundled-source notes are summarized in
THIRD_PARTY_NOTICES.md.