mlsanityData to 14 Oct 2026

Towards SFW sampling for diffusion models via external conditioning

arXiv 2505.08817 ↗First posted 12 May 2025cs.CV cs.LGcited by 0

On the map: Diffusion models → Robustness, privacy and adversarial aspects

Abstract (arXiv)

Score-based generative models (SBM), also known as diffusion models, are the de facto state of the art for image synthesis. Despite their unparalleled performance, SBMs have recently been in the spotlight for being tricked into creating not-safe-for-work (NSFW) content, such as violent images and non-consensual nudity. Current approaches that prevent unsafe generation are based on the models' own knowledge, and the majority of them require fine-tuning. This article explores the use of external sources for ensuring safe outputs in SBMs. Our safe-for-work (SFW) sampler implements a Conditional Trajectory Correction step that guides the samples away from undesired regions in the ambient space using multimodal models as the source of conditioning. Furthermore, using Contrastive Language Image Pre-training (CLIP), our method admits user-defined NSFW classes, which can vary in different settings. Our experiments on the text-to-image SBM Stable Diffusion validate that the proposed SFW sampler effectively reduces the generation of explicit content while being competitive with other fine-tuning-based approaches, as assessed via independent NSFW detectors. Moreover, we evaluate the impact of the SFW sampler on image quality and show that the proposed correction scheme comes at a minor cost with negligible effect on samples not needing correction. Our study confirms the suitability of the SFW sampler towards aligned SBM models and the potential of using model-agnostic conditioning for the prevention of unwanted images.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Robustness, privacy and adversarial aspects, one of 14 directions in Diffusion models. Builds on 34 of its 36 references that are in the map. First posted on arXiv 12 May 2025.

Builds on

34 of 36 references.

Closest ancestors · 15

Same direction, newest first

  1. 2024SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image And Video Generation16 Oct
  2. 2024ShieldDiff: Suppressing Sexual Content Generation from Diffusion Models through Reinforcement Learning4 Oct
  3. 2024SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models10 Apr
  4. 2024MACE: Mass Concept Erasure in Diffusion Models10 Mar
  5. 2023One-Dimensional Adapter to Rule Them All: Concepts, Diffusion Models and Erasing Applications26 Dec
  6. 2023All but One: Surgical Concept Erasing with Model Preservation in Text-to-Image Diffusion Models20 Dec
  7. 2023To Generate or Not? Safety-Driven Unlearned Diffusion Models Are Still Easy To Generate Unsafe Images ... For Now18 Oct
  8. 2023Unified Concept Editing in Diffusion Models25 Aug
  9. 2023Censored Sampling of Diffusion Models Using 3 Minutes of Human Feedback6 Jul
  10. 2023Unsafe Diffusion: On the Generation of Unsafe Images and Hateful Memes From Text-To-Image Models23 May
  11. 2023Forget-Me-Not: Learning to Forget in Text-to-Image Diffusion Models30 Mar
  12. 2023Ablating Concepts in Text-to-Image Diffusion Models23 Mar
3 more
  1. 2023Erasing Concepts from Diffusion Models13 Mar
  2. 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Models9 Nov
  3. 2022Red-Teaming the Stable Diffusion Safety Filter3 Oct

Other references · 19

  1. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
  2. 2020Denoising Diffusion Probabilistic Modelscited by 21,076
  3. 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,863
  4. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  5. 2020Denoising Diffusion Implicit Modelscited by 9,781
  6. 2020Score-Based Generative Modeling through Stochastic Differential Equationscited by 9,122
  7. 2021Diffusion Models Beat GANs on Image Synthesiscited by 8,255
  8. 2015Deep Unsupervised Learning using Nonequilibrium Thermodynamicscited by 7,058
  9. 2022Hierarchical Text-Conditional Image Generation with CLIP Latentscited by 6,585
  10. 2022Classifier-Free Diffusion Guidancecited by 5,847
  11. 2019Generative Modeling by Estimating Gradients of the Data Distributioncited by 4,101
  12. 2018Datasheets for Datasetscited by 1,386
7 more
  1. 2022Diffusion Models: A Comprehensive Survey of Methods and Applicationscited by 1,114
  2. 2023Universal Guidance for Diffusion Modelscited by 437
  3. 2023Selective Amnesia: A Continual Learning Approach to Forgetting in Deep Generative Modelscited by 177
  4. 2023Manifold Preserving Guided Diffusioncited by 157
  5. 2022Can Machines Help Us Answering Question 16 in Datasheets, and In Turn Reflecting on Inappropriate Content?cited by 155
  6. 2023Circumventing Concept Erasure Methods For Text-to-Image Generative Modelscited by 85
  7. 2023Self-Discovering Interpretable Diffusion Latent Directions for Responsible Text-to-Image Generationcited by 69

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Disciplined Diffusion: Text-to-Image Diffusion Model against NSFW Generation
  2. 2026Test-Time Scaling for Safe Text-Guided Image Generation via Intermediate Clean Estimates
  3. 2024When Image Generation Goes Wrong: A Safety Analysis of Stable Diffusion Models
  4. 2025Seeing It Before It Happens: In-Generation NSFW Detection for Diffusion-Based Text-to-Image Models
  5. 2025Training-Free Safe Denoisers for Safe Use of Diffusion Models
  6. 2025Detect-and-Guide: Self-regulation of Diffusion Models for Safe Text-to-Image Generation via Guideline Token Optimization
  7. 2025Beautiful Images, Toxic Words: Understanding and Addressing Offensive Text in Generated Images
  8. 2025Training-Free Safe Text Embedding Guidance for Text-to-Image Diffusion Models