Official implementation of Velocity-Adaptive Guidance Scale (VAGS), a training-free, plug-and-play modulation of classifier-free guidance for flow-based diffusion models.
VAGS replaces the constant CFG scale with a per-step adaptive scale that depends on the diffusion timestep and the cosine similarity between two velocity fields:
where
| Directory | Task | Backbone |
|---|---|---|
VAGS_Generation/ |
Text-to-image generation (COCO17, CUB-200, Flickr30K) | SD 3.5 |
VAGS_Editing/ |
Image editing (PIE-Bench, DIV2K) | SD 3.5 + FlowEdit |
Each subdirectory is self-contained with its own environment, scripts, and README.
cd VAGS_Generation
conda env create -f environment.yml && conda activate vags_gen
CUDA_VISIBLE_DEVICES=0 bash inference_sd35_vagsgen_coco17.shcd VAGS_Editing
conda create -n vags python=3.10 -y && conda activate vags
pip install torch torchvision diffusers transformers accelerate
python run_vags.py --dataset yaml --yaml_file data/edits.yaml --images_root . --outdir outputs/demo --gpu 0See the per-subproject READMEs for full setup, dataset preparation, evaluation, and reproduction details.
If you find this work useful, please cite:
@article{luo2026vags,
title={VAGS: Velocity Adaptive Guidance Scale for Image Editing and Generation},
author={Luo, Yan and Aidara, Ahmadou and Lu, Jingyi and Moebel, Jeremy and Han, Kai and Wang, Mengyu},
journal={arXiv preprint arXiv:2605.15661},
year={2026}
}