ContrastiveCFG: Guiding Diffusion Sampling by Contrasting Positive and Negative Concepts
On the map: Diffusion models → Diffusion foundations and sampling
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Diffusion foundations and sampling, one of 14 directions in Diffusion models. Builds on 34 of its 51 references that are in the map. First posted on arXiv 26 Nov 2024.
Builds on
34 of 51 references.
Closest ancestors · 15
Same direction, newest first
- 2024Dynamic Negative Guidance of Diffusion Models18 Oct
- 2024TFG: Unified Training-Free Guidance for Diffusion Models24 Sep
- 2024CFG++: Manifold-constrained Classifier Free Guidance for Diffusion Models12 Jun
- 2024Self-Rectifying Diffusion Sampling with Perturbed-Attention Guidance26 Mar
- 2024Scaling Rectified Flow Transformers for High-Resolution Image Synthesis5 Mar
- 2023Manifold Preserving Guided Diffusion28 Nov
- 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis4 Jul
- 2023Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC22 Feb
- 2022Scalable Diffusion Models with Transformers19 Dec
- 2022Classifier-Free Diffusion Guidance26 Jul
- 2021High-Resolution Image Synthesis with Latent Diffusion Models20 Dec
- 2021Diffusion Models Beat GANs on Image Synthesis11 May
3 more
Other references · 19
- 2015Deep Residual Learning for Image Recognitioncited by 52,096
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 12,049
- 2024GPT-4o System Cardcited by 4,588
- 2022DreamFusion: Text-to-3D using 2D Diffusioncited by 3,025
- 2022Diffusion Posterior Sampling for General Noisy Inverse Problemscited by 1,416
- 2023ImageReward: Learning and Evaluating Human Preferences for Text-to-Image Generationcited by 1,045
- 2023Human Preference Score v2: A Solid Benchmark for Evaluating Human Preferences of Text-to-Image Synthesiscited by 890
- 2022Compositional Visual Generation with Composable Diffusion Modelscited by 624
- 2023Erasing Concepts from Diffusion Modelscited by 539
- 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Modelscited by 513
- 2023Re-imagine the Negative Prompt Algorithm: Transform 2D Diffusion into 3D, alleviate Janus problem and Beyondcited by 139
7 more
- 2024SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image And Video Generationcited by 133
- 2023Decomposed Diffusion Sampler for Accelerating Large-Scale Inverse Problemscited by 132
- 2024Prometheus-Vision: Vision-Language Model as a Judge for Fine-Grained Evaluationcited by 125
- 2024MJ-Bench: Is Your Multimodal Reward Model Really a Good Judge for Text-to-Image Generation?cited by 66
- 2024Understanding the Impact of Negative Prompts: When and How Do They Take Effect?cited by 51
- 2023Regularization by Texts for Latent Diffusion Inverse Solverscited by 32
- 2024DreamSampler: Unifying Diffusion Sampling and Score Distillation for Image Manipulationcited by 22
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Conditional Diffusion Models with Classifier-Free Gibbs-like Guidance
- 2024Rectified Diffusion Guidance for Conditional Generation
- 2025Learn to Guide Your Diffusion Model
- 2024Classifier-Free Guidance is a Predictor-Corrector
- 2023Adaptive Guidance: Training-free Acceleration of Conditional Diffusion Models
- 2025Classifier-free Guidance with Adaptive Scaling
- 2025Diffusion Sampling Path Tells More: An Efficient Plug-and-Play Strategy for Sample Filtering
- 2025TCFG: Tangential Damping Classifier-free Guidance