nielsr HF Staff commited on
Commit
6ce9ac5
·
verified ·
1 Parent(s): 1da7573

Improve model card: Add pipeline tag, library_name, description, usage example, and citation

Browse files

This PR significantly enhances the model card by:
- Adding `pipeline_tag: text-to-image` for improved discoverability on the Hugging Face Hub.
- Specifying `library_name: diffusers` to enable the automated "Use in Diffusers" widget, based on the model's `stable-diffusion-v1-4` base.
- Including a detailed "Model Description" section, summarizing the paper's approach.
- Providing a "Sample Usage" section with command-line examples for image sampling, directly extracted from the GitHub repository to guide users.
- Adding a "Citation" section with the BibTeX entry for proper academic attribution.

The existing arXiv paper link in the content has been retained as per the guidelines.

Please review and merge if these improvements are satisfactory.

Files changed (1) hide show
  1. README.md +41 -4
README.md CHANGED
@@ -1,16 +1,53 @@
1
  ---
2
- license: apache-2.0
3
  base_model:
4
  - CompVis/stable-diffusion-v1-4
 
 
 
5
  ---
6
 
7
  # SPEED
8
- Here are the released model checkpoints of our paper:
 
9
 
10
- > [SPEED: Scalable, Precise, and Efficient Concept Erasure for Diffusion Models](https://arxiv.org/abs/2503.07392)
11
 
12
  ![teaser](assets/teaser.JPEG)
13
 
14
  **Three characteristics of our proposed method, SPEED.** **(a) Scalable:** SPEED seamlessly scales from single-concept to large-scale multi-concept erasure (e.g., 100 celebrities) without additional design. **(b) Precise:** SPEED precisely removes the target concept (e.g., *Snoopy*) while preserving the semantic integrity for non-target concepts (e.g., *Hello Kitty* and *SpongeBob*). **(c) Efficient:** SPEED can immediately erase 100 concepts within 5 seconds, achieving a ×350 speedup over the state-of-the-art (SOTA) method.
15
 
16
- More implementation details can be found in our [GitHub repository](https://github.com/Ouxiang-Li/SPEED).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  base_model:
3
  - CompVis/stable-diffusion-v1-4
4
+ license: apache-2.0
5
+ pipeline_tag: text-to-image
6
+ library_name: diffusers
7
  ---
8
 
9
  # SPEED
10
+ ## Model Description
11
+ This model (SPEED) introduces an efficient concept erasure approach that directly edits model parameters of large-scale text-to-image (T2I) diffusion models, such as `CompVis/stable-diffusion-v1-4`. SPEED searches for a null space, a model editing space where parameter updates do not affect non-target concepts, to achieve scalable and precise erasure, successfully erasing 100 concepts within only 5 seconds.
12
 
13
+ It is based on the paper [SPEED: Scalable, Precise, and Efficient Concept Erasure for Diffusion Models](https://arxiv.org/abs/2503.07392).
14
 
15
  ![teaser](assets/teaser.JPEG)
16
 
17
  **Three characteristics of our proposed method, SPEED.** **(a) Scalable:** SPEED seamlessly scales from single-concept to large-scale multi-concept erasure (e.g., 100 celebrities) without additional design. **(b) Precise:** SPEED precisely removes the target concept (e.g., *Snoopy*) while preserving the semantic integrity for non-target concepts (e.g., *Hello Kitty* and *SpongeBob*). **(c) Efficient:** SPEED can immediately erase 100 concepts within 5 seconds, achieving a ×350 speedup over the state-of-the-art (SOTA) method.
18
 
19
+ More implementation details can be found in our [GitHub repository](https://github.com/Ouxiang-Li/SPEED).
20
+
21
+ ## Sample Usage
22
+ Here's how to use the model for image sampling after concept erasure:
23
+
24
+ ```python
25
+ # Image Sampling
26
+ CUDA_VISIBLE_DEVICES=0 python sample.py \
27
+ --erase_type 'instance' \
28
+ --target_concept 'Snoopy, Mickey, Spongebob' \
29
+ --contents 'Snoopy, Mickey, Spongebob, Pikachu, Hello Kitty' \
30
+ --mode 'original, edit' \
31
+ --edit_ckpt '{checkpoint_path}' \
32
+ --num_samples 10 --batch_size 10 \
33
+ --save_root 'logs/few-concept/instance'
34
+ ```
35
+
36
+ In the command above, you can configure the `--mode` to determine the sampling mode:
37
+
38
+ - `original`: Generate images using the original Stable Diffusion model.
39
+ - `edit`: Generate images with the erased checkpoint.
40
+
41
+ ## Citation
42
+ If you find the repo useful, please consider citing.
43
+ ```bibtex
44
+ @misc{li2025speedscalablepreciseefficient,
45
+ title={SPEED: Scalable, Precise, and Efficient Concept Erasure for Diffusion Models},
46
+ author={Ouxiang Li and Yuan Wang and Xinting Hu and Houcheng Jiang and Tao Liang and Yanbin Hao and Guojun Ma and Fuli Feng},
47
+ year={2025},
48
+ eprint={2503.07392},
49
+ archivePrefix={arXiv},
50
+ primaryClass={cs.CV},
51
+ url={https://arxiv.org/abs/2503.07392},
52
+ }
53
+ ```