1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

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

* honor the original license.

* train_instruct_pix2pix_xl -> train_instruct_pix2pix_sdxl
This commit is contained in:
Sayak Paul
2023-07-28 01:28:36 +05:30
committed by GitHub
parent 7d0d073261
commit 961173064d
4 changed files with 6 additions and 15 deletions

View File

@@ -210,7 +210,7 @@ def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_folder=N
yaml = f"""
---
license: creativeml-openrail-m
license: openrail++
base_model: {base_model}
tags:
- stable-diffusion-xl
@@ -227,12 +227,7 @@ inference: true
These are controlnet weights trained on {base_model} with new type of conditioning.
{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:
f.write(yaml + model_card)

View File

@@ -73,7 +73,7 @@ def save_model_card(
yaml = f"""
---
license: creativeml-openrail-m
license: openrail++
base_model: {base_model}
instance_prompt: {prompt}
tags:
@@ -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}.
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:
f.write(yaml + model_card)

View File

@@ -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.
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.***
## Running locally with PyTorch
@@ -33,7 +33,7 @@ export DATASET_ID="fusing/instructpix2pix-1000-samples"
Now, we can launch training:
```bash
python train_instruct_pix2pix_xl.py \
python train_instruct_pix2pix_sdxl.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--dataset_name=$DATASET_ID \
--enable_xformers_memory_efficient_attention \
@@ -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"`:
```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 \
--dataset_name=$DATASET_ID \
--use_ema \