X-GenGroup/Flow-Factory

A unified framework for easy fine-tuning in Flow-Matching models

What it solves

Training diffusion and flow-matching models for different tasks often requires separate codebases and custom implementations. Flow-Factory unifies online RL and offline fine-tuning under one configuration interface, so you can train image, editing, video, and joint audio-video models using the same framework. It removes the need to rewrite the training loop for each new model or algorithm.

How it works

You choose a model and a training objective, then a compatible algorithm (like SFT, DPO, GRPO) and a tuning method (full weights or LoRA). The framework uses a YAML config to specify everything: model, dataset, reward, training backend (DDP, DeepSpeed ZeRO-2, FSDP2), and parallelization (TP/SP/CP). It includes 16 registered trainer types and adapters for 19 model families, with ready-to-run recipes. It also provides tools like prompt enhancement and optional experiment trackers for monitoring.

Who it’s for

Researchers and developers working with diffusion or flow-matching models who want to fine-tune them on custom datasets or apply reinforcement learning to improve generation quality. It's useful for teams that need to scale training across multiple GPUs and want a single tool that supports many model families and algorithms.

Highlights

  • Unified configuration interface covering model, algorithm, and training backend.
  • Supports many model families: SD3.5, FLUX, Qwen-Image, Wan, LTX-2, MiniMax H3, and more.
  • 16 training algorithms including SFT, DPO, GRPO, DPPO, and distillation methods.
  • Parallel training with FSDP2, tensor/sequence/context parallelism for scaling.
  • Prompt enhancement as a separate preprocessing step.
  • Integration with Weights & Biases and SwanLab for experiment tracking.

Related

  • Project
  • Project
  • Project
  • Project
  • Project