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

Research folder #1553

Merged
merged 4 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 deletions examples/dreambooth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,30 +312,6 @@ python train_dreambooth_flax.py \
--max_train_steps=800
```

## Dreambooth for the inpainting model


```bash
export MODEL_NAME="runwayml/stable-diffusion-inpainting"
export INSTANCE_DIR="path-to-instance-images"
export OUTPUT_DIR="path-to-save-model"

accelerate launch train_dreambooth_inpaint.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--instance_data_dir=$INSTANCE_DIR \
--output_dir=$OUTPUT_DIR \
--instance_prompt="a photo of sks dog" \
--resolution=512 \
--train_batch_size=1 \
--gradient_accumulation_steps=1 \
--learning_rate=5e-6 \
--lr_scheduler="constant" \
--lr_warmup_steps=0 \
--max_train_steps=400
```

The script is also compatible with prior preservation loss and gradient checkpointing

### Training with prior-preservation loss

Prior-preservation is used to avoid overfitting and language-drift. Refer to the paper to learn more about it. For prior-preservation we first generate images using the model with a class prompt and then use those during training along with our data.
Expand Down Expand Up @@ -428,4 +404,4 @@ accelerate launch train_dreambooth_inpaint.py \
--lr_warmup_steps=0 \
--num_class_images=200 \
--max_train_steps=800
```
```
13 changes: 13 additions & 0 deletions examples/research_projects/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Research projects
patrickvonplaten marked this conversation as resolved.
Show resolved Hide resolved
This folder contains various research projects using 🧨 Diffusers.
They are not really maintained by the core maintainers of this library and often require a specific version of Diffusers that is indicated in the requirements file of each folder.
Updating them to the most recent version of the library will require some work.

To use any of them, just run the command

```
pip install -r requirements.txt
```
inside the folder of your choice.

If you need help with any of those, please open an issue where you directly ping the author(s), as indicated at the top of the README of each folder.
26 changes: 26 additions & 0 deletions examples/research_projects/dreambooth_inpaint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dreambooth for the inpainting model

This script was added by @thedarkzeno .

Please note that this script is not actively maintained, you can open an issue and tag @thedarkzeno or @patil-suraj though.

```bash
export MODEL_NAME="runwayml/stable-diffusion-inpainting"
export INSTANCE_DIR="path-to-instance-images"
export OUTPUT_DIR="path-to-save-model"

accelerate launch train_dreambooth_inpaint.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--instance_data_dir=$INSTANCE_DIR \
--output_dir=$OUTPUT_DIR \
--instance_prompt="a photo of sks dog" \
--resolution=512 \
--train_batch_size=1 \
--gradient_accumulation_steps=1 \
--learning_rate=5e-6 \
--lr_scheduler="constant" \
--lr_warmup_steps=0 \
--max_train_steps=400
```

The script is also compatible with prior preservation loss and gradient checkpointing
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
diffusers==0.9.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thedarkzeno I think this needs to be 0.10.2 as 0.9.0 doesn't have check_min_version

accelerate
torchvision
transformers>=4.21.0
ftfy
tensorboard
modelcards