Upload folder using huggingface_hub
Browse files- .gitattributes +3 -0
- README.md +138 -0
- pytorch_lora_weights.safetensors +3 -0
- yarn_lora.png +3 -0
- yarn_lora_You_are_an_assistant_designed_to_generate_superior_images_with_a_bright_and_shiny_overall_.png +3 -0
- yarn_lora_You_are_an_assistant_designed_to_generate_superior_images_with_a_dark_overall_theme.png +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
yarn_lora.png filter=lfs diff=lfs merge=lfs -text
|
37 |
+
yarn_lora_You_are_an_assistant_designed_to_generate_superior_images_with_a_bright_and_shiny_overall_.png filter=lfs diff=lfs merge=lfs -text
|
38 |
+
yarn_lora_You_are_an_assistant_designed_to_generate_superior_images_with_a_dark_overall_theme.png filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: Alpha-VLLM/Lumina-Image-2.0
|
3 |
+
library_name: diffusers
|
4 |
+
license: apache-2.0
|
5 |
+
instance_prompt: a puppy, yarn art style
|
6 |
+
widget:
|
7 |
+
- text: a puppy in a pond, yarn art style
|
8 |
+
output:
|
9 |
+
url: yarn_lora.png
|
10 |
+
- text: a puppy in a pond, yarn art style (dark env)
|
11 |
+
output:
|
12 |
+
url: yarn_lora_You_are_an_assistant_designed_to_generate_superior_images_with_a_dark_overall_theme.png
|
13 |
+
- text: a puppy in a pond, yarn art style (shiny env)
|
14 |
+
output:
|
15 |
+
url: yarn_lora_You_are_an_assistant_designed_to_generate_superior_images_with_a_bright_and_shiny_overall_.png
|
16 |
+
tags:
|
17 |
+
- text-to-image
|
18 |
+
- diffusers-training
|
19 |
+
- diffusers
|
20 |
+
- lora
|
21 |
+
- lumina2
|
22 |
+
- lumina2-diffusers
|
23 |
+
- template:sd-lora
|
24 |
+
---
|
25 |
+
|
26 |
+
# Lumina2 DreamBooth LoRA - trained-lumina2-lora-yarn
|
27 |
+
|
28 |
+
<Gallery />
|
29 |
+
|
30 |
+
## Model description
|
31 |
+
|
32 |
+
These are `trained-lumina2-lora-yarn` DreamBooth LoRA weights for [Alpha-VLLM/Lumina-Image-2.0](https://hf.co/Alpha-VLLM/Lumina-Image-2.0).
|
33 |
+
|
34 |
+
The weights were trained using [DreamBooth](https://dreambooth.github.io/) with the [Lumina2 diffusers trainer](https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/README_lumina2.md).
|
35 |
+
|
36 |
+
|
37 |
+
## Trigger words
|
38 |
+
|
39 |
+
You should use `yarn art style` to trigger the image generation.
|
40 |
+
|
41 |
+
The following `system_prompt` was also used used during training (ignore if `None`): None.
|
42 |
+
|
43 |
+
## Download model
|
44 |
+
|
45 |
+
[Download the *.safetensors LoRA]({repo_id}/tree/main) in the Files & versions tab.
|
46 |
+
|
47 |
+
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
48 |
+
|
49 |
+
```py
|
50 |
+
import torch
|
51 |
+
from diffusers import Lumina2Text2ImgPipeline
|
52 |
+
|
53 |
+
pipe = Lumina2Text2ImgPipeline.from_pretrained(
|
54 |
+
"Alpha-VLLM/Lumina-Image-2.0", torch_dtype=torch.bfloat16
|
55 |
+
).to("cuda")
|
56 |
+
|
57 |
+
pipe.load_lora_weights("trained-lumina2-lora-yarn")
|
58 |
+
prompt = "a puppy in a pond, yarn art style"
|
59 |
+
|
60 |
+
image = pipe(
|
61 |
+
prompt,
|
62 |
+
negative_prompt="bad quality, worse quality, degenerate quality",
|
63 |
+
guidance_scale=6,
|
64 |
+
num_inference_steps=35,
|
65 |
+
generator=torch.manual_seed(0)
|
66 |
+
).images[0]
|
67 |
+
```
|
68 |
+
|
69 |
+
For more details, including weighting, merging and fusing LoRAs, check the [documentation on loading LoRAs in diffusers](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading_adapters).
|
70 |
+
|
71 |
+
## Results
|
72 |
+
|
73 |
+
The model benefits from `system_prompt`. Here is a comparison across different system prompts:
|
74 |
+
|
75 |
+
<table>
|
76 |
+
<thead>
|
77 |
+
<tr>
|
78 |
+
<th>No system prompt</th>
|
79 |
+
<th>"Dark surrounding"<br>system prompt</th>
|
80 |
+
<th>"Sunny surrounding"<br>system prompt</th>
|
81 |
+
</tr>
|
82 |
+
</thead>
|
83 |
+
<tbody>
|
84 |
+
<tr>
|
85 |
+
<td><img src="yarn_lora.png" alt="No system prompt image" width="200"></td>
|
86 |
+
<td><img src="yarn_lora_You_are_an_assistant_designed_to_generate_superior_images_with_a_dark_overall_theme.png" alt="Dark surrounding image" width="200"></td>
|
87 |
+
<td><img src="yarn_lora_You_are_an_assistant_designed_to_generate_superior_images_with_a_bright_and_shiny_overall_.png" alt="Sunny surrounding image" width="200"></td>
|
88 |
+
</tr>
|
89 |
+
<tr>
|
90 |
+
<td colspan="3">
|
91 |
+
<div style="text-align: center; font-weight: bold;">
|
92 |
+
<b>Original prompt</b>: <i>a puppy in a pond, yarn art style</i>
|
93 |
+
</div>
|
94 |
+
</td>
|
95 |
+
</tr>
|
96 |
+
</tbody>
|
97 |
+
</table>
|
98 |
+
|
99 |
+
<details>
|
100 |
+
<summary>Code</summary>
|
101 |
+
|
102 |
+
```py
|
103 |
+
import torch
|
104 |
+
from diffusers import Lumina2Text2ImgPipeline
|
105 |
+
|
106 |
+
pipe = Lumina2Text2ImgPipeline.from_pretrained(
|
107 |
+
"Alpha-VLLM/Lumina-Image-2.0", torch_dtype=torch.bfloat16
|
108 |
+
).to("cuda")
|
109 |
+
|
110 |
+
|
111 |
+
system_prompts = [
|
112 |
+
None,
|
113 |
+
"You are an assistant designed to generate superior images with a dark overall theme.",
|
114 |
+
"You are an assistant designed to generate superior images with a bright and shiny overall theme."
|
115 |
+
]
|
116 |
+
|
117 |
+
pipe.load_lora_weights("trained-lumina2-lora-yarn")
|
118 |
+
prompt = "a puppy in a pond, yarn art style"
|
119 |
+
|
120 |
+
for sp in system_prompts:
|
121 |
+
filename = "yarn_lora"
|
122 |
+
image = pipe(
|
123 |
+
prompt,
|
124 |
+
negative_prompt="bad quality, worse quality, degenerate quality",
|
125 |
+
system_prompt=sp,
|
126 |
+
guidance_scale=6,
|
127 |
+
num_inference_steps=35,
|
128 |
+
generator=torch.manual_seed(0)
|
129 |
+
).images[0]
|
130 |
+
if sp:
|
131 |
+
filename += "_" + "_".join(sp.split(" ")).replace(",", "").replace(".", "")
|
132 |
+
filename = filename[:100]
|
133 |
+
|
134 |
+
image.save(f"{filename}.png")
|
135 |
+
|
136 |
+
```
|
137 |
+
|
138 |
+
</details>
|
pytorch_lora_weights.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6c5b169eff6b63c734be7963eae331224a4620477f39cf5b1de6a3f1600f0243
|
3 |
+
size 3714224
|
yarn_lora.png
ADDED
![]() |
Git LFS Details
|
yarn_lora_You_are_an_assistant_designed_to_generate_superior_images_with_a_bright_and_shiny_overall_.png
ADDED
![]() |
Git LFS Details
|
yarn_lora_You_are_an_assistant_designed_to_generate_superior_images_with_a_dark_overall_theme.png
ADDED
![]() |
Git LFS Details
|