Reproduce the paper's reinforcement learning training run for the SD3.5-Medium image model.
Study how to apply reward-based fine-tuning to a fast, few-step image generator.
Use the released model weights on Hugging Face to generate images with the trained checkpoint.
Adapt the training recipe to a different few-step generator or reward model.
| harahan/meanflownft | albertaworlds/japanese-corpus-syntactic-analysis-agent | blue-pen5805/comfyui-krea2-negpip | |
|---|---|---|---|
| Stars | 61 | 61 | 61 |
| Language | Python | Python | Python |
| Setup difficulty | hard | hard | moderate |
| Complexity | 5/5 | 4/5 | 2/5 |
| Audience | researcher | researcher | general |
Figures from each repo's GitHub metadata at analysis time.
Needs multiple GPUs, CUDA, a licensed SD3.5-Medium download, and several separately downloaded reward models.
MeanFlowNFT is the official code release for a research paper about training AI image and video generators to follow human preferences more closely, without slowing down how fast they can create pictures. It comes out of Tencent Hunyuan and the Hong Kong University of Science and Technology, and it is published alongside a paper on arXiv, a project webpage, and models hosted on Hugging Face. The starting point is a family of generators called MeanFlow, which can produce a finished image or video in very few steps by learning an average speed of change rather than simulating every tiny step of the generation process. The problem this project solves is how to further improve those fast generators using reinforcement learning, a training method that rewards outputs humans or scoring models rate highly. Normally, adjusting a fast average-speed generator this way is awkward, because the reward signal is easiest to compute using the model's underlying step by step behavior, not its shortcut average behavior. MeanFlowNFT works around this by optimizing rewards in that step by step space internally while keeping the actual model in its fast average-speed form, so generation stays just as quick as before. It builds on a method called DiffusionNFT and carries over a guarantee that, in an ideal case, each training update can only improve the model, not make it worse. According to the results shown, MeanFlowNFT beats other few-step image generation models on six out of eight measured qualities, and a four-step video version outperforms a video model that used fifty steps and its own reinforcement learning process. The current public code covers training and running the SD3.5-Medium image model, a version for the Wan2.1 video model is being built on a separate branch. Setup requires Python 3.10, PyTorch 2.6.0, and CUDA 12.4, installed through a provided requirements file, plus a separately downloaded copy of the SD3.5-Medium model after accepting its license on Hugging Face. Training also needs several reward scoring models such as PickScore, HPSv2, and CLIPScore, most of which download automatically, with instructions for using local copies instead. The training process itself is designed to run across multiple machines with GPUs and involves first generating training data from the base model before running the actual reinforcement learning step. This is research code aimed at people already working in image and video generation, not a beginner-friendly tool.
Research code for MeanFlowNFT, a method that uses reinforcement learning to improve few-step AI image and video generators without slowing them down.
Mainly Python. The stack also includes Python, PyTorch, CUDA.
Apache 2.0 License: free to use, modify, and distribute, including commercially, as long as you keep the copyright and license notices and note any changes you make.
Setup difficulty is rated hard, with roughly 1day+ to a first successful run.
Mainly researcher.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.