ariG23498 HF staff commited on
Commit
7b22b9e
1 Parent(s): e0afa42

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +41 -28
README.md CHANGED
@@ -25,7 +25,7 @@ tags:
25
  should probably proofread and complete it, then remove this comment. -->
26
 
27
 
28
- # SDXL LoRA DreamBooth - ariG23498/open-image-preferences-v1-sdxl-lora
29
 
30
  <Gallery />
31
 
@@ -40,36 +40,49 @@ should probably proofread and complete it, then remove this comment. -->
40
 
41
  These are ariG23498/open-image-preferences-v1-sdxl-lora LoRA adaption weights for stabilityai/stable-diffusion-xl-base-1.0.
42
 
43
- The weights were trained using [DreamBooth](https://dreambooth.github.io/).
 
44
 
45
- LoRA for the text encoder was enabled: False.
46
 
47
- Special VAE used for training: None.
48
 
49
- ## Trigger words
 
 
50
 
51
- You should use None to trigger the image generation.
52
-
53
- ## Download model
54
-
55
- Weights for this model are available in Safetensors format.
56
-
57
- [Download](ariG23498/open-image-preferences-v1-sdxl-lora/tree/main) them in the Files & versions tab.
58
-
59
-
60
-
61
- ## Intended uses & limitations
62
-
63
- #### How to use
64
-
65
- ```python
66
- # TODO: add an example code snippet for running this diffusion pipeline
67
  ```
68
 
69
- #### Limitations and bias
70
-
71
- [TODO: provide examples of latent issues and potential remediations]
72
-
73
- ## Training details
74
-
75
- [TODO: describe the data used to train the model]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  should probably proofread and complete it, then remove this comment. -->
26
 
27
 
28
+ # Low Rank Adapted Supervised Fine Tuned Stable Diffusion XL
29
 
30
  <Gallery />
31
 
 
40
 
41
  These are ariG23498/open-image-preferences-v1-sdxl-lora LoRA adaption weights for stabilityai/stable-diffusion-xl-base-1.0.
42
 
43
+ The weights were trained using [DreamBooth](https://github.com/ariG23498/diffusers/blob/aritra/sdxl-lora/examples/dreambooth/train_dreambooth_lora_sdxl.py) using the
44
+ [open-image-preferences-v1-binarized](https://huggingface.co/datasets/data-is-better-together/open-image-preferences-v1-binarized) dataset.
45
 
 
46
 
47
+ ## Use with `diffusers`
48
 
49
+ ```py
50
+ from diffusers import AutoPipelineForText2Image
51
+ import torch
52
 
53
+ pipeline = AutoPipelineForText2Image.from_pretrained(
54
+ "stabilityai/stable-diffusion-xl-base-1.0",
55
+ torch_dtype=torch.bfloat16
56
+ ).to('cuda')
57
+ pipeline.load_lora_weights('ariG23498/open-image-preferences-v1-sdxl-lora', weight_name='pytorch_lora_weights.safetensors')
58
+ prompt = "ENTER PROMPT"
59
+ image = pipeline(prompt).images[0]
 
 
 
 
 
 
 
 
 
60
  ```
61
 
62
+ ## Command to train the model
63
+
64
+ ```shell
65
+ !accelerate launch examples/dreambooth/train_dreambooth_lora_sdxl.py \
66
+ --pretrained_model_name_or_path "stabilityai/stable-diffusion-xl-base-1.0" \
67
+ --dataset_name "data-is-better-together/open-image-preferences-v1-binarized" \
68
+ --hub_model_id "ariG23498/open-image-preferences-v1-sdxl-lora" \
69
+ --push_to_hub \
70
+ --output_dir "open-image-preferences-v1-sdxl-lora" \
71
+ --image_column "chosen" \
72
+ --caption_column "prompt" \
73
+ --mixed_precision="bf16" \
74
+ --resolution=1024 \
75
+ --train_batch_size=1 \
76
+ --repeats=1 \
77
+ --report_to="wandb"\
78
+ --gradient_accumulation_steps=1 \
79
+ --gradient_checkpointing \
80
+ --learning_rate=1.0 \
81
+ --text_encoder_lr=1.0 \
82
+ --optimizer="prodigy"\
83
+ --lr_scheduler="constant" \
84
+ --lr_warmup_steps=0 \
85
+ --rank=8 \
86
+ --checkpointing_steps=2000 \
87
+ --seed="0"
88
+ ```