Skip to content

Commit 25f850a

Browse files
[docs] [dreambooth training] num_class_images clarification (#1508)
1 parent b25ae2e commit 25f850a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/dreambooth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ accelerate launch train_dreambooth.py \
7070
### Training with prior-preservation loss
7171

7272
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.
73-
According to the paper, it's recommended to generate `num_epochs * num_samples` images for prior-preservation. 200-300 works well for most cases.
73+
According to the paper, it's recommended to generate `num_epochs * num_samples` images for prior-preservation. 200-300 works well for most cases. The `num_class_images` flag sets the number of images to generate with the class prompt. You can place existing images in `class_data_dir`, and the training script will generate any additional images so that `num_class_images` are present in `class_data_dir` during training time.
7474

7575
```bash
7676
export MODEL_NAME="CompVis/stable-diffusion-v1-4"

examples/dreambooth/train_dreambooth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def parse_args(input_args=None):
107107
type=int,
108108
default=100,
109109
help=(
110-
"Minimal class images for prior preservation loss. If not have enough images, additional images will be"
111-
" sampled with class_prompt."
110+
"Minimal class images for prior preservation loss. If there are not enough images already present in"
111+
" class_data_dir, additional images will be sampled with class_prompt."
112112
),
113113
)
114114
parser.add_argument(

examples/dreambooth/train_dreambooth_flax.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def parse_args():
8989
type=int,
9090
default=100,
9191
help=(
92-
"Minimal class images for prior preservation loss. If not have enough images, additional images will be"
93-
" sampled with class_prompt."
92+
"Minimal class images for prior preservation loss. If there are not enough images already present in"
93+
" class_data_dir, additional images will be sampled with class_prompt."
9494
),
9595
)
9696
parser.add_argument(

0 commit comments

Comments
 (0)