[docs] [dreambooth training] num_class_images clarification (#1508)

This commit is contained in:
Will Berman
2022-12-02 03:12:28 -08:00
committed by GitHub
parent b25ae2e6ab
commit 25f850a23b
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ accelerate launch train_dreambooth.py \
### Training with prior-preservation loss ### 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. 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.
According to the paper, it's recommended to generate `num_epochs * num_samples` images for prior-preservation. 200-300 works well for most cases. 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.
```bash ```bash
export MODEL_NAME="CompVis/stable-diffusion-v1-4" export MODEL_NAME="CompVis/stable-diffusion-v1-4"
+2 -2
View File
@@ -107,8 +107,8 @@ def parse_args(input_args=None):
type=int, type=int,
default=100, default=100,
help=( help=(
"Minimal class images for prior preservation loss. If not have enough images, additional images will be" "Minimal class images for prior preservation loss. If there are not enough images already present in"
" sampled with class_prompt." " class_data_dir, additional images will be sampled with class_prompt."
), ),
) )
parser.add_argument( parser.add_argument(
+2 -2
View File
@@ -89,8 +89,8 @@ def parse_args():
type=int, type=int,
default=100, default=100,
help=( help=(
"Minimal class images for prior preservation loss. If not have enough images, additional images will be" "Minimal class images for prior preservation loss. If there are not enough images already present in"
" sampled with class_prompt." " class_data_dir, additional images will be sampled with class_prompt."
), ),
) )
parser.add_argument( parser.add_argument(