Skip to content

Harvard-AI-and-Robotics-Lab/Velocity-Adaptive-Guidance-Scale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VAGS: Velocity-Adaptive Guidance Scale

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:

$\lambda_i = \lambda \cdot \exp\left(\kappa \cdot (2\sigma_i - 1) \cdot s_i\right)$

where $s_i$ is the velocity-alignment signal, $σ_i ∈ [0, 1]$ is the signal level (1 = clean), and $κ ≥ 0$ controls modulation strength. Setting $κ = 0$ recovers vanilla CFG.


Repository Layout

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.


Quick Start

Generation

cd VAGS_Generation
conda env create -f environment.yml && conda activate vags_gen
CUDA_VISIBLE_DEVICES=0 bash inference_sd35_vagsgen_coco17.sh

Editing

cd 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 0

See the per-subproject READMEs for full setup, dataset preparation, evaluation, and reproduction details.


Citation

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}
}

About

[arXiv 2026] VAGS: Velocity Adaptive Guidance Scale for Image Editing and Generation

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages