Skip to content

Commit 9611730

Browse files
authored
Honor the SDXL 1.0 licensing from the training scripts. (huggingface#4319)
* honor the original license. * train_instruct_pix2pix_xl -> train_instruct_pix2pix_sdxl
1 parent 7d0d073 commit 9611730

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

examples/controlnet/train_controlnet_sdxl.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_folder=N
210210

211211
yaml = f"""
212212
---
213-
license: creativeml-openrail-m
213+
license: openrail++
214214
base_model: {base_model}
215215
tags:
216216
- stable-diffusion-xl
@@ -227,12 +227,7 @@ def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_folder=N
227227
These are controlnet weights trained on {base_model} with new type of conditioning.
228228
{img_str}
229229
"""
230-
model_card += """
231230

232-
## License
233-
234-
[SDXL 1.0 License](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md)
235-
"""
236231
with open(os.path.join(repo_folder, "README.md"), "w") as f:
237232
f.write(yaml + model_card)
238233

examples/dreambooth/train_dreambooth_lora_sdxl.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def save_model_card(
7373

7474
yaml = f"""
7575
---
76-
license: creativeml-openrail-m
76+
license: openrail++
7777
base_model: {base_model}
7878
instance_prompt: {prompt}
7979
tags:
@@ -94,10 +94,6 @@ def save_model_card(
9494
LoRA for the text encoder was enabled: {train_text_encoder}.
9595
9696
Special VAE used for training: {vae_path}.
97-
98-
## License
99-
100-
[SDXL 1.0 License](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md)
10197
"""
10298
with open(os.path.join(repo_folder, "README.md"), "w") as f:
10399
f.write(yaml + model_card)

examples/instruct_pix2pix/README_sdxl.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
[Stable Diffusion XL](https://huggingface.co/papers/2307.01952) (or SDXL) is the latest image generation model that is tailored towards more photorealistic outputs with more detailed imagery and composition compared to previous SD models. It leverages a three times larger UNet backbone. The increase of model parameters is mainly due to more attention blocks and a larger cross-attention context as SDXL uses a second text encoder.
66

7-
The `train_instruct_pix2pix_xl.py` script shows how to implement the training procedure and adapt it for Stable Diffusion XL.
7+
The `train_instruct_pix2pix_sdxl.py` script shows how to implement the training procedure and adapt it for Stable Diffusion XL.
88

9-
***Disclaimer: Even though `train_instruct_pix2pix_xl.py` implements the InstructPix2Pix
9+
***Disclaimer: Even though `train_instruct_pix2pix_sdxl.py` implements the InstructPix2Pix
1010
training procedure while being faithful to the [original implementation](https://github.com/timothybrooks/instruct-pix2pix) we have only tested it on a [small-scale dataset](https://huggingface.co/datasets/fusing/instructpix2pix-1000-samples). This can impact the end results. For better results, we recommend longer training runs with a larger dataset. [Here](https://huggingface.co/datasets/timbrooks/instructpix2pix-clip-filtered) you can find a large dataset for InstructPix2Pix training.***
1111

1212
## Running locally with PyTorch
@@ -33,7 +33,7 @@ export DATASET_ID="fusing/instructpix2pix-1000-samples"
3333
Now, we can launch training:
3434

3535
```bash
36-
python train_instruct_pix2pix_xl.py \
36+
python train_instruct_pix2pix_sdxl.py \
3737
--pretrained_model_name_or_path=$MODEL_NAME \
3838
--dataset_name=$DATASET_ID \
3939
--enable_xformers_memory_efficient_attention \
@@ -50,7 +50,7 @@ Additionally, we support performing validation inference to monitor training pro
5050
with Weights and Biases. You can enable this feature with `report_to="wandb"`:
5151

5252
```bash
53-
python train_instruct_pix2pix_xl.py \
53+
python train_instruct_pix2pix_sdxl.py \
5454
--pretrained_model_name_or_path=stabilityai/stable-diffusion-xl-base-1.0 \
5555
--dataset_name=$DATASET_ID \
5656
--use_ema \

0 commit comments

Comments
 (0)