This is the official code for the paper "One Image is Worth a Thousand Words: A Usability-Preservable Text-Image Collaborative Erasing Framework" accepted by International Conference on Machine Learning (ICML2025).
Paper Title: One Image is Worth a Thousand Words: A Usability-Preservable Text-Image Collaborative Erasing Framework
Authors: Feiran Li, Qianqian Xu*, Shilong Bao, Zhiyong Yang, Xiaochun Cao, Qingming Huang*
- Some codes and checkpoints are under examination, and we will update as soon as possible.
- We update some checkpoints here. The models are based on ESD.
Clone this repository:
git clone git@github.com:Ferry-Li/Co-Erasing.gitInstall the required libraries:
pip install -r requirements.txtBefore training, there are a few steps.
-
Step1: Generate reference images
python generate_data.py --label nudity
-
Step2: Acquire a pretrained text-based erased model (such as ESD), or simply run
python main.py \ --modality text \ --train_method noxattn \ --prompt nudity \ --devices 0,1 \ --ckpt_path PATH_TO_SD
-
Step3: Conduct Co-erasing:
python main.py \ --modality image \ --train_method full \ --text_uncond \ --prompt "nudity" \ --devices 2,3 \ --unet_ckpt_path PATH_TO_TEXT_ERASED_SD \ --image PATH_TO_IMAGE_DIR \ --image_number 200 \ --text_guide "nudity" \ --blur_factor 5 \ --iterations 1500 \ --negative_guidance 1.0 \ --output_dir outputs \ --logging_dir log \ --save_iter 500
The evaluation follows UnlearnDiff.
If you find this work or repository useful, please cite the following:
@inproceedings{li2024coerasing,
title={One Image is Worth a Thousand Words: A Usability-Preservable Text-Image Collaborative Erasing Framework},
author={Feiran Li and Qianqian Xu and Shilong Bao and Zhiyong Yang and Xiaochun Cao and Qingming Huang},
booktitle={The Forty-first International Conference on Machine Learning},
year={2025}
}If you have any detailed questions or suggestions, feel free to email us: lifeiran@iie.ac.cn! Thanks for your interest in our work!
