Skip to content

Repository files navigation

Miles Diffusion

GitHub Repo Documentation License

News | Quick Start | Key Features | Documentation


News

  • [2026/08] 🎉 Miles-Diffusion Release: RL post-training for diffusion models is here — Flow-GRPO, DiffusionNFT, and SFT under one trainer, with end-to-end validated recipes for SD3.5, Qwen-Image, Wan2.2-T2V-A14B, LTX-2.3, and the Cosmos3 MoT omni family. [Docs]

About

Miles-diffusion is currently a standalone repository built on Miles' design philosophy, focused on RL post-training for image and video diffusion models. SGLang-diffusion serves the rollout, and the DiT trains under FSDP2 on a backend that co-evolves with Miles' own. Models load from a diffusers pipeline, or from a native package when a family brings its own modeling. Shipped recipes carry explicit verification levels. Custom rewards, losses, and rollout functions plug in through flags.


Key Features

  • Verified recipes for the latest diffusion models. Launchers for Wan2.2-T2V-A14B, Qwen-Image, LTX-2.3, the Cosmos3 MoT omni family, and SD3.5. TrainPipelineConfig allows for easy model support.
  • Quality control on three fronts. Deterministic mode supports bit-for-bit comparisons for recipes covered by committed E2E standards; SGLang-side monkey patches reduce train/rollout mismatches; and an FSDP2 param-dtype patch provides per-parameter fp32 control under the mixed-precision policy. See Deterministic Training and Dtype Control.
  • SFT, DiffusionNFT, and Flow-GRPO under one trainer. The loss type, training-batch preparation, rollout function, and reward function are all replaceable components, so integrating a new algorithm — or swapping in your own customized component — is easy.
  • SGLang native. Rollout runs on the inference engine itself — the SGLang-diffusion serving stack — with RL support and optimizations living engine-side. An optional curated set of monkey patches aligns selected engine operations with the training-side forward.
  • Multiple parallelisms. The rollout engines scale with tensor and sequence parallelism to support large models and very long contexts; training scales with USP (Ulysses × Ring), built from each family's diffusers _cp_plan — or a self-written one — for agile model integration.
  • LoRA training support. With --lora-ipc-weight-sync, PEFT LoRA on the FSDP2 actor ships only lora_A/lora_B pairs to colocated rollout engines over CUDA IPC and merges them engine-side. See LoRA Training and Weight Sync.

Supported Models

Each model links to its recipe page; every documented recipe is labeled with a recipe verification level.

Model Task Canonical Recipes
Stable Diffusion 3.5 T2I Flow-GRPO + OCR, DiffusionNFT + PickScore
Qwen-Image T2I Flow-GRPO + PickScore (flow_grpo-aligned)
Wan2.2-T2V-A14B T2V Flow-GRPO + PickScore, LoRA SFT
LTX-2.3 T2V Flow-GRPO + PickScore
Cosmos3 (Edge / Nano / Super) T2I Flow-GRPO + PickScore
MiniMax H3 T2VA Flow-GRPO + PickScore

Quick Start


Acknowledgements

Miles-diffusion stands on the shoulders of giants and thanks the following repositories for their outstanding work: Miles · slime · SGLang · diffusers · VeOmni · Flow-GRPO · DiffusionNFT · Flow-Factory


Links

From noise, a world takes shape — one step at a time.

About

Miles-diffusion is an post-training framework for large-scale diffusion model training and production workloads, forked from and co-evolving with miles.

Resources

Stars

44 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages