Unverified Commit 96117306 authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

Honor the SDXL 1.0 licensing from the training scripts. (#4319)

* honor the original license.

* train_instruct_pix2pix_xl -> train_instruct_pix2pix_sdxl
parent 7d0d0732
...@@ -210,7 +210,7 @@ def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_folder=N ...@@ -210,7 +210,7 @@ def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_folder=N
yaml = f""" yaml = f"""
--- ---
license: creativeml-openrail-m license: openrail++
base_model: {base_model} base_model: {base_model}
tags: tags:
- stable-diffusion-xl - stable-diffusion-xl
...@@ -227,12 +227,7 @@ inference: true ...@@ -227,12 +227,7 @@ inference: true
These are controlnet weights trained on {base_model} with new type of conditioning. These are controlnet weights trained on {base_model} with new type of conditioning.
{img_str} {img_str}
""" """
model_card += """
## License
[SDXL 1.0 License](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md)
"""
with open(os.path.join(repo_folder, "README.md"), "w") as f: with open(os.path.join(repo_folder, "README.md"), "w") as f:
f.write(yaml + model_card) f.write(yaml + model_card)
......
...@@ -73,7 +73,7 @@ def save_model_card( ...@@ -73,7 +73,7 @@ def save_model_card(
yaml = f""" yaml = f"""
--- ---
license: creativeml-openrail-m license: openrail++
base_model: {base_model} base_model: {base_model}
instance_prompt: {prompt} instance_prompt: {prompt}
tags: tags:
...@@ -94,10 +94,6 @@ These are LoRA adaption weights for {base_model}. The weights were trained on {p ...@@ -94,10 +94,6 @@ These are LoRA adaption weights for {base_model}. The weights were trained on {p
LoRA for the text encoder was enabled: {train_text_encoder}. LoRA for the text encoder was enabled: {train_text_encoder}.
Special VAE used for training: {vae_path}. Special VAE used for training: {vae_path}.
## License
[SDXL 1.0 License](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md)
""" """
with open(os.path.join(repo_folder, "README.md"), "w") as f: with open(os.path.join(repo_folder, "README.md"), "w") as f:
f.write(yaml + model_card) f.write(yaml + model_card)
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
[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. [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.
The `train_instruct_pix2pix_xl.py` script shows how to implement the training procedure and adapt it for Stable Diffusion XL. The `train_instruct_pix2pix_sdxl.py` script shows how to implement the training procedure and adapt it for Stable Diffusion XL.
***Disclaimer: Even though `train_instruct_pix2pix_xl.py` implements the InstructPix2Pix ***Disclaimer: Even though `train_instruct_pix2pix_sdxl.py` implements the InstructPix2Pix
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.*** 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.***
## Running locally with PyTorch ## Running locally with PyTorch
...@@ -33,7 +33,7 @@ export DATASET_ID="fusing/instructpix2pix-1000-samples" ...@@ -33,7 +33,7 @@ export DATASET_ID="fusing/instructpix2pix-1000-samples"
Now, we can launch training: Now, we can launch training:
```bash ```bash
python train_instruct_pix2pix_xl.py \ python train_instruct_pix2pix_sdxl.py \
--pretrained_model_name_or_path=$MODEL_NAME \ --pretrained_model_name_or_path=$MODEL_NAME \
--dataset_name=$DATASET_ID \ --dataset_name=$DATASET_ID \
--enable_xformers_memory_efficient_attention \ --enable_xformers_memory_efficient_attention \
...@@ -50,7 +50,7 @@ Additionally, we support performing validation inference to monitor training pro ...@@ -50,7 +50,7 @@ Additionally, we support performing validation inference to monitor training pro
with Weights and Biases. You can enable this feature with `report_to="wandb"`: with Weights and Biases. You can enable this feature with `report_to="wandb"`:
```bash ```bash
python train_instruct_pix2pix_xl.py \ python train_instruct_pix2pix_sdxl.py \
--pretrained_model_name_or_path=stabilityai/stable-diffusion-xl-base-1.0 \ --pretrained_model_name_or_path=stabilityai/stable-diffusion-xl-base-1.0 \
--dataset_name=$DATASET_ID \ --dataset_name=$DATASET_ID \
--use_ema \ --use_ema \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment