Flow-Factory: A Unified Framework for Reinforcement Learning in Flow-Matching Models

Bowen Ping, Chengyou Jia, Minnan Luo, Hangwei Qian, Ivor Tsang
2/13/2026
cs.LGcs.CV

Official code: X-GenGroup/Flow-Factory (696 stars, Apache-2.0, last commit 2026-05-02).

Abstract

Reinforcement learning has emerged as a promising paradigm for aligning diffusion and flow-matching models with human preferences, yet practitioners face fragmented codebases, model-specific implementations, and engineering complexity. We introduce Flow-Factory, a unified framework that decouples algorithms, models, and rewards through through a modular, registry-based architecture. This design enables seamless integration of new algorithms and architectures, as demonstrated by our support for GRPO, DiffusionNFT, and AWM across Flux, Qwen-Image, and WAN video models. By minimizing implementation overhead, Flow-Factory empowers researchers to rapidly prototype and scale future innovations with ease. Flow-Factory provides production-ready memory optimization, flexible multi-reward training, and seamless distributed training support. The codebase is available at https://github.com/X-GenGroup/Flow-Factory.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

A unified framework for easy reinforcement learning in Flow-Matching models

69661Shell, PythonDec 18, 20255 months agoApache-2.0
diffusionflow-matchingimage-generationreinforcement-learningvideo-generation

Similar Papers

Cite this paper

@article{ping2026flowfactory,
  title  = {Flow-Factory: A Unified Framework for Reinforcement Learning in Flow-Matching Models},
  author = {Bowen Ping and Chengyou Jia and Minnan Luo and Hangwei Qian and Ivor Tsang},
  year   = {2026},
  eprint = {2602.12529},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.12529v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.12529.svg)](https://codeofpaper.com/paper/2602.12529)

Discussion