Mage-Flow-Edit β€” MLX-Swift

Apple-Silicon MLX-Swift support for microsoft/Mage-Flow-Edit (edit, defaults: 20 steps / cfg 5.0 (RL-aligned)). One of six checkpoints of the Mage-Flow family, all sharing one architecture β€” this repo carries the port's support artifact; the component weights come from the upstream microsoft repo (MIT) and are not re-hosted (multi-component diffusion pipeline β†’ xocialize namespace per mlx-community conventions).

Code, parity gates, and full porting notes: github.com/xocialize/mage-flow-swift. The DiT/VAE/Gaussian-Shading watermark/scheduler are parity-locked against the PyTorch oracle; T2I and CFG paths are gated per-step and validated with renders at the real defaults (sample_512.png is this checkpoint's).

Use

hf download microsoft/Mage-Flow-Edit --local-dir Mage-Flow-Edit
hf download microsoft/Mage-Flow-Edit-Turbo --include "text_encoder/*" --include "vae/*" --local-dir Mage-Flow-Edit   # shared components (byte-identical family-wide)
hf download xocialize/Mage-Flow-Edit-mlx folded_adaln.safetensors --local-dir Mage-Flow-Edit
swift run -c release mage-flow-edit --repo Mage-Flow-Edit --ref dog.jpg --prompt "make the background a snowy forest" --out out.png --steps 20 --cfg 5.0

Notes: the mandatory upstream RAI content filter is wired in (fail-closed); the Gaussian-Shading provenance watermark is reproduced bit-exactly; the DiT runs bf16 with one GEMM row-chunked around mlx-swift's NAX split-K JIT bug (mlx#3797) until a release ships #3810.

Pre-quantized DiT (no bf16 peak)

file recipe gate
transformer-int8.safetensors int8 g32 affine, attn+MLP Linears only int8 quant-vs-bf16 0.999917 (family threshold 0.9998) -> PASS
transformer-int4.safetensors int4 g64 affine, same scope int4 quant-vs-bf16 0.997070 (family threshold 0.9900) -> PASS

Modulation/io/norm layers and the trailing block 11 stay bf16 (the final norm amplifies last-block quant error ~1.6Γ— into proj_out). Files are self-describing (metadata carries bits / group size / kept blocks) and load directly with no bf16 peak β€” int8 gate: quant-vs-bf16 per-pass, family threshold β‰₯ 0.9998; int4 gate: quant-vs-bf16 per-pass, family threshold β‰₯ 0.99. Quantization is weight-only: the mandatory content filter and the bit-exact Gaussian-Shading watermark are unaffected. Measured t2i peak GPU @1024Β²: bf16 19.6 β†’ int8 17.2 β†’ int4 16.1 GB.

# quant tier: skip the 7.7 GB bf16 transformer entirely
hf download microsoft/Mage-Flow-Edit --include "text_encoder/*" --include "vae/*" --local-dir Mage-Flow-Edit
hf download xocialize/Mage-Flow-Edit-mlx folded_adaln.safetensors --local-dir Mage-Flow-Edit
hf download xocialize/Mage-Flow-Edit-mlx transformer-int4.safetensors --local-dir Mage-Flow-Edit
swift run -c release mage-flow-edit --repo Mage-Flow-Edit --dit-quant Mage-Flow-Edit/transformer-int4.safetensors ...

MLXEngine: MLXMageFlow (same repo) wraps the family as MageFlowT2IPackage / MageFlowEditPackage β€” quant tiers auto-materialize these files via WeightSourcing.

Downloads last month

-

Downloads are not tracked for this model. How to track
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for xocialize/Mage-Flow-Edit-mlx

Finetuned
(1)
this model

Collection including xocialize/Mage-Flow-Edit-mlx