Views
No views yet
Fangyikang Wang1,2, Hubery Yin2, Lei Qian1, Yinan Li1, Shaobin Zhuang3,2, Huminhao Zhu1, Yilin Zhang1, Yanlong Tang4, Chao Zhang1, Hanbin Zhao1, Hui Qian1, Chen Li21Zhejiang University 2WeChat Vision, Tencent Inc 3Shanghai Jiao Tong University 4Tencent Lightspeed Studio



Schematic comparison between our LML method and baselines. While previous works mainly focus on intriguing designs along the annealing path to improve diffusion sampling, they leave operations at specific noise levels to be performed using first-order Langevin. Our approach proposes to leverage the Levenberg-Marquardt approximated Hessian geometry to guide the Langevin update to be more accurate.

The relation between optimization algorithms and MCMC sampling algorithms. We initially wanted to develop a diffusion sampler utilizing Hessian geometry, following the path of Newton-Langevin dynamics. However, this approach proved to be highly computationally expensive within the DM context. Drawing inspiration from the Levenberg-Marquardt method used in optimization, our method incorporates low-rank approximation and damping techniques. This enables us to obtain the Hessian geometry in a computationally affordable manner. Subsequently, we use this approximated Hessian geometry to guide the Langevin updates.
python3 ./scripts/cifar10.py --test_num 1 --batch_size 1 --num_inference_steps 10 --save_dir YOUR/SAVE/DIR --model_id xx/xx/ddpm_ema_cifar10 --sampler_type ddimpython3 ./scripts/cifar10.py --test_num 1 --batch_size 1 --num_inference_steps 10 --save_dir YOUR/SAVE/DIR --model_id xx/xx/ddpm_ema_cifar10 --sampler_type dpm_lm --lamb 0.0008| 5 NFEs | 6 NFEs | 7 NFEs | 8 NFEs | 9 NFEs | 10 NFEs | 12 NFEs | 15 NFEs | 20 NFEs | 30 NFEs | 50 NFEs | 100 NFEs | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| optimal value of lamb | 0.0008 | 0.0008 | 0.001 | 0.001 | 0.001 | 0.0008 | 0.001 | 0.001 | 0.0005 | 0.0003 | 0.0001 | 0.00005 |
python3 ./scripts/celeba.py --test_num 1 --batch_size 1 --num_inference_steps 10 --save_dir YOUR/SAVE/DIR --model_id xx/xx/ldm-celebahq-256 --sampler_type ddimpython3 ./scripts/celeba.py --test_num 1 --batch_size 1 --num_inference_steps 10 --save_dir YOUR/SAVE/DIR --model_id xx/xx/ldm-celebahq-256 --sampler_type ddim_lm --lamb 0.005python3 ./scripts/StableDiffusion_COCO.py --test_num 30002 --num_inference_steps 10 --save_dir YOUR/SAVE/DIR --model_id xx/xx/stable-diffusion-v1-5 --sampler_type dpm_lm --lamb 0.001python3 ./scripts/StableDiffusion_PixArt_T2i_Sampling.py --dataset_category color --dataset_path PATH/TO/T2I-COMPBENCH --test_num 10 --num_inference_steps 10 --model_dir YOUR/MODEL/DIR --save_dir YOUR/SAVE/DIR --model sd15 --sampler_type ddimpython3 ./scripts/StableDiffusion_PixArt_T2i_Sampling.py --dataset_category color --dataset_path PATH/TO/T2I-COMPBENCH --test_num 10 --num_inference_steps 10 --model_dir YOUR/MODEL/DIR --save_dir YOUR/SAVE/DIR --model sd15 --sampler_type dpm_lm --lamb 0.006python3 ./scripts/control_net_canny.py --num_inference_steps 10 --original_image_path /xxx/xxx/data/input_image_vermeer.png --controlnet_dir /xxx/xxx/sd-controlnet-canny --sd_dir /xxx/xxx/stable-diffusion-v1-5 --save_dir YOUR/SAVE/DIR --sampler_type dpm_lm --lamb 0.001python3 ./scripts/control_net_depth.py --num_inference_steps 10 --controlnet_dir /xxx/xxx/control_v11f1p_sd15_depth --sd_dir /xxx/xxx/stable-diffusion-v1-5 --save_dir YOUR/SAVE/DIR --sampler_type dpm_lm --lamb 0.001python3 ./scripts/control_net_canny.py --num_inference_steps 10 --controlnet_dir /xxx/xxx/sd-controlnet-openpose --sd_dir /xxx/xxx/stable-diffusion-v1-5 --save_dir YOUR/SAVE/DIR --sampler_type dpm_lm --lamb 0.001python3 ./scripts/FLUX_T2i_Sampling.py --dataset_category color --dataset_path PATH/TO/T2I-COMPBENCH --test_num 10 --num_inference_steps 10 --model_id YOUR/MODEL/DIR --save_dir YOUR/SAVE/DIR --sampler_type fm_eulerpython3 ./scripts/FLUX_T2i_Sampling.py --dataset_category color --dataset_path PATH/TO/T2I-COMPBENCH --test_num 10 --num_inference_steps 10 --model_id YOUR/MODEL/DIR --save_dir YOUR/SAVE/DIR --sampler_type lml_euler --lamb 0.011# BLIP-VQA for Attribute Binding
2cd T2I-CompBench
3bash BLIPvqa_eval/test.sh
4 ||
5 ||
6 \/
7cp evaluations/T2I-CompBench/BLIPvqa_test.sh T2I-CompBench/BLIPvqa_eval
8cd T2I-CompBench
9bash BLIPvqa_eval/BLIPvqa_test.sh 'save_dir'{save_dir}/model/dataset_category/sampler_type/samples/
├── a green bench and a blue bowl_000000.png
├── a green bench and a blue bowl_000001.png
└──...@article{wang2025unleashing,
title={Unleashing High-Quality Image Generation in Diffusion Sampling Using Second-Order Levenberg-Marquardt-Langevin},
author={Wang, Fangyikang and Yin, Hubery and Qian, Lei and Li, Yinan and Zhuang, Shaobin and Zhu, Huminhao and Zhang, Yilin and Tang, Yanlong and Zhang, Chao and Zhao, Hanbin and others},
journal={arXiv preprint arXiv:2505.24222},
year={2025}
}wangfangyikang@zju.edu.cn, qianlei33@zju.edu.cn, liyinan@zju.edu.cn