Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -11,229 +11,6 @@ import spaces
|
|
11 |
import torch
|
12 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler, DiffusionPipeline
|
13 |
|
14 |
-
#Quality/Style-----------------------------------------------------------------------------------------------------------------------------------------------------------Quality/Style
|
15 |
-
|
16 |
-
style_list = [
|
17 |
-
{
|
18 |
-
"name": "3840 x 2160",
|
19 |
-
"prompt": "hyper-realistic 8K image of {prompt}. ultra-detailed, lifelike, high-resolution, sharp, vibrant colors, photorealistic",
|
20 |
-
"negative_prompt": "cartoonish, low resolution, blurry, simplistic, abstract, deformed, ugly",
|
21 |
-
},
|
22 |
-
{
|
23 |
-
"name": "2560 x 1440",
|
24 |
-
"prompt": "hyper-realistic 4K image of {prompt}. ultra-detailed, lifelike, high-resolution, sharp, vibrant colors, photorealistic",
|
25 |
-
"negative_prompt": "cartoonish, low resolution, blurry, simplistic, abstract, deformed, ugly",
|
26 |
-
},
|
27 |
-
|
28 |
-
{
|
29 |
-
"name": "HD+",
|
30 |
-
"prompt": "hyper-realistic 2K image of {prompt}. ultra-detailed, lifelike, high-resolution, sharp, vibrant colors, photorealistic",
|
31 |
-
"negative_prompt": "cartoonish, low resolution, blurry, simplistic, abstract, deformed, ugly",
|
32 |
-
},
|
33 |
-
|
34 |
-
{
|
35 |
-
"name": "Style Zero",
|
36 |
-
"prompt": "{prompt}",
|
37 |
-
"negative_prompt": "",
|
38 |
-
},
|
39 |
-
|
40 |
-
]
|
41 |
-
|
42 |
-
#Clgstyle--------------------------------------------------------------------------------------------------------------------------------------------------------------Clgstyle
|
43 |
-
|
44 |
-
collage_style_list = [
|
45 |
-
{
|
46 |
-
"name": "Hi-Res",
|
47 |
-
"prompt": "hyper-realistic 8K image of {prompt}. ultra-detailed, lifelike, high-resolution, sharp, vibrant colors, photorealistic",
|
48 |
-
"negative_prompt": "cartoonish, low resolution, blurry, simplistic, abstract, deformed, ugly",
|
49 |
-
},
|
50 |
-
{
|
51 |
-
"name": "B & W",
|
52 |
-
"prompt": "black and white collage of {prompt}. monochromatic, timeless, classic, dramatic contrast",
|
53 |
-
"negative_prompt": "colorful, vibrant, bright, flashy",
|
54 |
-
},
|
55 |
-
{
|
56 |
-
"name": "Polaroid",
|
57 |
-
"prompt": "collage of polaroid photos featuring {prompt}. vintage style, high contrast, nostalgic, instant film aesthetic",
|
58 |
-
"negative_prompt": "digital, modern, low quality, blurry",
|
59 |
-
},
|
60 |
-
{
|
61 |
-
"name": "Watercolor",
|
62 |
-
"prompt": "watercolor collage of {prompt}. soft edges, translucent colors, painterly effects",
|
63 |
-
"negative_prompt": "digital, sharp lines, solid colors",
|
64 |
-
},
|
65 |
-
{
|
66 |
-
"name": "Cinematic",
|
67 |
-
"prompt": "cinematic collage of {prompt}. film stills, movie posters, dramatic lighting",
|
68 |
-
"negative_prompt": "static, lifeless, mundane",
|
69 |
-
},
|
70 |
-
{
|
71 |
-
"name": "Nostalgic",
|
72 |
-
"prompt": "nostalgic collage of {prompt}. retro imagery, vintage objects, sentimental journey",
|
73 |
-
"negative_prompt": "contemporary, futuristic, forward-looking",
|
74 |
-
},
|
75 |
-
{
|
76 |
-
"name": "Vintage",
|
77 |
-
"prompt": "vintage collage of {prompt}. aged paper, sepia tones, retro imagery, antique vibes",
|
78 |
-
"negative_prompt": "modern, contemporary, futuristic, high-tech",
|
79 |
-
},
|
80 |
-
{
|
81 |
-
"name": "Scrapbook",
|
82 |
-
"prompt": "scrapbook style collage of {prompt}. mixed media, hand-cut elements, textures, paper, stickers, doodles",
|
83 |
-
"negative_prompt": "clean, digital, modern, low quality",
|
84 |
-
},
|
85 |
-
{
|
86 |
-
"name": "NeoNGlow",
|
87 |
-
"prompt": "neon glow collage of {prompt}. vibrant colors, glowing effects, futuristic vibes",
|
88 |
-
"negative_prompt": "dull, muted colors, vintage, retro",
|
89 |
-
},
|
90 |
-
{
|
91 |
-
"name": "Geometric",
|
92 |
-
"prompt": "geometric collage of {prompt}. abstract shapes, colorful, sharp edges, modern design, high quality",
|
93 |
-
"negative_prompt": "blurry, low quality, traditional, dull",
|
94 |
-
},
|
95 |
-
{
|
96 |
-
"name": "Thematic",
|
97 |
-
"prompt": "thematic collage of {prompt}. cohesive theme, well-organized, matching colors, creative layout",
|
98 |
-
"negative_prompt": "random, messy, unorganized, clashing colors",
|
99 |
-
},
|
100 |
-
|
101 |
-
#DuoTones by Canva --------------------------------------------------------------------------------------------------------------- Alters only the i++ Part / not Zero Tones
|
102 |
-
|
103 |
-
{
|
104 |
-
"name": "Cherry",
|
105 |
-
"prompt": "Duotone style Cherry tone applied to {prompt}",
|
106 |
-
"negative_prompt": "",
|
107 |
-
},
|
108 |
-
{
|
109 |
-
"name": "Fuchsia",
|
110 |
-
"prompt": "Duotone style Fuchsia tone applied to {prompt}",
|
111 |
-
"negative_prompt": "",
|
112 |
-
},
|
113 |
-
{
|
114 |
-
"name": "Pop",
|
115 |
-
"prompt": "Duotone style Pop tone applied to {prompt}",
|
116 |
-
"negative_prompt": "",
|
117 |
-
},
|
118 |
-
{
|
119 |
-
"name": "Violet",
|
120 |
-
"prompt": "Duotone style Violet applied to {prompt}",
|
121 |
-
"negative_prompt": "",
|
122 |
-
},
|
123 |
-
{
|
124 |
-
"name": "Sea Blue",
|
125 |
-
"prompt": "Duotone style Sea Blue applied to {prompt}",
|
126 |
-
"negative_prompt": "",
|
127 |
-
},
|
128 |
-
{
|
129 |
-
"name": "Sea Green",
|
130 |
-
"prompt": "Duotone style Sea Green applied to {prompt}",
|
131 |
-
"negative_prompt": "",
|
132 |
-
},
|
133 |
-
{
|
134 |
-
"name": "Mustard",
|
135 |
-
"prompt": "Duotone style Mustard applied to {prompt}",
|
136 |
-
"negative_prompt": "",
|
137 |
-
},
|
138 |
-
{
|
139 |
-
"name": "Amber",
|
140 |
-
"prompt": "Duotone style Amber applied to {prompt}",
|
141 |
-
"negative_prompt": "",
|
142 |
-
},
|
143 |
-
{
|
144 |
-
"name": "Pomelo",
|
145 |
-
"prompt": "Duotone style Pomelo applied to {prompt}",
|
146 |
-
"negative_prompt": "",
|
147 |
-
},
|
148 |
-
{
|
149 |
-
"name": "Peppermint",
|
150 |
-
"prompt": "Duotone style Peppermint applied to {prompt}",
|
151 |
-
"negative_prompt": "",
|
152 |
-
},
|
153 |
-
{
|
154 |
-
"name": "Mystic",
|
155 |
-
"prompt": "Duotone style Mystic tone applied to {prompt}",
|
156 |
-
"negative_prompt": "",
|
157 |
-
},
|
158 |
-
{
|
159 |
-
"name": "Pastel",
|
160 |
-
"prompt": "Duotone style Pastel applied to {prompt}",
|
161 |
-
"negative_prompt": "",
|
162 |
-
},
|
163 |
-
{
|
164 |
-
"name": "Coral",
|
165 |
-
"prompt": "Duotone style Coral applied to {prompt}",
|
166 |
-
"negative_prompt": "",
|
167 |
-
},
|
168 |
-
{
|
169 |
-
"name": "No Style",
|
170 |
-
"prompt": "{prompt}",
|
171 |
-
"negative_prompt": "",
|
172 |
-
},
|
173 |
-
|
174 |
-
]
|
175 |
-
|
176 |
-
#filters------------------------------------------------------------------------------------------------------------------------------------------------filters
|
177 |
-
|
178 |
-
filters = {
|
179 |
-
"Vivid": {
|
180 |
-
"prompt": "extra vivid {prompt}",
|
181 |
-
"negative_prompt": "washed out, dull"
|
182 |
-
},
|
183 |
-
"Playa": {
|
184 |
-
"prompt": "{prompt} set in a vast playa",
|
185 |
-
"negative_prompt": "forest, mountains"
|
186 |
-
},
|
187 |
-
"Desert": {
|
188 |
-
"prompt": "{prompt} set in a desert landscape",
|
189 |
-
"negative_prompt": "ocean, city"
|
190 |
-
},
|
191 |
-
"West": {
|
192 |
-
"prompt": "{prompt} with a western theme",
|
193 |
-
"negative_prompt": "eastern, modern"
|
194 |
-
},
|
195 |
-
"Blush": {
|
196 |
-
"prompt": "{prompt} with a soft blush color palette",
|
197 |
-
"negative_prompt": "harsh colors, neon"
|
198 |
-
},
|
199 |
-
"Minimalist": {
|
200 |
-
"prompt": "{prompt} with a minimalist design",
|
201 |
-
"negative_prompt": "cluttered, ornate"
|
202 |
-
},
|
203 |
-
|
204 |
-
"Zero filter": {
|
205 |
-
"prompt": "{prompt}",
|
206 |
-
"negative_prompt": ""
|
207 |
-
},
|
208 |
-
|
209 |
-
|
210 |
-
}
|
211 |
-
|
212 |
-
styles = {k["name"]: (k["prompt"], k["negative_prompt"]) for k in style_list}
|
213 |
-
collage_styles = {k["name"]: (k["prompt"], k["negative_prompt"]) for k in collage_style_list}
|
214 |
-
filter_styles = {k: (v["prompt"], v["negative_prompt"]) for k, v in filters.items()}
|
215 |
-
|
216 |
-
STYLE_NAMES = list(styles.keys())
|
217 |
-
COLLAGE_STYLE_NAMES = list(collage_styles.keys())
|
218 |
-
FILTER_NAMES = list(filters.keys())
|
219 |
-
DEFAULT_STYLE_NAME = "3840 x 2160"
|
220 |
-
DEFAULT_COLLAGE_STYLE_NAME = "Hi-Res"
|
221 |
-
DEFAULT_FILTER_NAME = "Zero filter"
|
222 |
-
|
223 |
-
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
224 |
-
if style_name in styles:
|
225 |
-
p, n = styles.get(style_name, styles[DEFAULT_STYLE_NAME])
|
226 |
-
elif style_name in collage_styles:
|
227 |
-
p, n = collage_styles.get(style_name, collage_styles[DEFAULT_COLLAGE_STYLE_NAME])
|
228 |
-
elif style_name in filter_styles:
|
229 |
-
p, n = filter_styles.get(style_name, filter_styles[DEFAULT_FILTER_NAME])
|
230 |
-
else:
|
231 |
-
p, n = styles[DEFAULT_STYLE_NAME]
|
232 |
-
|
233 |
-
if not negative:
|
234 |
-
negative = ""
|
235 |
-
return p.replace("{prompt}", positive), n + negative
|
236 |
-
|
237 |
DESCRIPTION = """
|
238 |
# Midjourney Free on <a href='https://gpt-chatbot.ru/' target='_blank'>GPT-ChatBot.ru</a>
|
239 |
"""
|
@@ -310,12 +87,10 @@ def generate(
|
|
310 |
return image_paths, seed
|
311 |
|
312 |
examples = [
|
313 |
-
"
|
314 |
-
"
|
315 |
-
"
|
316 |
-
"
|
317 |
-
"a cute robot artist painting on an easel, concept art",
|
318 |
-
"a close up of a woman wearing a transparent, prismatic, elaborate nemeses headdress, over the should pose, brown skin-tone"
|
319 |
]
|
320 |
|
321 |
css = '''
|
|
|
11 |
import torch
|
12 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler, DiffusionPipeline
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
DESCRIPTION = """
|
15 |
# Midjourney Free on <a href='https://gpt-chatbot.ru/' target='_blank'>GPT-ChatBot.ru</a>
|
16 |
"""
|
|
|
87 |
return image_paths, seed
|
88 |
|
89 |
examples = [
|
90 |
+
"Chocolate dripping from a donut against a yellow background, in the style of brocore, hyper-realistic oil --ar 2:3 --q 2 --s 750 --v 5 --ar 2:3 --q 2 --s 750 --v 5",
|
91 |
+
"3d image, cute girl, in the style of Pixar --ar 1:2 --stylize 750, 4K resolution highlights, Sharp focus, octane render, ray tracing, Ultra-High-Definition, 8k, UHD, HDR, (Masterpiece:1.5), (best quality:1.5)",
|
92 |
+
"Cold coffee in a cup bokeh --ar 85:128 --v 6.0 --style raw5, 4K, Photo-Realistic",
|
93 |
+
"Food photography of a milk shake with flying strawberrys against a pink background, professionally studio shot with cinematic lighting. The image is in the style of a professional studio shot --ar 85:128 --v 6.0 --style raw"
|
|
|
|
|
94 |
]
|
95 |
|
96 |
css = '''
|