Update README.md
Browse files
README.md
CHANGED
@@ -133,9 +133,78 @@ The Segmind Stable Diffusion Model is suitable for research and practical applic
|
|
133 |
|
134 |
The Segmind Stable Diffusion Model can also be used directly with the 🧨 Diffusers library training scripts for further training, including:
|
135 |
|
136 |
-
- **[Fine-Tune](https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_sdxl.py)
|
137 |
-
|
138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
### Out-of-Scope Use
|
141 |
|
|
|
133 |
|
134 |
The Segmind Stable Diffusion Model can also be used directly with the 🧨 Diffusers library training scripts for further training, including:
|
135 |
|
136 |
+
- **[Fine-Tune](https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_sdxl.py):**
|
137 |
+
```bash
|
138 |
+
export MODEL_NAME="segmind/SSD-1B"
|
139 |
+
export VAE_NAME="madebyollin/sdxl-vae-fp16-fix"
|
140 |
+
export DATASET_NAME="lambdalabs/pokemon-blip-captions"
|
141 |
+
|
142 |
+
accelerate launch train_text_to_image_lora_sdxl.py \
|
143 |
+
--pretrained_model_name_or_path=$MODEL_NAME \
|
144 |
+
--pretrained_vae_model_name_or_path=$VAE_NAME \
|
145 |
+
--dataset_name=$DATASET_NAME --caption_column="text" \
|
146 |
+
--resolution=1024 --random_flip \
|
147 |
+
--train_batch_size=1 \
|
148 |
+
--num_train_epochs=2 --checkpointing_steps=500 \
|
149 |
+
--learning_rate=1e-04 --lr_scheduler="constant" --lr_warmup_steps=0 \
|
150 |
+
--mixed_precision="fp16" \
|
151 |
+
--seed=42 \
|
152 |
+
--output_dir="sd-pokemon-model-lora-sdxl" \
|
153 |
+
--validation_prompt="cute dragon creature" --report_to="wandb" \
|
154 |
+
--push_to_hub
|
155 |
+
```
|
156 |
+
- **[LoRA](https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_lora_sdxl.py):**
|
157 |
+
```bash
|
158 |
+
export MODEL_NAME="segmind/SSD-1B"
|
159 |
+
export VAE_NAME="madebyollin/sdxl-vae-fp16-fix"
|
160 |
+
export DATASET_NAME="lambdalabs/pokemon-blip-captions"
|
161 |
+
|
162 |
+
accelerate launch train_text_to_image_sdxl.py \
|
163 |
+
--pretrained_model_name_or_path=$MODEL_NAME \
|
164 |
+
--pretrained_vae_model_name_or_path=$VAE_NAME \
|
165 |
+
--dataset_name=$DATASET_NAME \
|
166 |
+
--enable_xformers_memory_efficient_attention \
|
167 |
+
--resolution=512 --center_crop --random_flip \
|
168 |
+
--proportion_empty_prompts=0.2 \
|
169 |
+
--train_batch_size=1 \
|
170 |
+
--gradient_accumulation_steps=4 --gradient_checkpointing \
|
171 |
+
--max_train_steps=10000 \
|
172 |
+
--use_8bit_adam \
|
173 |
+
--learning_rate=1e-06 --lr_scheduler="constant" --lr_warmup_steps=0 \
|
174 |
+
--mixed_precision="fp16" \
|
175 |
+
--report_to="wandb" \
|
176 |
+
--validation_prompt="a cute Sundar Pichai creature" --validation_epochs 5 \
|
177 |
+
--checkpointing_steps=5000 \
|
178 |
+
--output_dir="sdxl-pokemon-model" \
|
179 |
+
--push_to_hub
|
180 |
+
```
|
181 |
+
- **[Dreambooth LoRA](https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/train_dreambooth_lora_sdxl.py):**
|
182 |
+
```bash
|
183 |
+
export MODEL_NAME="segmind/SSD-1B"
|
184 |
+
export INSTANCE_DIR="dog"
|
185 |
+
export OUTPUT_DIR="lora-trained-xl"
|
186 |
+
export VAE_PATH="madebyollin/sdxl-vae-fp16-fix"
|
187 |
+
|
188 |
+
accelerate launch train_dreambooth_lora_sdxl.py \
|
189 |
+
--pretrained_model_name_or_path=$MODEL_NAME \
|
190 |
+
--instance_data_dir=$INSTANCE_DIR \
|
191 |
+
--pretrained_vae_model_name_or_path=$VAE_PATH \
|
192 |
+
--output_dir=$OUTPUT_DIR \
|
193 |
+
--mixed_precision="fp16" \
|
194 |
+
--instance_prompt="a photo of sks dog" \
|
195 |
+
--resolution=1024 \
|
196 |
+
--train_batch_size=1 \
|
197 |
+
--gradient_accumulation_steps=4 \
|
198 |
+
--learning_rate=1e-5 \
|
199 |
+
--report_to="wandb" \
|
200 |
+
--lr_scheduler="constant" \
|
201 |
+
--lr_warmup_steps=0 \
|
202 |
+
--max_train_steps=500 \
|
203 |
+
--validation_prompt="A photo of sks dog in a bucket" \
|
204 |
+
--validation_epochs=25 \
|
205 |
+
--seed="0" \
|
206 |
+
--push_to_hub
|
207 |
+
```
|
208 |
|
209 |
### Out-of-Scope Use
|
210 |
|