explaingit

harahan/rtdmd

Analysis updated 2026-05-18

37PythonAudience · researcherComplexity · 5/5LicenseSetup · hard

TLDR

Research code that compresses slow, many-step AI image generators into fast four-step versions while using reward feedback to keep or improve image quality.

Mindmap

mindmap
  root((RTDMD))
    What it does
      Compresses image generators
      Four-step generation
    Method
      AC-DMD cold start
      Reinforcement learning fine-tune
    Tech stack
      Python
      PyTorch
      Diffusion models
    Use cases
      Distill Stable Diffusion or FLUX
      Benchmark few-step generators
    Audience
      ML researchers
      Generative AI engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Compress a slow multi-step image generation model into a fast four-step version.

USE CASE 2

Fine-tune a distilled image generator using reward feedback to improve output quality.

USE CASE 3

Benchmark a few-step image generator against standard reward and quality metrics.

USE CASE 4

Reproduce the paper's results on models like SD3.5 and FLUX.2.

What is it built with?

PythonPyTorch

How does it compare?

harahan/rtdmdhao0321/video-autopilot-kitsignificant-gravitas/gravitasml
Stars373737
LanguagePythonPythonPython
Setup difficultyhardmoderateeasy
Complexity5/53/52/5
Audienceresearchergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1day+

Requires GPU hardware and familiarity with training diffusion or flow-based image models, this is research code, not a packaged app.

In plain English

RTDMD is a research code release accompanying an academic paper on training fast text-to-image generation models. Standard diffusion models generate images through many small steps, often 50 or more. This work focuses on training a model that produces good images in only four steps by combining distribution-matching distillation with reward-guided reinforcement learning. The training process works in two stages. The first stage, called AC-DMD, trains a student model to match the output distribution of a larger teacher model by computing a consistency loss across intermediate generation steps. The second stage, called RTDMD, continues training using a reinforcement learning approach that rewards the student model for producing outputs that score well on metrics like image quality, alignment with the text prompt, and human preference ratings. The two objectives are applied jointly so the student model improves on both dimensions at once. The results reported in the paper show the four-step RTDMD model surpassing its teacher on most evaluated metrics for three model families: SD3-M, SD3.5-M, and FLUX.2 4B. The FLUX.2 4B model trained with RTDMD scores higher than the larger FLUX.2 9B teacher on seven of nine metrics when both are compared at their standard settings, including improvements in image reward, aesthetic score, PickScore, and GenEval. The repository provides training scripts organized into two command-line trainers, one for each stage, along with YAML configuration files for five model backbones. Inference and reward evaluation scripts are also included. Pretrained checkpoints are published on Hugging Face. The code requires Python 3.10 or later and PyTorch.

Copy-paste prompts

Prompt 1
Explain in simple terms what problem RTDMD is solving for AI image generators.
Prompt 2
Walk me through the AC-DMD cold start stage described in Harahan/RTDMD.
Prompt 3
Show me how to run inference with a trained RTDMD model using inference.py.
Prompt 4
Summarize how RTDMD's reward-guided reinforcement learning stage differs from the initial distillation stage.

Frequently asked questions

What is rtdmd?

Research code that compresses slow, many-step AI image generators into fast four-step versions while using reward feedback to keep or improve image quality.

What language is rtdmd written in?

Mainly Python. The stack also includes Python, PyTorch.

How hard is rtdmd to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is rtdmd for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.