Spaces:
Running
on
Zero
Running
on
Zero
Update constants.py
Browse files- constants.py +471 -453
constants.py
CHANGED
@@ -1,453 +1,471 @@
|
|
1 |
-
import os
|
2 |
-
from stablepy.diffusers_vanilla.constants import FLUX_CN_UNION_MODES
|
3 |
-
from stablepy import (
|
4 |
-
scheduler_names,
|
5 |
-
SD15_TASKS,
|
6 |
-
SDXL_TASKS,
|
7 |
-
)
|
8 |
-
|
9 |
-
# - **Download Models**
|
10 |
-
DOWNLOAD_MODEL = "https://civitai.com/api/download/models/574369, https://huggingface.co/TechnoByte/MilkyWonderland/resolve/main/milkyWonderland_v40.safetensors"
|
11 |
-
|
12 |
-
# - **Download VAEs**
|
13 |
-
DOWNLOAD_VAE = "https://huggingface.co/nubby/blessed-sdxl-vae-fp16-fix/resolve/main/sdxl_vae-fp16fix-c-1.1-b-0.5.safetensors?download=true, https://huggingface.co/nubby/blessed-sdxl-vae-fp16-fix/resolve/main/sdxl_vae-fp16fix-blessed.safetensors?download=true, https://huggingface.co/digiplay/VAE/resolve/main/vividReal_v20.safetensors?download=true, https://huggingface.co/fp16-guy/anything_kl-f8-anime2_vae-ft-mse-840000-ema-pruned_blessed_clearvae_fp16_cleaned/resolve/main/vae-ft-mse-840000-ema-pruned_fp16.safetensors?download=true"
|
14 |
-
|
15 |
-
# - **Download LoRAs**
|
16 |
-
DOWNLOAD_LORA = "https://huggingface.co/Leopain/color/resolve/main/Coloring_book_-_LineArt.safetensors, https://civitai.com/api/download/models/135867, https://huggingface.co/Linaqruf/anime-detailer-xl-lora/resolve/main/anime-detailer-xl.safetensors?download=true, https://huggingface.co/Linaqruf/style-enhancer-xl-lora/resolve/main/style-enhancer-xl.safetensors?download=true, https://huggingface.co/ByteDance/Hyper-SD/resolve/main/Hyper-SD15-8steps-CFG-lora.safetensors?download=true, https://huggingface.co/ByteDance/Hyper-SD/resolve/main/Hyper-SDXL-8steps-CFG-lora.safetensors?download=true"
|
17 |
-
|
18 |
-
LOAD_DIFFUSERS_FORMAT_MODEL = [
|
19 |
-
'stabilityai/stable-diffusion-xl-base-1.0',
|
20 |
-
'black-forest-labs/FLUX.1-dev',
|
21 |
-
'John6666/blue-pencil-flux1-v021-fp8-flux',
|
22 |
-
'John6666/wai-ani-flux-v10forfp8-fp8-flux',
|
23 |
-
'John6666/xe-anime-flux-v04-fp8-flux',
|
24 |
-
'John6666/lyh-anime-flux-v2a1-fp8-flux',
|
25 |
-
'John6666/carnival-unchained-v10-fp8-flux',
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
29 |
-
'
|
30 |
-
'
|
31 |
-
'
|
32 |
-
'
|
33 |
-
'
|
34 |
-
'
|
35 |
-
'
|
36 |
-
'
|
37 |
-
'
|
38 |
-
'John6666/
|
39 |
-
'
|
40 |
-
'
|
41 |
-
'
|
42 |
-
'John6666/
|
43 |
-
'John6666/
|
44 |
-
'
|
45 |
-
'
|
46 |
-
'
|
47 |
-
'
|
48 |
-
'
|
49 |
-
'John6666/
|
50 |
-
'
|
51 |
-
'
|
52 |
-
'
|
53 |
-
'John6666/
|
54 |
-
'John6666/
|
55 |
-
'John6666/
|
56 |
-
'John6666/
|
57 |
-
'John6666/
|
58 |
-
'John6666/
|
59 |
-
'John6666/
|
60 |
-
'John6666/
|
61 |
-
'
|
62 |
-
'John6666/
|
63 |
-
'John6666/
|
64 |
-
'John6666/
|
65 |
-
'John6666/
|
66 |
-
'John6666/
|
67 |
-
'
|
68 |
-
'
|
69 |
-
'
|
70 |
-
'
|
71 |
-
'
|
72 |
-
'
|
73 |
-
'
|
74 |
-
'
|
75 |
-
'
|
76 |
-
'
|
77 |
-
'
|
78 |
-
'
|
79 |
-
'
|
80 |
-
'
|
81 |
-
'
|
82 |
-
'
|
83 |
-
'
|
84 |
-
'
|
85 |
-
'
|
86 |
-
'
|
87 |
-
'
|
88 |
-
'
|
89 |
-
'
|
90 |
-
'
|
91 |
-
'
|
92 |
-
'
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
'
|
102 |
-
'
|
103 |
-
'
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
"
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
"
|
146 |
-
"
|
147 |
-
"
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
"
|
155 |
-
"
|
156 |
-
"None
|
157 |
-
],
|
158 |
-
"
|
159 |
-
"
|
160 |
-
"None",
|
161 |
-
],
|
162 |
-
"
|
163 |
-
"
|
164 |
-
"
|
165 |
-
|
166 |
-
|
167 |
-
"
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
"
|
172 |
-
|
173 |
-
|
174 |
-
"
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
"
|
182 |
-
"None",
|
183 |
-
],
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
'
|
207 |
-
'
|
208 |
-
'
|
209 |
-
'
|
210 |
-
'
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
'
|
220 |
-
'
|
221 |
-
'
|
222 |
-
'
|
223 |
-
'
|
224 |
-
'
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
"
|
236 |
-
"
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
"
|
254 |
-
"
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
"
|
263 |
-
"
|
264 |
-
"
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
""
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
"
|
322 |
-
"
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
"",
|
329 |
-
|
330 |
-
|
331 |
-
-
|
332 |
-
"
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
"
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
"
|
353 |
-
|
354 |
-
|
355 |
-
-1,
|
356 |
-
"
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
"
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
"
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
"
|
377 |
-
|
378 |
-
|
379 |
-
-
|
380 |
-
"
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
"
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
"
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
"
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
"
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
"
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
"
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
"
|
425 |
-
|
426 |
-
|
427 |
-
-
|
428 |
-
"
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
"
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
"
|
442 |
-
"
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from stablepy.diffusers_vanilla.constants import FLUX_CN_UNION_MODES
|
3 |
+
from stablepy import (
|
4 |
+
scheduler_names,
|
5 |
+
SD15_TASKS,
|
6 |
+
SDXL_TASKS,
|
7 |
+
)
|
8 |
+
|
9 |
+
# - **Download Models**
|
10 |
+
DOWNLOAD_MODEL = "https://civitai.com/api/download/models/574369, https://huggingface.co/TechnoByte/MilkyWonderland/resolve/main/milkyWonderland_v40.safetensors"
|
11 |
+
|
12 |
+
# - **Download VAEs**
|
13 |
+
DOWNLOAD_VAE = "https://huggingface.co/nubby/blessed-sdxl-vae-fp16-fix/resolve/main/sdxl_vae-fp16fix-c-1.1-b-0.5.safetensors?download=true, https://huggingface.co/nubby/blessed-sdxl-vae-fp16-fix/resolve/main/sdxl_vae-fp16fix-blessed.safetensors?download=true, https://huggingface.co/digiplay/VAE/resolve/main/vividReal_v20.safetensors?download=true, https://huggingface.co/fp16-guy/anything_kl-f8-anime2_vae-ft-mse-840000-ema-pruned_blessed_clearvae_fp16_cleaned/resolve/main/vae-ft-mse-840000-ema-pruned_fp16.safetensors?download=true"
|
14 |
+
|
15 |
+
# - **Download LoRAs**
|
16 |
+
DOWNLOAD_LORA = "https://huggingface.co/Leopain/color/resolve/main/Coloring_book_-_LineArt.safetensors, https://civitai.com/api/download/models/135867, https://huggingface.co/Linaqruf/anime-detailer-xl-lora/resolve/main/anime-detailer-xl.safetensors?download=true, https://huggingface.co/Linaqruf/style-enhancer-xl-lora/resolve/main/style-enhancer-xl.safetensors?download=true, https://huggingface.co/ByteDance/Hyper-SD/resolve/main/Hyper-SD15-8steps-CFG-lora.safetensors?download=true, https://huggingface.co/ByteDance/Hyper-SD/resolve/main/Hyper-SDXL-8steps-CFG-lora.safetensors?download=true"
|
17 |
+
|
18 |
+
LOAD_DIFFUSERS_FORMAT_MODEL = [
|
19 |
+
'stabilityai/stable-diffusion-xl-base-1.0',
|
20 |
+
'black-forest-labs/FLUX.1-dev',
|
21 |
+
'John6666/blue-pencil-flux1-v021-fp8-flux',
|
22 |
+
'John6666/wai-ani-flux-v10forfp8-fp8-flux',
|
23 |
+
'John6666/xe-anime-flux-v04-fp8-flux',
|
24 |
+
'John6666/lyh-anime-flux-v2a1-fp8-flux',
|
25 |
+
'John6666/carnival-unchained-v10-fp8-flux',
|
26 |
+
'Freepik/flux.1-lite-8B-alpha',
|
27 |
+
'ostris/OpenFLUX.1',
|
28 |
+
'John6666/noobai-xl-nai-xl-epsilonpred10version-sdxl',
|
29 |
+
'John6666/noobai-xl-nai-xl-epsilonpred075version-sdxl',
|
30 |
+
'John6666/noobai-xl-nai-xl-epsilonpred05version-sdxl',
|
31 |
+
'John6666/noobai-cyberfix-v10-sdxl',
|
32 |
+
'John6666/noobaiiter-xl-vpred-v075-sdxl',
|
33 |
+
'John6666/complicated-noobai-merge-vprediction-sdxl',
|
34 |
+
'John6666/noobai-fusion2-vpred-itercomp-v1-sdxl',
|
35 |
+
'John6666/noobai-xl-nai-xl-vpredtestversion-sdxl',
|
36 |
+
'John6666/chadmix-noobai075-illustrious01-v10-sdxl',
|
37 |
+
'OnomaAIResearch/Illustrious-xl-early-release-v0',
|
38 |
+
'John6666/obsession-illustriousxl-v21-sdxl',
|
39 |
+
'eienmojiki/Anything-XL',
|
40 |
+
'eienmojiki/Starry-XL-v5.2',
|
41 |
+
'John6666/meinaxl-v2-sdxl',
|
42 |
+
'John6666/epicrealism-xl-v10kiss2-sdxl',
|
43 |
+
'John6666/epicrealism-xl-v8kiss-sdxl',
|
44 |
+
'misri/zavychromaxl_v80',
|
45 |
+
'SG161222/RealVisXL_V4.0',
|
46 |
+
'SG161222/RealVisXL_V5.0',
|
47 |
+
'misri/newrealityxlAllInOne_Newreality40',
|
48 |
+
'gsdf/CounterfeitXL',
|
49 |
+
'John6666/silvermoon-mix-01xl-v11-sdxl',
|
50 |
+
'WhiteAiZ/autismmixSDXL_autismmixConfetti_diffusers',
|
51 |
+
'kitty7779/ponyDiffusionV6XL',
|
52 |
+
'GraydientPlatformAPI/aniverse-pony',
|
53 |
+
'John6666/ras-real-anime-screencap-v1-sdxl',
|
54 |
+
'John6666/duchaiten-pony-xl-no-score-v60-sdxl',
|
55 |
+
'John6666/mistoon-anime-ponyalpha-sdxl',
|
56 |
+
'John6666/3x3x3mixxl-v2-sdxl',
|
57 |
+
'John6666/3x3x3mixxl-3dv01-sdxl',
|
58 |
+
'John6666/ebara-mfcg-pony-mix-v12-sdxl',
|
59 |
+
'John6666/t-ponynai3-v51-sdxl',
|
60 |
+
'John6666/t-ponynai3-v65-sdxl',
|
61 |
+
'John6666/prefect-pony-xl-v3-sdxl',
|
62 |
+
'John6666/mala-anime-mix-nsfw-pony-xl-v5-sdxl',
|
63 |
+
'John6666/wai-real-mix-v11-sdxl',
|
64 |
+
'John6666/wai-c-v6-sdxl',
|
65 |
+
'John6666/iniverse-mix-xl-sfwnsfw-pony-guofeng-v43-sdxl',
|
66 |
+
'John6666/sifw-annihilation-xl-v2-sdxl',
|
67 |
+
'John6666/photo-realistic-pony-v5-sdxl',
|
68 |
+
'John6666/pony-realism-v21main-sdxl',
|
69 |
+
'John6666/pony-realism-v22main-sdxl',
|
70 |
+
'John6666/cyberrealistic-pony-v63-sdxl',
|
71 |
+
'John6666/cyberrealistic-pony-v64-sdxl',
|
72 |
+
'John6666/cyberrealistic-pony-v65-sdxl',
|
73 |
+
'GraydientPlatformAPI/realcartoon-pony-diffusion',
|
74 |
+
'John6666/nova-anime-xl-pony-v5-sdxl',
|
75 |
+
'John6666/autismmix-sdxl-autismmix-pony-sdxl',
|
76 |
+
'John6666/aimz-dream-real-pony-mix-v3-sdxl',
|
77 |
+
'John6666/duchaiten-pony-real-v11fix-sdxl',
|
78 |
+
'John6666/duchaiten-pony-real-v20-sdxl',
|
79 |
+
'John6666/duchaiten-pony-xl-no-score-v70-sdxl',
|
80 |
+
'Eugeoter/artiwaifu-diffusion-2.0',
|
81 |
+
'comin/IterComp',
|
82 |
+
'KBlueLeaf/Kohaku-XL-Zeta',
|
83 |
+
'cagliostrolab/animagine-xl-3.1',
|
84 |
+
'yodayo-ai/kivotos-xl-2.0',
|
85 |
+
'yodayo-ai/holodayo-xl-2.1',
|
86 |
+
'yodayo-ai/clandestine-xl-1.0',
|
87 |
+
'digiplay/majicMIX_sombre_v2',
|
88 |
+
'digiplay/majicMIX_realistic_v6',
|
89 |
+
'digiplay/majicMIX_realistic_v7',
|
90 |
+
'digiplay/DreamShaper_8',
|
91 |
+
'digiplay/BeautifulArt_v1',
|
92 |
+
'digiplay/DarkSushi2.5D_v1',
|
93 |
+
'digiplay/darkphoenix3D_v1.1',
|
94 |
+
'digiplay/BeenYouLiteL11_diffusers',
|
95 |
+
'Yntec/RevAnimatedV2Rebirth',
|
96 |
+
'youknownothing/cyberrealistic_v50',
|
97 |
+
'youknownothing/deliberate-v6',
|
98 |
+
'GraydientPlatformAPI/deliberate-cyber3',
|
99 |
+
'GraydientPlatformAPI/picx-real',
|
100 |
+
'GraydientPlatformAPI/perfectworld6',
|
101 |
+
'emilianJR/epiCRealism',
|
102 |
+
'votepurchase/counterfeitV30_v30',
|
103 |
+
'votepurchase/ChilloutMix',
|
104 |
+
'Meina/MeinaMix_V11',
|
105 |
+
'Meina/MeinaUnreal_V5',
|
106 |
+
'Meina/MeinaPastel_V7',
|
107 |
+
'GraydientPlatformAPI/realcartoon3d-17',
|
108 |
+
'GraydientPlatformAPI/realcartoon-pixar11',
|
109 |
+
'GraydientPlatformAPI/realcartoon-real17',
|
110 |
+
'nitrosocke/Ghibli-Diffusion',
|
111 |
+
]
|
112 |
+
|
113 |
+
DIFFUSERS_FORMAT_LORAS = [
|
114 |
+
"nerijs/animation2k-flux",
|
115 |
+
"XLabs-AI/flux-RealismLora",
|
116 |
+
]
|
117 |
+
|
118 |
+
DOWNLOAD_EMBEDS = [
|
119 |
+
'https://huggingface.co/datasets/Nerfgun3/bad_prompt/blob/main/bad_prompt_version2.pt',
|
120 |
+
'https://huggingface.co/embed/negative/resolve/main/EasyNegativeV2.safetensors',
|
121 |
+
'https://huggingface.co/embed/negative/resolve/main/bad-hands-5.pt',
|
122 |
+
]
|
123 |
+
|
124 |
+
CIVITAI_API_KEY = os.environ.get("CIVITAI_API_KEY")
|
125 |
+
HF_TOKEN = os.environ.get("HF_READ_TOKEN")
|
126 |
+
|
127 |
+
DIRECTORY_MODELS = 'models'
|
128 |
+
DIRECTORY_LORAS = 'loras'
|
129 |
+
DIRECTORY_VAES = 'vaes'
|
130 |
+
DIRECTORY_EMBEDS = 'embedings'
|
131 |
+
|
132 |
+
PREPROCESSOR_CONTROLNET = {
|
133 |
+
"openpose": [
|
134 |
+
"Openpose",
|
135 |
+
"None",
|
136 |
+
],
|
137 |
+
"scribble": [
|
138 |
+
"HED",
|
139 |
+
"PidiNet",
|
140 |
+
"None",
|
141 |
+
],
|
142 |
+
"softedge": [
|
143 |
+
"PidiNet",
|
144 |
+
"HED",
|
145 |
+
"HED safe",
|
146 |
+
"PidiNet safe",
|
147 |
+
"None",
|
148 |
+
],
|
149 |
+
"segmentation": [
|
150 |
+
"UPerNet",
|
151 |
+
"None",
|
152 |
+
],
|
153 |
+
"depth": [
|
154 |
+
"DPT",
|
155 |
+
"Midas",
|
156 |
+
"None",
|
157 |
+
],
|
158 |
+
"normalbae": [
|
159 |
+
"NormalBae",
|
160 |
+
"None",
|
161 |
+
],
|
162 |
+
"lineart": [
|
163 |
+
"Lineart",
|
164 |
+
"Lineart coarse",
|
165 |
+
"Lineart (anime)",
|
166 |
+
"None",
|
167 |
+
"None (anime)",
|
168 |
+
],
|
169 |
+
"lineart_anime": [
|
170 |
+
"Lineart",
|
171 |
+
"Lineart coarse",
|
172 |
+
"Lineart (anime)",
|
173 |
+
"None",
|
174 |
+
"None (anime)",
|
175 |
+
],
|
176 |
+
"shuffle": [
|
177 |
+
"ContentShuffle",
|
178 |
+
"None",
|
179 |
+
],
|
180 |
+
"canny": [
|
181 |
+
"Canny",
|
182 |
+
"None",
|
183 |
+
],
|
184 |
+
"mlsd": [
|
185 |
+
"MLSD",
|
186 |
+
"None",
|
187 |
+
],
|
188 |
+
"ip2p": [
|
189 |
+
"ip2p"
|
190 |
+
],
|
191 |
+
"recolor": [
|
192 |
+
"Recolor luminance",
|
193 |
+
"Recolor intensity",
|
194 |
+
"None",
|
195 |
+
],
|
196 |
+
"tile": [
|
197 |
+
"Mild Blur",
|
198 |
+
"Moderate Blur",
|
199 |
+
"Heavy Blur",
|
200 |
+
"None",
|
201 |
+
],
|
202 |
+
|
203 |
+
}
|
204 |
+
|
205 |
+
TASK_STABLEPY = {
|
206 |
+
'txt2img': 'txt2img',
|
207 |
+
'img2img': 'img2img',
|
208 |
+
'inpaint': 'inpaint',
|
209 |
+
# 'canny T2I Adapter': 'sdxl_canny_t2i', # NO HAVE STEP CALLBACK PARAMETERS SO NOT WORKS WITH DIFFUSERS 0.29.0
|
210 |
+
# 'sketch T2I Adapter': 'sdxl_sketch_t2i',
|
211 |
+
# 'lineart T2I Adapter': 'sdxl_lineart_t2i',
|
212 |
+
# 'depth-midas T2I Adapter': 'sdxl_depth-midas_t2i',
|
213 |
+
# 'openpose T2I Adapter': 'sdxl_openpose_t2i',
|
214 |
+
'openpose ControlNet': 'openpose',
|
215 |
+
'canny ControlNet': 'canny',
|
216 |
+
'mlsd ControlNet': 'mlsd',
|
217 |
+
'scribble ControlNet': 'scribble',
|
218 |
+
'softedge ControlNet': 'softedge',
|
219 |
+
'segmentation ControlNet': 'segmentation',
|
220 |
+
'depth ControlNet': 'depth',
|
221 |
+
'normalbae ControlNet': 'normalbae',
|
222 |
+
'lineart ControlNet': 'lineart',
|
223 |
+
'lineart_anime ControlNet': 'lineart_anime',
|
224 |
+
'shuffle ControlNet': 'shuffle',
|
225 |
+
'ip2p ControlNet': 'ip2p',
|
226 |
+
'optical pattern ControlNet': 'pattern',
|
227 |
+
'recolor ControlNet': 'recolor',
|
228 |
+
'tile ControlNet': 'tile',
|
229 |
+
}
|
230 |
+
|
231 |
+
TASK_MODEL_LIST = list(TASK_STABLEPY.keys())
|
232 |
+
|
233 |
+
UPSCALER_DICT_GUI = {
|
234 |
+
None: None,
|
235 |
+
"Lanczos": "Lanczos",
|
236 |
+
"Nearest": "Nearest",
|
237 |
+
'Latent': 'Latent',
|
238 |
+
'Latent (antialiased)': 'Latent (antialiased)',
|
239 |
+
'Latent (bicubic)': 'Latent (bicubic)',
|
240 |
+
'Latent (bicubic antialiased)': 'Latent (bicubic antialiased)',
|
241 |
+
'Latent (nearest)': 'Latent (nearest)',
|
242 |
+
'Latent (nearest-exact)': 'Latent (nearest-exact)',
|
243 |
+
"RealESRGAN_x4plus": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth",
|
244 |
+
"RealESRNet_x4plus": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.1/RealESRNet_x4plus.pth",
|
245 |
+
"RealESRGAN_x4plus_anime_6B": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth",
|
246 |
+
"RealESRGAN_x2plus": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth",
|
247 |
+
"realesr-animevideov3": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-animevideov3.pth",
|
248 |
+
"realesr-general-x4v3": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth",
|
249 |
+
"realesr-general-wdn-x4v3": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-wdn-x4v3.pth",
|
250 |
+
"4x-UltraSharp": "https://huggingface.co/Shandypur/ESRGAN-4x-UltraSharp/resolve/main/4x-UltraSharp.pth",
|
251 |
+
"4x_foolhardy_Remacri": "https://huggingface.co/FacehugmanIII/4x_foolhardy_Remacri/resolve/main/4x_foolhardy_Remacri.pth",
|
252 |
+
"Remacri4xExtraSmoother": "https://huggingface.co/hollowstrawberry/upscalers-backup/resolve/main/ESRGAN/Remacri%204x%20ExtraSmoother.pth",
|
253 |
+
"AnimeSharp4x": "https://huggingface.co/hollowstrawberry/upscalers-backup/resolve/main/ESRGAN/AnimeSharp%204x.pth",
|
254 |
+
"lollypop": "https://huggingface.co/hollowstrawberry/upscalers-backup/resolve/main/ESRGAN/lollypop.pth",
|
255 |
+
"RealisticRescaler4x": "https://huggingface.co/hollowstrawberry/upscalers-backup/resolve/main/ESRGAN/RealisticRescaler%204x.pth",
|
256 |
+
"NickelbackFS4x": "https://huggingface.co/hollowstrawberry/upscalers-backup/resolve/main/ESRGAN/NickelbackFS%204x.pth"
|
257 |
+
}
|
258 |
+
|
259 |
+
UPSCALER_KEYS = list(UPSCALER_DICT_GUI.keys())
|
260 |
+
|
261 |
+
PROMPT_W_OPTIONS = [
|
262 |
+
("Compel format: (word)weight", "Compel"),
|
263 |
+
("Classic format: (word:weight)", "Classic"),
|
264 |
+
("Classic-original format: (word:weight)", "Classic-original"),
|
265 |
+
("Classic-no_norm format: (word:weight)", "Classic-no_norm"),
|
266 |
+
("Classic-ignore", "Classic-ignore"),
|
267 |
+
("None", "None"),
|
268 |
+
]
|
269 |
+
|
270 |
+
WARNING_MSG_VAE = (
|
271 |
+
"Use the right VAE for your model to maintain image quality. The wrong"
|
272 |
+
" VAE can lead to poor results, like blurriness in the generated images."
|
273 |
+
)
|
274 |
+
|
275 |
+
SDXL_TASK = [k for k, v in TASK_STABLEPY.items() if v in SDXL_TASKS]
|
276 |
+
SD_TASK = [k for k, v in TASK_STABLEPY.items() if v in SD15_TASKS]
|
277 |
+
FLUX_TASK = list(TASK_STABLEPY.keys())[:3] + [k for k, v in TASK_STABLEPY.items() if v in FLUX_CN_UNION_MODES.keys()]
|
278 |
+
|
279 |
+
MODEL_TYPE_TASK = {
|
280 |
+
"SD 1.5": SD_TASK,
|
281 |
+
"SDXL": SDXL_TASK,
|
282 |
+
"FLUX": FLUX_TASK,
|
283 |
+
}
|
284 |
+
|
285 |
+
MODEL_TYPE_CLASS = {
|
286 |
+
"diffusers:StableDiffusionPipeline": "SD 1.5",
|
287 |
+
"diffusers:StableDiffusionXLPipeline": "SDXL",
|
288 |
+
"diffusers:FluxPipeline": "FLUX",
|
289 |
+
}
|
290 |
+
|
291 |
+
POST_PROCESSING_SAMPLER = ["Use same sampler"] + scheduler_names[:-2]
|
292 |
+
|
293 |
+
SUBTITLE_GUI = (
|
294 |
+
"### This demo uses [diffusers](https://github.com/huggingface/diffusers)"
|
295 |
+
" to perform different tasks in image generation."
|
296 |
+
)
|
297 |
+
|
298 |
+
HELP_GUI = (
|
299 |
+
"""### Help:
|
300 |
+
- The current space runs on a ZERO GPU which is assigned for approximately 60 seconds; Therefore, if you submit expensive tasks, the operation may be canceled upon reaching the maximum allowed time with 'GPU TASK ABORTED'.
|
301 |
+
- Distorted or strange images often result from high prompt weights, so it's best to use low weights and scales, and consider using Classic variants like 'Classic-original'.
|
302 |
+
- For better results with Pony Diffusion, try using sampler DPM++ 1s or DPM2 with Compel or Classic prompt weights.
|
303 |
+
"""
|
304 |
+
)
|
305 |
+
|
306 |
+
EXAMPLES_GUI_HELP = (
|
307 |
+
"""### The following examples perform specific tasks:
|
308 |
+
1. Generation with SDXL and upscale
|
309 |
+
2. Generation with FLUX dev
|
310 |
+
3. ControlNet Canny SDXL
|
311 |
+
4. Optical pattern (Optical illusion) SDXL
|
312 |
+
5. Convert an image to a coloring drawing
|
313 |
+
6. ControlNet OpenPose SD 1.5 and Latent upscale
|
314 |
+
|
315 |
+
- Different tasks can be performed, such as img2img or using the IP adapter, to preserve a person's appearance or a specific style based on an image.
|
316 |
+
"""
|
317 |
+
)
|
318 |
+
|
319 |
+
EXAMPLES_GUI = [
|
320 |
+
[
|
321 |
+
"splatter paint theme, 1girl, frame center, pretty face, face with artistic paint artwork, feminism, long hair, upper body view, futuristic expression illustrative painted background, origami, stripes, explosive paint splashes behind her, hand on cheek pose, strobe lighting, masterpiece photography creative artwork, golden morning light, highly detailed, masterpiece, best quality, very aesthetic, absurdres",
|
322 |
+
"logo, artist name, (worst quality, normal quality), bad-artist, ((bad anatomy)), ((bad hands)), ((bad proportions)), ((duplicate limbs)), ((fused limbs)), ((interlocking fingers)), ((poorly drawn face)), high contrast., score_6, score_5, score_4, lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]",
|
323 |
+
28,
|
324 |
+
5.0,
|
325 |
+
-1,
|
326 |
+
"None",
|
327 |
+
0.33,
|
328 |
+
"DPM++ 2M SDE",
|
329 |
+
1152,
|
330 |
+
896,
|
331 |
+
"John6666/noobai-xl-nai-xl-epsilonpred10version-sdxl",
|
332 |
+
"txt2img",
|
333 |
+
"image.webp", # img conttol
|
334 |
+
1024, # img resolution
|
335 |
+
0.35, # strength
|
336 |
+
1.0, # cn scale
|
337 |
+
0.0, # cn start
|
338 |
+
1.0, # cn end
|
339 |
+
"Classic",
|
340 |
+
"Nearest",
|
341 |
+
45,
|
342 |
+
False,
|
343 |
+
],
|
344 |
+
[
|
345 |
+
"a digital illustration of a movie poster titled 'Finding Emo', finding nemo parody poster, featuring a depressed cartoon clownfish with black emo hair, eyeliner, and piercings, bored expression, swimming in a dark underwater scene, in the background, movie title in a dripping, grungy font, moody blue and purple color palette",
|
346 |
+
"",
|
347 |
+
24,
|
348 |
+
3.5,
|
349 |
+
-1,
|
350 |
+
"None",
|
351 |
+
0.33,
|
352 |
+
"FlowMatchEuler",
|
353 |
+
1152,
|
354 |
+
896,
|
355 |
+
"black-forest-labs/FLUX.1-dev",
|
356 |
+
"txt2img",
|
357 |
+
None, # img conttol
|
358 |
+
1024, # img resolution
|
359 |
+
0.35, # strength
|
360 |
+
1.0, # cn scale
|
361 |
+
0.0, # cn start
|
362 |
+
1.0, # cn end
|
363 |
+
"Classic",
|
364 |
+
None,
|
365 |
+
70,
|
366 |
+
True,
|
367 |
+
],
|
368 |
+
[
|
369 |
+
"((masterpiece)), best quality, blonde disco girl, detailed face, realistic face, realistic hair, dynamic pose, pink pvc, intergalactic disco background, pastel lights, dynamic contrast, airbrush, fine detail, 70s vibe, midriff",
|
370 |
+
"(worst quality:1.2), (bad quality:1.2), (poor quality:1.2), (missing fingers:1.2), bad-artist-anime, bad-artist, bad-picture-chill-75v",
|
371 |
+
48,
|
372 |
+
3.5,
|
373 |
+
-1,
|
374 |
+
"None",
|
375 |
+
0.33,
|
376 |
+
"DPM++ 2M SDE Lu",
|
377 |
+
1024,
|
378 |
+
1024,
|
379 |
+
"John6666/epicrealism-xl-v10kiss2-sdxl",
|
380 |
+
"canny ControlNet",
|
381 |
+
"image.webp", # img conttol
|
382 |
+
1024, # img resolution
|
383 |
+
0.35, # strength
|
384 |
+
1.0, # cn scale
|
385 |
+
0.0, # cn start
|
386 |
+
1.0, # cn end
|
387 |
+
"Classic",
|
388 |
+
None,
|
389 |
+
44,
|
390 |
+
False,
|
391 |
+
],
|
392 |
+
[
|
393 |
+
"cinematic scenery old city ruins",
|
394 |
+
"(worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), (illustration, 3d, 2d, painting, cartoons, sketch, blurry, film grain, noise), (low quality, worst quality:1.2)",
|
395 |
+
50,
|
396 |
+
4.0,
|
397 |
+
-1,
|
398 |
+
"None",
|
399 |
+
0.33,
|
400 |
+
"Euler a",
|
401 |
+
1024,
|
402 |
+
1024,
|
403 |
+
"SG161222/RealVisXL_V5.0",
|
404 |
+
"optical pattern ControlNet",
|
405 |
+
"spiral_no_transparent.png", # img conttol
|
406 |
+
1024, # img resolution
|
407 |
+
0.35, # strength
|
408 |
+
1.0, # cn scale
|
409 |
+
0.05, # cn start
|
410 |
+
0.75, # cn end
|
411 |
+
"Classic",
|
412 |
+
None,
|
413 |
+
35,
|
414 |
+
False,
|
415 |
+
],
|
416 |
+
[
|
417 |
+
"black and white, line art, coloring drawing, clean line art, black strokes, no background, white, black, free lines, black scribbles, on paper, A blend of comic book art and lineart full of black and white color, masterpiece, high-resolution, trending on Pixiv fan box, palette knife, brush strokes, two-dimensional, planar vector, T-shirt design, stickers, and T-shirt design, vector art, fantasy art, Adobe Illustrator, hand-painted, digital painting, low polygon, soft lighting, aerial view, isometric style, retro aesthetics, 8K resolution, black sketch lines, monochrome, invert color",
|
418 |
+
"color, red, green, yellow, colored, duplicate, blurry, abstract, disfigured, deformed, animated, toy, figure, framed, 3d, bad art, poorly drawn, extra limbs, close up, b&w, weird colors, blurry, watermark, blur haze, 2 heads, long neck, watermark, elongated body, cropped image, out of frame, draft, deformed hands, twisted fingers, double image, malformed hands, multiple heads, extra limb, ugly, poorly drawn hands, missing limb, cut-off, over satured, grain, lowères, bad anatomy, poorly drawn face, mutation, mutated, floating limbs, disconnected limbs, out of focus, long body, disgusting, extra fingers, groos proportions, missing arms, mutated hands, cloned face, missing legs, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft, deformed, blurry, bad anatomy, disfigured, poorly drawn face, mutation, bluelish, blue",
|
419 |
+
20,
|
420 |
+
4.0,
|
421 |
+
-1,
|
422 |
+
"loras/Coloring_book_-_LineArt.safetensors",
|
423 |
+
1.0,
|
424 |
+
"DPM++ 2M SDE",
|
425 |
+
1024,
|
426 |
+
1024,
|
427 |
+
"eienmojiki/Anything-XL",
|
428 |
+
"lineart ControlNet",
|
429 |
+
"color_image.png", # img conttol
|
430 |
+
896, # img resolution
|
431 |
+
0.35, # strength
|
432 |
+
1.0, # cn scale
|
433 |
+
0.0, # cn start
|
434 |
+
1.0, # cn end
|
435 |
+
"Compel",
|
436 |
+
None,
|
437 |
+
35,
|
438 |
+
False,
|
439 |
+
],
|
440 |
+
[
|
441 |
+
"1girl,face,curly hair,red hair,white background,",
|
442 |
+
"(worst quality:2),(low quality:2),(normal quality:2),lowres,watermark,",
|
443 |
+
38,
|
444 |
+
5.0,
|
445 |
+
-1,
|
446 |
+
"None",
|
447 |
+
0.33,
|
448 |
+
"DPM++ 2M SDE",
|
449 |
+
512,
|
450 |
+
512,
|
451 |
+
"digiplay/majicMIX_realistic_v7",
|
452 |
+
"openpose ControlNet",
|
453 |
+
"image.webp", # img conttol
|
454 |
+
1024, # img resolution
|
455 |
+
0.35, # strength
|
456 |
+
1.0, # cn scale
|
457 |
+
0.0, # cn start
|
458 |
+
0.9, # cn end
|
459 |
+
"Compel",
|
460 |
+
"Latent (antialiased)",
|
461 |
+
46,
|
462 |
+
False,
|
463 |
+
],
|
464 |
+
]
|
465 |
+
|
466 |
+
RESOURCES = (
|
467 |
+
"""### Resources
|
468 |
+
- John6666's space has some great features you might find helpful [link](https://huggingface.co/spaces/John6666/DiffuseCraftMod).
|
469 |
+
- You can also try the image generator in Colab’s free tier, which provides free GPU [link](https://github.com/R3gm/SD_diffusers_interactive).
|
470 |
+
"""
|
471 |
+
)
|