# Repository Briefing: Tencent-TEXCH/DiffusionPOND
> Source: https://repoforai.com/repo/Tencent-TEXCH/DiffusionPOND (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/Tencent-TEXCH/DiffusionPOND
- **Official Docs / Website**: https://zhenglin-cheng.com/diffusion_pond/
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: B+ (72/100 · Maintenance 35/35 · Adoption 6/25 · Releases 11/20 · License 20/20)
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: CLI, GPU
- **Momentum**: 21 ★ total (+13 24h / +21 7d) · 1 forks
- **When to Use**: Best for: Research teams that already have a few-step image or video checkpoint and GPU capacity, and want to test black-box reward alignment without increasing the inference step budget. Skip if: You need a turnkey inference service, can only budget CPU or single-GPU training without first validating a smaller recipe, or need the 33B joint audio–video training stack.

## Overview
```text
### Architecture & Core Mechanics
DiffusionPOND is a Python/PyTorch research trainer for online post-training of few-step diffusion and flow generators. For each condition, an exponential moving average (EMA) copy of the evolving generator produces N candidates. A black-box scalar reward ranks them into top-k positive and bottom-k negative distributions. Two LoRA score critics share the generator backbone and train by flow matching: one models the positives, and the other models a mixture of current-generator samples and negatives, controlled by the mixture weight rho.

The generator update re-noises online samples and uses the critics’ score difference in a single DMD-style surrogate for reverse KL in the noisy sample space. The update does not require a pretrained teacher, reward gradients, or a tractable denoising likelihood. The training recipe pairs a 4:1 critic-to-generator update ratio with EMA tracking and rollout replay. The practical integration surface is the YAML configuration, scalar reward path, and model-specific training recipes. The core package pins PyTorch 2.6.0 and depends on NumPy, PyYAML, and W&B; Diffusers, Transformers, Accelerate, and PEFT are available through the `diffusers` extra.

### Key Capabilities & Differentiators
The released training and evaluation scope covers text-to-image with SD3.5-M-Turbo, text-to-video with Wan2.1-T2V 1.3B (rCM, AnyFlow, and SMD) and 14B (rCM), and autoregressive Causal-rCM Wan2.1-1.3B with chunk sizes 1 and 3 and KV caching. Image recipes target PickScore, OCR, GenEval, or a joint reward. The `configs/pond/` tree includes ablations for candidate ranking, EMA, the negative-mixture weight, rollout steps, and replay. The 33B MiniMax-H3 joint audio–video experiments used a separate codebase and are not part of this release scope.

At 1024×1024 and four function evaluations (NFE), SD3.5-M-Turbo with POND records 23.885 PickScore, 0.948 OCR, and 0.767 GenEval, versus 22.331, 0.284, and 0.587 for the Turbo initialization. At 480p and 81 frames, Wan2.1-T2V 1.3B with POND reaches 84.25 VBench Total and 85.14 VBench Quality at four NFE, up from 83.70 and 84.57 for the four-NFE rCM initialization. The 14B result uses a different metric: a +20.1% Gemini-judged test-set preference gain over the four-step initialization, not a VBench gain.

### Trade-offs & Limitations
POND is a candidate when the inference budget is fixed at a few evaluations. Four NFE instead of 40 or 50 reduces the number of model evaluations; it is not an end-to-end latency measurement or evidence of lower training cost. In the Wan 1.3B table, POND costs 764 GPU-hours versus 329 for ReFL and 704 for Flow-GRPO Fast, while leading both on VBench Total. It costs less than the listed DiffusionNFT run at 2,682 GPU-hours. The image ranking is also metric-dependent: four-NFE POND leads on PickScore, but 40-NFE DiffusionNFT leads on GenEval.

Dropping the pretrained teacher and reward gradients does not remove the cost of generating and scoring multiple candidates or alternating critic and generator updates. Reward choice and top/bottom partitioning define what the generator is pushed toward, so held-out metrics matter when adopting a new reward mix. `configs/baselines/` gives researchers aligned DiffusionART, DiffusionNFT, Flow-GRPO-Fast, and ReFL recipes for comparison. The code is Apache-2.0, but checkpoint, reward-model, and third-party terms still need their own review.

### Hardware & Deployment Guide
The local setup uses `uv` and `uv.lock` with Python 3.10 or newer and a documented PyTorch 2.6.0 / CUDA 12.4 stack. For image training, install the locked Diffusers and image-reward extras, resolve the `${ENV_VAR}` placeholders in the chosen recipe, and use `visual_rl.prepare_assets --plan` to inspect asset requirements. Run `visual_rl.check_environment` and `visual-rl --config <config.yaml> --validate` before allocating GPUs. GenEval runs in a separate worker environment selected through `GENEVAL_PYTHON`.

Wan and Causal-rCM use a dedicated Linux x86_64 environment, `ffmpeg`/`ffprobe`, and pinned Wan/VideoReward dependencies. FlashAttention-3 is optional on H100/H200. The supplied image and Wan 1.3B examples use eight GPUs; the Wan 14B example uses 32 across four nodes, with `--nnodes`, `--node-rank`, and `--master-addr` for the distributed launch. No exact VRAM floor is specified. VBench evaluation can run offline after the required assets are in place, while Gemini pairwise judging is an optional external API path. The package is versioned `0.1.0.dev0`; checkpoints are hosted on Hugging Face, and there is no tagged GitHub release.
```

## Key Capabilities
```text
- Rollout ranking: An EMA generator samples N candidates per condition; black-box rewards define top-k positives and bottom-k negatives.
- Score critics: Two LoRA adapters share the generator backbone and learn the positive and online–negative mixture distributions through flow matching.
- Training schedule: A 4:1 critic-to-generator update ratio is paired with EMA tracking and rollout replay; YAML recipes expose ablations for the mixture weight, ranking, and replay.
- Model coverage: SD3.5-M-Turbo, Wan2.1-T2V 1.3B with rCM, AnyFlow, and SMD, Wan2.1-T2V 14B with rCM, and Causal-rCM with one- or three-frame chunks as configured by chunk size.
- Measured trade-off: Wan2.1-T2V 1.3B reaches 84.25 VBench Total at four NFE and 764 training GPU-hours; ReFL uses 329 GPU-hours and reaches 82.82 at 50 NFE.
- Evaluation paths: Offline checkpoint sampling and VBench scoring are documented separately from optional Gemini pairwise evaluation.
```

## Quick Start / Clone
```bash
git clone https://github.com/Tencent-TEXCH/DiffusionPOND.git
cd DiffusionPOND

# Core + diffusers + image rewards + W&B (recommended for SD3.5-M-Turbo POND)
export UV_PROJECT_ENVIRONMENT="$HOME/envs/pond"
uv sync --locked --python 3.10 \
  --extra diffusers --extra image-rewards --extra wandb

# Optional extras:
#   --extra ocr      # PaddleOCR reward support (see docs/sd3-ocr.md)
#   --extra hpsv2    # HPSv2.1 reward (uses vendored wheel in third_party/hpsv2)
#   --extra dev      # pytest & ruff for development
```
