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).
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.
| 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.
transformer/diffusion_pytorch_model.safetensors 8.2 GBtransformer-int8.safetensors 6.1 GBtext_encoder/model-00001-of-00002.safetensors 5.0 GBtransformer-int4.safetensors 4.7 GBtext_encoder/model-00002-of-00002.safetensors 3.9 GBvae/diffusion_pytorch_model.safetensors 345 MBfolded_adaln.safetensors 391 kBHave the files? Submit a torrent.
Submit a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo xocialize/Mage-Flow-Edit-mlx ./model-foldermicrosoft/Mage-Flow-Edit