This repository contains the experiment code for TFTF: Training-Free Targeted Flow for Conditional Sampling, accepted to ICML 2026.
tftf/
experiments/
mnist.py # MNIST class-conditional sampling
cifar10.py # CIFAR-10 class-conditional sampling
celeba_hq.py # CelebA-HQ text-guided sampling
models/
mnist/ # MNIST flow checkpoint is included
cifar10/ # Download CIFAR-10 checkpoints here
celeba_hq/ # Download CelebA-HQ and CLIP checkpoints here
prompts/
celeba_hq_prompts.json
scripts/
run_*.sh, run_*.ps1
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtOn Windows PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtCUDA is recommended for all experiments. CPU execution is possible in principle, but the CIFAR-10 and CelebA-HQ experiments are very slow without a GPU.
The MNIST unconditional flow checkpoint is included at:
models/mnist/final_model.pt
Other pretrained models and likelihood models must be downloaded separately. See models/README.md for links and exact target paths.
--stochastic_scale cmeans the SDE stochasticity schedule isalpha(t) = c / t.--guidance_scalecorresponds to the paper guidance scalebeta(t).
| Dataset | Samples | Steps | Stochasticity | Guidance | Resampling interval |
|---|---|---|---|---|---|
| MNIST | 16 | 800 | alpha(t)=4/t |
beta(t)=1 |
[3/16, 1/2] |
| CIFAR-10 | 16 | 800 | alpha(t)=4/t |
beta(t)=1 |
[7/16, 14/16] |
| CelebA-HQ | 25 | 400 | alpha(t)=2/t |
beta(t)=1 |
[3/40, 2/5] |
MNIST:
python -m tftf.experiments.mnistCIFAR-10:
python -m tftf.experiments.cifar10CelebA-HQ:
python -m tftf.experiments.celeba_hq --attribute FemaleOutputs are written under outputs/ by default. The shell scripts in scripts/ run the same module entry points and pass through any additional arguments.
Prompt configurations are stored in prompts/celeba_hq_prompts.json. Select a prompt by its attribute field:
python -m tftf.experiments.celeba_hq --attribute "Female + Smiling"@inproceedings{qu2026tftf,
title = {TFTF: Training-Free Targeted Flow for Conditional Sampling},
author = {Qu, Qianqian and Liu, Jun S.},
booktitle = {Proceedings of the 43rd International Conference on Machine Learning},
year = {2026}
}