Skip to content

SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image and Video Generation (arXiv: 2410.12761)

Notifications You must be signed in to change notification settings

jaehong31/SAFREE

Repository files navigation

SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image and Video Generation

Project Website arXiv

University of North Carolina at Chapel Hill

teaser image

Setup

Install Dependencies

  1. (Optional) Creating conda environment
conda create -n SAFREE python=3.10.13
conda activate SAFREE
  1. build from source
pip install -r requirements.txt

Safe generation using SD-v1.4 by removing nudity concepts

bash scripts/run_nudity.sh

Safe generation using SD-XL by removing nudity concepts

bash scripts/run_nudity_sdxl.sh

COCO image generation using SD-v1.4 while removing nudity concepts

bash scripts/run_coco.sh

COCO image generation using SD-XL while removing nudity concepts

bash scripts/run_coco_sdxl.sh

Artist style image generation using SD-v1.4 while removing "Van Gogh" and "Kelly McKernan"

bash scripts/run_artist.sh

Acknowledgments

The code is built upon Prompting4Debugging, Diffusers, CogVideoX, and ZeroScopeT2V.

Reference

Please cite our paper if you use our models in your works:

@article{yoon2024safree,
  title={SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image And Video Generation},
  author={Yoon, Jaehong and Yu, Shoubin and Patil, Vaidehi and Yao, Huaxiu and Bansal, Mohit},
  journal={arXiv preprint arXiv:2410.12761},
  year={2024}
}

About

SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image and Video Generation (arXiv: 2410.12761)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published