Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to properly use #5

Open
Fighterrr007 opened this issue Nov 15, 2023 · 1 comment
Open

How to properly use #5

Fighterrr007 opened this issue Nov 15, 2023 · 1 comment

Comments

@Fighterrr007
Copy link

Dear author, can you update the readme with the code on how to use it specifically? For example, I want to ablate the concept of violence, what should I do?

@nupurkmr9
Copy link
Owner

Hi, you can find the directions to use our code using diffusers here.
The specific commands to use for ablating the concept of violence is also given there and copied here for reference:

accelerate config
export MODEL_NAME="CompVis/stable-diffusion-v1-4"
export OUTPUT_DIR="logs_ablation/violence"

## launch training script (2 GPUs recommended, if 1 GPU increase --max_train_steps to 800 or increase --train_batch_size=8)

accelerate launch train.py \
          --pretrained_model_name_or_path=$MODEL_NAME  \
          --output_dir=$OUTPUT_DIR \
          --class_data_dir=./data/samples_violence/ \
          --class_prompt="people"  \
          --caption_target "violent, horrifying" \
          --concept_type violence \
          --resolution=512  \
          --train_batch_size=4  \
          --learning_rate=2e-7  \
          --max_train_steps=400 \
          --scale_lr --hflip \
          --parameter_group full-weight \
          --enable_xformers_memory_efficient_attention 

Hope this helps. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants