Skip to content

Commit c8d4dec

Browse files
committed
Streamlines commands in README a bit.
1 parent 90c7b7d commit c8d4dec

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

examples/controlnet/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,12 @@ We encourage you to store or share your model with the community. To use hugging
339339
huggingface-cli login
340340
```
341341
342-
Make sure you have the `MODEL_DIR`,`OUTPUT_DIR` and `HUB_MODEL_ID` environment variables set. The `OUTPUT_DIR` and `HUB_MODEL_ID` variables specify where to save the model to on the Hub. The `TRACKER_PROJECT_NAME` variable sets the project name in `wandb`.
342+
Make sure you have the `MODEL_DIR`,`OUTPUT_DIR` and `HUB_MODEL_ID` environment variables set. The `OUTPUT_DIR` and `HUB_MODEL_ID` variables specify where to save the model to on the Hub:
343343
344344
```bash
345345
export MODEL_DIR="runwayml/stable-diffusion-v1-5"
346346
export OUTPUT_DIR="runs/fill-circle-{timestamp}"
347347
export HUB_MODEL_ID="controlnet-fill-circle"
348-
export TRACKER_PROJECT_NAME='controlnet_fill50k'
349348
```
350349

351350
And finally start the training
@@ -355,7 +354,6 @@ python3 train_controlnet_flax.py \
355354
--pretrained_model_name_or_path=$MODEL_DIR \
356355
--output_dir=$OUTPUT_DIR \
357356
--dataset_name=fusing/fill50k \
358-
--tracker_project_name="$TRACKER_PROJECT_NAME" \
359357
--resolution=512 \
360358
--learning_rate=1e-5 \
361359
--validation_image "./conditioning_image_1.png" "./conditioning_image_2.png" \
@@ -365,16 +363,21 @@ python3 train_controlnet_flax.py \
365363
--revision="non-ema" \
366364
--from_pt \
367365
--report_to="wandb" \
366+
--tracker_project_name=$HUB_MODEL_ID \
368367
--num_train_epochs=11 \
369368
--push_to_hub \
370369
--hub_model_id=$HUB_MODEL_ID
371370
```
372371

373372
Since we passed the `--push_to_hub` flag, it will automatically create a model repo under your huggingface account based on `$HUB_MODEL_ID`. By the end of training, the final checkpoint will be automatically stored on the hub. You can find an example model repo [here](https://huggingface.co/YiYiXu/fill-circle-controlnet).
374373

375-
Our training script also provides limited support for streaming large datasets from the Hugging Face Hub. In order to enable streaming, one must also set `--max_train_samples`. Here is an example command:
374+
Our training script also provides limited support for streaming large datasets from the Hugging Face Hub. In order to enable streaming, one must also set `--max_train_samples`. Here is an example command (from [this Blog article](https://huggingface.co/blog/train-your-controlnet)):
376375

377376
```bash
377+
export MODEL_DIR="runwayml/stable-diffusion-v1-5"
378+
export OUTPUT_DIR="runs/uncanny-faces-{timestamp}"
379+
export HUB_MODEL_ID="controlnet-uncanny-faces"
380+
378381
python3 train_controlnet_flax.py \
379382
--pretrained_model_name_or_path=$MODEL_DIR \
380383
--output_dir=$OUTPUT_DIR \
@@ -384,13 +387,12 @@ python3 train_controlnet_flax.py \
384387
--image_column=image \
385388
--caption_column=image_caption \
386389
--resolution=512 \
387-
--max_train_samples 50 \
388-
--max_train_steps 5 \
390+
--max_train_samples 100000 \
389391
--learning_rate=1e-5 \
390-
--validation_steps=2 \
391392
--train_batch_size=1 \
392393
--revision="flax" \
393-
--report_to="wandb"
394+
--report_to="wandb" \
395+
--tracker_project_name=$HUB_MODEL_ID
394396
```
395397

396398
Note, however, that the performance of the TPUs might get bottlenecked as streaming with `datasets` is not optimized for images. For ensuring maximum throughput, we encourage you to explore the following options:

0 commit comments

Comments
 (0)