Fast constrained sampling in pre-trained diffusion models
Alexandros Graikos, Nebojsa Jojic, Dimitris Samaras
Abstract
Large denoising diffusion models, such as Stable Diffusion, have been trained on billions of image-caption pairs to perform text-conditioned image generation. As a byproduct of this training, these models have acquired general knowledge about image statistics, which can be useful for other inference tasks. However, when confronted with sampling an image under new constraints, e.g. generating the missing parts of an image, using large pre-trained text-to-image diffusion models is inefficient and often unreliable. Previous approaches either utilized backpropagation through the denoiser network, making them significantly slower and more memory-demanding than simple text-to-image generation, or only enforced the constraint locally, failing to capture critical long-range correlations in the sampled image. In this work, we propose an algorithm that enables fast, high-quality generation under arbitrary constraints. We show that in denoising diffusion models, we can employ an approximation to Newton's optimization method that allows us to speed up inference and avoid the expensive backpropagation operations. Our approach produces results that rival or surpass the state-of-the-art training-free inference methods while requiring a fraction of the time. We demonstrate the effectiveness of our algorithm under both linear (inpainting, super-resolution) and non-linear (style-guided generation) constraints. An implementation is provided at https://github.com/cvlab-stonybrook/fast-constrained-sampling.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext bef24f5f-1083-421f-b1a3-0517c6c04cdcCited by top-tier papers4
- Constrained Flow Optimization via Sequential Fine-Tuning for Molecular DesignSven Gutjahr, Riccardo De Santi, Luca Schaufelberger, Kjell Jorner et al.ICML 2026 · 3 citations
- Gauge Flow Matching: Efficient Constrained Generative Modeling over General Convex Set and BeyondXinpeng Li, Enming Liang, Minghua ChenICLR 2026
- ZoomLDM: Latent Diffusion Model for Multi-scale Image GenerationSrikar Yellapragada, Alexandros Graikos, Kostas Triaridis, Prateek Prasanna et al.CVPR 2025
- Geometry-Correct Diffusion Posterior Sampling with Denoiser-Pullback Curvature Guidance and Manifold-Aligned DampingSeunghyeok Shin, Minwoo Kim, Dabin Kim, Hongki LimICML 2026
Builds on26
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 citations
- Diffusion Models Beat GANs on Image SynthesisPrafulla Dhariwal, Alexander Quinn NicholNeurIPS 2021 · 13,211 citations
- High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
- Denoising Diffusion Implicit ModelsJiaming Song, Chenlin Meng, Stefano ErmonICLR 2021 · 11,743 citations
Related papers
- On Distillation of Guided Diffusion ModelsChenlin Meng, Robin Rombach, Ruiqi Gao, Diederik P. Kingma et al.CVPR 2023
- Accelerating Diffusion Sampling via Exploiting Local Transition CoherenceShangwen Zhu, Han Zhang, Zhantao Yang, Qianyu Peng et al.ICCV 2025
- Data-free Distillation of Diffusion Models with BootstrappingJiatao Gu, Chen Wang, Shuangfei Zhai, Yizhe Zhang et al.ICML 2024 · 5 citations
- Penalizing Boundary Activation for Object Completeness in Diffusion ModelsHaoyang Xu, Tianhao Zhao, Sibei Yang, Yutian LinICCV 2025
- DPM-Solver-v3: Improved Diffusion ODE Solver with Empirical Model StatisticsKaiwen Zheng, Cheng Lu, Jianfei Chen, Jun ZhuNeurIPS 2023 · 204 citations
