Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 2.1 KB

README.md

File metadata and controls

69 lines (49 loc) · 2.1 KB

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}
}