ajh-code's picture
Add README.md
8b6e7c7 verified
|
Raw
History Blame Contribute Delete
4.54 kB
metadata
license: mit
library_name: mage_flow
pipeline_tag: image-to-image
base_model: microsoft/Mage-Flow-Edit-Turbo
base_model_relation: quantized
tags:
  - xpo3
  - mage-flow
  - mage-flow-edit
  - mage-flow-edit-turbo
  - image-editing
  - image-to-image
  - nvfp4
  - fp8
  - blackwell
  - quantization

Mage-Flow Edit Turbo · XPO3 NVFP4

A four-step, native Blackwell W4A4 release of Mage-Flow Edit Turbo.

Original model · ComfyUI source weights · FP8 text encoder source · XPO3 text-to-image sibling


Download

File Purpose Size
Mage-Flow-Edit-Turbo-XPO3-NVFP4.safetensors Self-contained Edit-Turbo transformer 4.65 GB
qwen3vl_4b_fp8_scaled.safetensors Shared scaled-FP8 text encoder 5.24 GB
Mage-Flow-VAE.safetensors Shared Mage VAE 345 MB

The transformer contains all retained BF16 tensors, 48 packed NVFP4 MLP projections, and 24 offline-fused NVFP4 QKV groups. It does not require the 8.23 GB BF16 transformer.


Quick start

Linux, Python 3.11, CUDA 13, and an NVIDIA Blackwell SM120 GPU are required.

hf download ajh-code/Mage-Flow-Edit-Turbo-XPO3-NVFP4 --local-dir mage-edit-xpo3
cd mage-edit-xpo3

python3.11 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt

python edit.py reference.jpg \
  "Replace the background with a snowy pine forest. Keep the subject unchanged." \
  --output edited.png --seed 1 --max-size 1024

The included CLI uses the promoted profile automatically: four steps, CFG 1, shift 6, image-only fused GELU, calibrated FP4 bridge on all 12 blocks, and direct-HND accelerated attention on steps 1–3 with exact step-0 fallback. Every optimization has a CLI disable switch.

The public ComfyUI-XPO3 v0.3.0 nodes target text-to-image Turbo. Use the included Edit CLI until Edit-Turbo node support is released; do not load this checkpoint with the old Turbo Generate node.


Examples

Reference XPO3 edit
Dog reference Dog with snowy forest background
Fruit reference Fruit with cobalt tablecloth

The first edit changes the background while preserving the dog. The second changes only the tablecloth while preserving the fruit and composition.


Measured on RTX 5060 Ti

512-long-edge edit BF16 denoise XPO3 denoise Speedup
Dog background 0.5820 s 0.3216 s 1.81×
Fruit tablecloth 0.6285 s 0.3469 s 1.81×

Peak allocated memory was 5.41–5.54 GiB, 31–33% below the matched BF16 runs. These are hot denoise measurements on one local system, not universal end-to-end claims. Load, multimodal conditioning, reference encoding, denoise, and VAE decode were measured separately.

Validated scope

  • Same-seed outputs were deterministic across fresh and hot repeats.
  • Dog identity, pose, coat, collar, and framing survived a background change.
  • Fruit type, count, layout, bowl, and lighting survived a tablecloth-only change.
  • Step 0 accelerated attention was rejected after a black-image failure and remains on exact fallback.
  • The release file passed checksum, tensor-coverage, zero-source-read clean loading, restoration, and two-case edit-quality gates.

This is an XPO3 runtime package, not a generic portable quantization format. The bundled native libraries target Linux x86-64, Python 3.11, PyTorch 2.13.0+cu130, and SM120.

MIT for the XPO3 package and Mage-derived runtime. The scaled-FP8 Qwen3-VL component and bundled SpargeAttn code are Apache-2.0; see THIRD_PARTY_NOTICES.md.