ContrastiveCFG: Guiding Diffusion Sampling by Contrasting Positive and Negative Concepts
Jinho Chang, Changsun Lee, Hyungjin Chung, Jong Chul YE
Abstract
As Classifier-Free Guidance (CFG) has proven effective in conditional diffusion model sampling for improved condition alignment, many applications use a negated CFG term as a Negative Prompting (NP) to filter out unwanted features from samples. However, simply negating CFG guidance creates an inverted probability distribution, often distorting samples away from the marginal distribution. Inspired by recent advances in conditional diffusion models for inverse problems, here we present a novel method to achieve guidance toward the given condition using contrastive loss. Specifically, our guidance term aligns or repels the denoising direction based on the given condition through contrastive loss, achieving a similar guiding effect to traditional CFG for positive conditions while overcoming the limitations of existing negative guidance methods. Experimental results demonstrate that our approach effectively injects or removes the given concepts while maintaining sample quality across diverse scenarios, from simple class conditions to complex and overlapping text prompts.
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 78749191-00bd-4d77-bb77-7f5ccba9f1d9Builds on22
- 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
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 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
Related papers
- Guiding Diffusion Models With Adaptive Negative Sampling Without External ResourcesAlakh Desai, Nuno VasconcelosICCV 2025 · 1 citation
- Guiding Diffusion Models with Semantically Degraded ConditionsShilong Han, Yuming Zhang, Hongxia WangCVPR 2026 · 1 citation
- Stage-wise Dynamics of Classifier-Free Guidance in Diffusion ModelsCheng Jin, Qitan Shi, Yuantao GuICLR 2026 · 13 citations
- Learn to Guide Your Diffusion ModelAlexandre Galashov, Ashwini Pokle, Arnaud Doucet, Arthur Gretton et al.ICLR 2026 · 12 citations
- Rectified Diffusion Guidance for Conditional GenerationMengfei Xia, Nan Xue, Yujun Shen, Ran Yi et al.CVPR 2025
