Spaces:
Running
Running
prithivMLmods
commited on
Commit
โข
b71d0ac
1
Parent(s):
25eaa46
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
import random
|
3 |
import uuid
|
@@ -10,6 +20,7 @@ import torch
|
|
10 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
11 |
|
12 |
DESCRIPTIONz= """## LoRA SD ๐
|
|
|
13 |
"""
|
14 |
|
15 |
def save_image(img):
|
@@ -136,8 +147,9 @@ def generate(
|
|
136 |
return image_paths, seed
|
137 |
|
138 |
examples = [
|
139 |
-
"
|
140 |
-
"
|
|
|
141 |
]
|
142 |
|
143 |
css = '''
|
@@ -148,6 +160,20 @@ footer {
|
|
148 |
}
|
149 |
'''
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
152 |
gr.Markdown(DESCRIPTIONz)
|
153 |
with gr.Group():
|
@@ -218,7 +244,7 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
218 |
|
219 |
with gr.Row(visible=True):
|
220 |
model_choice = gr.Dropdown(
|
221 |
-
label="LoRA Selection",
|
222 |
choices=list(LORA_OPTIONS.keys()),
|
223 |
value="Realism (face/character)๐ฆ๐ป"
|
224 |
)
|
@@ -261,5 +287,15 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
261 |
api_name="run",
|
262 |
)
|
263 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
if __name__ == "__main__":
|
265 |
demo.queue(max_size=30).launch()
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
#patch 1.0()
|
3 |
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
+
# of this software and associated documentation files (the "Software"), to deal
|
5 |
+
# in the Software without restriction, including without limitation the rights
|
6 |
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7 |
+
# copies of the Software, and to permit persons to whom the Software is
|
8 |
+
# furnished to do so, subject to the following conditions:
|
9 |
+
#
|
10 |
+
# ...
|
11 |
import os
|
12 |
import random
|
13 |
import uuid
|
|
|
20 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
21 |
|
22 |
DESCRIPTIONz= """## LoRA SD ๐
|
23 |
+
|
24 |
"""
|
25 |
|
26 |
def save_image(img):
|
|
|
147 |
return image_paths, seed
|
148 |
|
149 |
examples = [
|
150 |
+
"Realism: Man in the style of dark beige and brown, uhd image, youthful protagonists, nonrepresentational ",
|
151 |
+
"Pixar: A young man with light brown wavy hair and light brown eyes sitting in an armchair and looking directly at the camera, pixar style, disney pixar, office background, ultra detailed, 1 man",
|
152 |
+
"Hoodie: Front view, capture a urban style, Superman Hoodie, technical materials, fabric small point label on text Blue theory, the design is minimal, with a raised collar, fabric is a Light yellow, low angle to capture the Hoodies form and detailing, f/5.6 to focus on the hoodies craftsmanship, solid grey background, studio light setting, with batman logo in the chest region of the t-shirt",
|
153 |
]
|
154 |
|
155 |
css = '''
|
|
|
160 |
}
|
161 |
'''
|
162 |
|
163 |
+
def load_predefined_images():
|
164 |
+
predefined_images = [
|
165 |
+
"assets/1.png",
|
166 |
+
"assets/2.png",
|
167 |
+
"assets/3.png",
|
168 |
+
"assets/4.png",
|
169 |
+
"assets/5.png",
|
170 |
+
"assets/6.png",
|
171 |
+
"assets/7.png",
|
172 |
+
"assets/8.png",
|
173 |
+
"assets/9.png",
|
174 |
+
]
|
175 |
+
return predefined_images
|
176 |
+
|
177 |
with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
178 |
gr.Markdown(DESCRIPTIONz)
|
179 |
with gr.Group():
|
|
|
244 |
|
245 |
with gr.Row(visible=True):
|
246 |
model_choice = gr.Dropdown(
|
247 |
+
label="LoRA Selection โ",
|
248 |
choices=list(LORA_OPTIONS.keys()),
|
249 |
value="Realism (face/character)๐ฆ๐ป"
|
250 |
)
|
|
|
287 |
api_name="run",
|
288 |
)
|
289 |
|
290 |
+
|
291 |
+
with gr.Column(scale=3):
|
292 |
+
gr.Markdown("### Image Gallery")
|
293 |
+
predefined_gallery = gr.Gallery(label="Image Gallery", columns=3, show_label=False, value=load_predefined_images())
|
294 |
+
|
295 |
+
gr.Markdown("๐Models used in the playground [[Lightning]](https://huggingface.co/SG161222/RealVisXL_V4.0_Lightning) & LoRA from [[LoRA]](https://huggingface.co/collections/prithivMLmods/dev-models-667803a6d5ac75b59110e527) for image generation. The specific LoRA in the space that requires appropriate trigger words brings good results. The model is still in the training phase. This is not the final version and may contain artifacts and perform poorly in some cases.")
|
296 |
+
gr.Markdown("๐This is the demo space for generating images using Stable Diffusion with quality styles, different LoRA models and types. Try the sample prompts to generate higher quality images. Try the sample prompts for generating higher quality images.<a href='https://huggingface.co/spaces/prithivMLmods/Top-Prompt-Collection' target='_blank'>Try prompts</a>.")
|
297 |
+
gr.Markdown("๐Make sure that the prompts passed meet the trigger word conditions and are well-detailed. This space is for educational purposes only; using it productively is meant for your own knowledge.")
|
298 |
+
gr.Markdown("โ ๏ธ users are accountable for the content they generate and are responsible for ensuring it meets appropriate ethical standards.")
|
299 |
+
|
300 |
if __name__ == "__main__":
|
301 |
demo.queue(max_size=30).launch()
|