Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export MODEL_NAME="stable-diffusion-v1-5/stable-diffusion-v1-5"
|
| 2 |
+
export dataset_name="lambdalabs/naruto-blip-captions"
|
| 3 |
+
|
| 4 |
+
accelerate launch --mixed_precision="fp16" train_text_to_image.py \
|
| 5 |
+
--pretrained_model_name_or_path=$MODEL_NAME \
|
| 6 |
+
--dataset_name=$dataset_name \
|
| 7 |
+
--use_ema \
|
| 8 |
+
--resolution=512 --center_crop --random_flip \
|
| 9 |
+
--train_batch_size=1 \
|
| 10 |
+
--gradient_accumulation_steps=4 \
|
| 11 |
+
--gradient_checkpointing \
|
| 12 |
+
--max_train_steps=15000 \
|
| 13 |
+
--learning_rate=1e-05 \
|
| 14 |
+
--max_grad_norm=1 \
|
| 15 |
+
--enable_xformers_memory_efficient_attention \
|
| 16 |
+
--lr_scheduler="constant" --lr_warmup_steps=0 \
|
| 17 |
+
--output_dir="sd-naruto-model" \
|
| 18 |
+
--push_to_hub
|