John6666 commited on
Commit
14fe195
·
verified ·
1 Parent(s): ad4f1bb

Upload 6 files

Browse files
Files changed (6) hide show
  1. app.py +3 -3
  2. constants.py +471 -453
  3. dc.py +45 -15
  4. env.py +29 -6
  5. requirements.txt +1 -1
  6. utils.py +7 -2
app.py CHANGED
@@ -91,7 +91,7 @@ with gr.Blocks(fill_width=True, elem_id="container", css=css, delete_cache=(60,
91
  model_detail = gr.Checkbox(label="Show detail of model in list", value=False)
92
 
93
  with gr.Row():
94
- sampler = gr.Dropdown(label="Sampler", choices=get_samplers(), value="Euler a")
95
  vae_model = gr.Dropdown(label="VAE Model", choices=get_vaes(), value=get_vaes()[0])
96
 
97
  with gr.Accordion("LoRA", open=True, visible=True):
@@ -147,7 +147,7 @@ with gr.Blocks(fill_width=True, elem_id="container", css=css, delete_cache=(60,
147
  lora5_md = gr.Markdown(value="", visible=False)
148
  with gr.Accordion("From URL", open=True, visible=True):
149
  with gr.Row():
150
- lora_search_civitai_basemodel = gr.CheckboxGroup(label="Search LoRA for", choices=CIVITAI_BASEMODEL, value=["Pony", "SDXL 1.0"])
151
  lora_search_civitai_sort = gr.Radio(label="Sort", choices=CIVITAI_SORT, value="Highest Rated")
152
  lora_search_civitai_period = gr.Radio(label="Period", choices=CIVITAI_PERIOD, value="AllTime")
153
  with gr.Row():
@@ -161,7 +161,7 @@ with gr.Blocks(fill_width=True, elem_id="container", css=css, delete_cache=(60,
161
  with gr.Accordion("Select from Gallery", open=False):
162
  lora_search_civitai_gallery = gr.Gallery([], label="Results", allow_preview=False, columns=5, show_share_button=False, interactive=False)
163
  lora_search_civitai_result = gr.Dropdown(label="Search Results", choices=[("", "")], value="", allow_custom_value=True, visible=False)
164
- lora_download_url = gr.Textbox(label="LoRA URL", placeholder="https://civitai.com/api/download/models/28907", lines=1)
165
  lora_download = gr.Button("Get and set LoRA and apply to prompt")
166
 
167
  with gr.Row():
 
91
  model_detail = gr.Checkbox(label="Show detail of model in list", value=False)
92
 
93
  with gr.Row():
94
+ sampler = gr.Dropdown(label="Sampler", choices=get_samplers(), value="Euler")
95
  vae_model = gr.Dropdown(label="VAE Model", choices=get_vaes(), value=get_vaes()[0])
96
 
97
  with gr.Accordion("LoRA", open=True, visible=True):
 
147
  lora5_md = gr.Markdown(value="", visible=False)
148
  with gr.Accordion("From URL", open=True, visible=True):
149
  with gr.Row():
150
+ lora_search_civitai_basemodel = gr.CheckboxGroup(label="Search LoRA for", choices=CIVITAI_BASEMODEL, value=["Pony", "Illustrious", "SDXL 1.0"])
151
  lora_search_civitai_sort = gr.Radio(label="Sort", choices=CIVITAI_SORT, value="Highest Rated")
152
  lora_search_civitai_period = gr.Radio(label="Period", choices=CIVITAI_PERIOD, value="AllTime")
153
  with gr.Row():
 
161
  with gr.Accordion("Select from Gallery", open=False):
162
  lora_search_civitai_gallery = gr.Gallery([], label="Results", allow_preview=False, columns=5, show_share_button=False, interactive=False)
163
  lora_search_civitai_result = gr.Dropdown(label="Search Results", choices=[("", "")], value="", allow_custom_value=True, visible=False)
164
+ lora_download_url = gr.Textbox(label="LoRA URL", placeholder="https://civitai.com/api/download/models/28907", info="It has to be .safetensors files, and you can also download them from Hugging Face.", lines=1)
165
  lora_download = gr.Button("Get and set LoRA and apply to prompt")
166
 
167
  with gr.Row():
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
- 'cagliostrolab/animagine-xl-3.1',
27
- 'John6666/epicrealism-xl-v8kiss-sdxl',
28
- 'misri/epicrealismXL_v7FinalDestination',
29
- 'misri/juggernautXL_juggernautX',
30
- 'misri/zavychromaxl_v80',
31
- 'SG161222/RealVisXL_V4.0',
32
- 'SG161222/RealVisXL_V5.0',
33
- 'misri/newrealityxlAllInOne_Newreality40',
34
- 'eienmojiki/Anything-XL',
35
- 'eienmojiki/Starry-XL-v5.2',
36
- 'gsdf/CounterfeitXL',
37
- 'KBlueLeaf/Kohaku-XL-Zeta',
38
- 'John6666/silvermoon-mix-01xl-v11-sdxl',
39
- 'WhiteAiZ/autismmixSDXL_autismmixConfetti_diffusers',
40
- 'kitty7779/ponyDiffusionV6XL',
41
- 'GraydientPlatformAPI/aniverse-pony',
42
- 'John6666/ras-real-anime-screencap-v1-sdxl',
43
- 'John6666/duchaiten-pony-xl-no-score-v60-sdxl',
44
- 'John6666/mistoon-anime-ponyalpha-sdxl',
45
- 'John6666/3x3x3mixxl-v2-sdxl',
46
- 'John6666/3x3x3mixxl-3dv01-sdxl',
47
- 'John6666/ebara-mfcg-pony-mix-v12-sdxl',
48
- 'John6666/t-ponynai3-v51-sdxl',
49
- 'John6666/t-ponynai3-v65-sdxl',
50
- 'John6666/prefect-pony-xl-v3-sdxl',
51
- 'John6666/mala-anime-mix-nsfw-pony-xl-v5-sdxl',
52
- 'John6666/wai-real-mix-v11-sdxl',
53
- 'John6666/wai-c-v6-sdxl',
54
- 'John6666/iniverse-mix-xl-sfwnsfw-pony-guofeng-v43-sdxl',
55
- 'John6666/photo-realistic-pony-v5-sdxl',
56
- 'John6666/pony-realism-v21main-sdxl',
57
- 'John6666/pony-realism-v22main-sdxl',
58
- 'John6666/cyberrealistic-pony-v63-sdxl',
59
- 'John6666/cyberrealistic-pony-v64-sdxl',
60
- 'John6666/cyberrealistic-pony-v65-sdxl',
61
- 'GraydientPlatformAPI/realcartoon-pony-diffusion',
62
- 'John6666/nova-anime-xl-pony-v5-sdxl',
63
- 'John6666/autismmix-sdxl-autismmix-pony-sdxl',
64
- 'John6666/aimz-dream-real-pony-mix-v3-sdxl',
65
- 'John6666/duchaiten-pony-real-v11fix-sdxl',
66
- 'John6666/duchaiten-pony-real-v20-sdxl',
67
- 'yodayo-ai/kivotos-xl-2.0',
68
- 'yodayo-ai/holodayo-xl-2.1',
69
- 'yodayo-ai/clandestine-xl-1.0',
70
- 'digiplay/majicMIX_sombre_v2',
71
- 'digiplay/majicMIX_realistic_v6',
72
- 'digiplay/majicMIX_realistic_v7',
73
- 'digiplay/DreamShaper_8',
74
- 'digiplay/BeautifulArt_v1',
75
- 'digiplay/DarkSushi2.5D_v1',
76
- 'digiplay/darkphoenix3D_v1.1',
77
- 'digiplay/BeenYouLiteL11_diffusers',
78
- 'Yntec/RevAnimatedV2Rebirth',
79
- 'youknownothing/cyberrealistic_v50',
80
- 'youknownothing/deliberate-v6',
81
- 'GraydientPlatformAPI/deliberate-cyber3',
82
- 'GraydientPlatformAPI/picx-real',
83
- 'GraydientPlatformAPI/perfectworld6',
84
- 'emilianJR/epiCRealism',
85
- 'votepurchase/counterfeitV30_v30',
86
- 'votepurchase/ChilloutMix',
87
- 'Meina/MeinaMix_V11',
88
- 'Meina/MeinaUnreal_V5',
89
- 'Meina/MeinaPastel_V7',
90
- 'GraydientPlatformAPI/realcartoon3d-17',
91
- 'GraydientPlatformAPI/realcartoon-pixar11',
92
- 'GraydientPlatformAPI/realcartoon-real17',
93
- ]
94
-
95
- DIFFUSERS_FORMAT_LORAS = [
96
- "nerijs/animation2k-flux",
97
- "XLabs-AI/flux-RealismLora",
98
- ]
99
-
100
- DOWNLOAD_EMBEDS = [
101
- 'https://huggingface.co/datasets/Nerfgun3/bad_prompt/blob/main/bad_prompt_version2.pt',
102
- 'https://huggingface.co/embed/negative/resolve/main/EasyNegativeV2.safetensors',
103
- 'https://huggingface.co/embed/negative/resolve/main/bad-hands-5.pt',
104
- ]
105
-
106
- CIVITAI_API_KEY = os.environ.get("CIVITAI_API_KEY")
107
- HF_TOKEN = os.environ.get("HF_READ_TOKEN")
108
-
109
- DIRECTORY_MODELS = 'models'
110
- DIRECTORY_LORAS = 'loras'
111
- DIRECTORY_VAES = 'vaes'
112
- DIRECTORY_EMBEDS = 'embedings'
113
-
114
- PREPROCESSOR_CONTROLNET = {
115
- "openpose": [
116
- "Openpose",
117
- "None",
118
- ],
119
- "scribble": [
120
- "HED",
121
- "PidiNet",
122
- "None",
123
- ],
124
- "softedge": [
125
- "PidiNet",
126
- "HED",
127
- "HED safe",
128
- "PidiNet safe",
129
- "None",
130
- ],
131
- "segmentation": [
132
- "UPerNet",
133
- "None",
134
- ],
135
- "depth": [
136
- "DPT",
137
- "Midas",
138
- "None",
139
- ],
140
- "normalbae": [
141
- "NormalBae",
142
- "None",
143
- ],
144
- "lineart": [
145
- "Lineart",
146
- "Lineart coarse",
147
- "Lineart (anime)",
148
- "None",
149
- "None (anime)",
150
- ],
151
- "lineart_anime": [
152
- "Lineart",
153
- "Lineart coarse",
154
- "Lineart (anime)",
155
- "None",
156
- "None (anime)",
157
- ],
158
- "shuffle": [
159
- "ContentShuffle",
160
- "None",
161
- ],
162
- "canny": [
163
- "Canny",
164
- "None",
165
- ],
166
- "mlsd": [
167
- "MLSD",
168
- "None",
169
- ],
170
- "ip2p": [
171
- "ip2p"
172
- ],
173
- "recolor": [
174
- "Recolor luminance",
175
- "Recolor intensity",
176
- "None",
177
- ],
178
- "tile": [
179
- "Mild Blur",
180
- "Moderate Blur",
181
- "Heavy Blur",
182
- "None",
183
- ],
184
-
185
- }
186
-
187
- TASK_STABLEPY = {
188
- 'txt2img': 'txt2img',
189
- 'img2img': 'img2img',
190
- 'inpaint': 'inpaint',
191
- # 'canny T2I Adapter': 'sdxl_canny_t2i', # NO HAVE STEP CALLBACK PARAMETERS SO NOT WORKS WITH DIFFUSERS 0.29.0
192
- # 'sketch T2I Adapter': 'sdxl_sketch_t2i',
193
- # 'lineart T2I Adapter': 'sdxl_lineart_t2i',
194
- # 'depth-midas T2I Adapter': 'sdxl_depth-midas_t2i',
195
- # 'openpose T2I Adapter': 'sdxl_openpose_t2i',
196
- 'openpose ControlNet': 'openpose',
197
- 'canny ControlNet': 'canny',
198
- 'mlsd ControlNet': 'mlsd',
199
- 'scribble ControlNet': 'scribble',
200
- 'softedge ControlNet': 'softedge',
201
- 'segmentation ControlNet': 'segmentation',
202
- 'depth ControlNet': 'depth',
203
- 'normalbae ControlNet': 'normalbae',
204
- 'lineart ControlNet': 'lineart',
205
- 'lineart_anime ControlNet': 'lineart_anime',
206
- 'shuffle ControlNet': 'shuffle',
207
- 'ip2p ControlNet': 'ip2p',
208
- 'optical pattern ControlNet': 'pattern',
209
- 'recolor ControlNet': 'recolor',
210
- 'tile ControlNet': 'tile',
211
- }
212
-
213
- TASK_MODEL_LIST = list(TASK_STABLEPY.keys())
214
-
215
- UPSCALER_DICT_GUI = {
216
- None: None,
217
- "Lanczos": "Lanczos",
218
- "Nearest": "Nearest",
219
- 'Latent': 'Latent',
220
- 'Latent (antialiased)': 'Latent (antialiased)',
221
- 'Latent (bicubic)': 'Latent (bicubic)',
222
- 'Latent (bicubic antialiased)': 'Latent (bicubic antialiased)',
223
- 'Latent (nearest)': 'Latent (nearest)',
224
- 'Latent (nearest-exact)': 'Latent (nearest-exact)',
225
- "RealESRGAN_x4plus": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth",
226
- "RealESRNet_x4plus": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.1/RealESRNet_x4plus.pth",
227
- "RealESRGAN_x4plus_anime_6B": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth",
228
- "RealESRGAN_x2plus": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth",
229
- "realesr-animevideov3": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-animevideov3.pth",
230
- "realesr-general-x4v3": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth",
231
- "realesr-general-wdn-x4v3": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-wdn-x4v3.pth",
232
- "4x-UltraSharp": "https://huggingface.co/Shandypur/ESRGAN-4x-UltraSharp/resolve/main/4x-UltraSharp.pth",
233
- "4x_foolhardy_Remacri": "https://huggingface.co/FacehugmanIII/4x_foolhardy_Remacri/resolve/main/4x_foolhardy_Remacri.pth",
234
- "Remacri4xExtraSmoother": "https://huggingface.co/hollowstrawberry/upscalers-backup/resolve/main/ESRGAN/Remacri%204x%20ExtraSmoother.pth",
235
- "AnimeSharp4x": "https://huggingface.co/hollowstrawberry/upscalers-backup/resolve/main/ESRGAN/AnimeSharp%204x.pth",
236
- "lollypop": "https://huggingface.co/hollowstrawberry/upscalers-backup/resolve/main/ESRGAN/lollypop.pth",
237
- "RealisticRescaler4x": "https://huggingface.co/hollowstrawberry/upscalers-backup/resolve/main/ESRGAN/RealisticRescaler%204x.pth",
238
- "NickelbackFS4x": "https://huggingface.co/hollowstrawberry/upscalers-backup/resolve/main/ESRGAN/NickelbackFS%204x.pth"
239
- }
240
-
241
- UPSCALER_KEYS = list(UPSCALER_DICT_GUI.keys())
242
-
243
- PROMPT_W_OPTIONS = [
244
- ("Compel format: (word)weight", "Compel"),
245
- ("Classic format: (word:weight)", "Classic"),
246
- ("Classic-original format: (word:weight)", "Classic-original"),
247
- ("Classic-no_norm format: (word:weight)", "Classic-no_norm"),
248
- ("Classic-ignore", "Classic-ignore"),
249
- ("None", "None"),
250
- ]
251
-
252
- WARNING_MSG_VAE = (
253
- "Use the right VAE for your model to maintain image quality. The wrong"
254
- " VAE can lead to poor results, like blurriness in the generated images."
255
- )
256
-
257
- SDXL_TASK = [k for k, v in TASK_STABLEPY.items() if v in SDXL_TASKS]
258
- SD_TASK = [k for k, v in TASK_STABLEPY.items() if v in SD15_TASKS]
259
- FLUX_TASK = list(TASK_STABLEPY.keys())[:3] + [k for k, v in TASK_STABLEPY.items() if v in FLUX_CN_UNION_MODES.keys()]
260
-
261
- MODEL_TYPE_TASK = {
262
- "SD 1.5": SD_TASK,
263
- "SDXL": SDXL_TASK,
264
- "FLUX": FLUX_TASK,
265
- }
266
-
267
- MODEL_TYPE_CLASS = {
268
- "diffusers:StableDiffusionPipeline": "SD 1.5",
269
- "diffusers:StableDiffusionXLPipeline": "SDXL",
270
- "diffusers:FluxPipeline": "FLUX",
271
- }
272
-
273
- POST_PROCESSING_SAMPLER = ["Use same sampler"] + scheduler_names[:-2]
274
-
275
- SUBTITLE_GUI = (
276
- "### This demo uses [diffusers](https://github.com/huggingface/diffusers)"
277
- " to perform different tasks in image generation."
278
- )
279
-
280
- HELP_GUI = (
281
- """### Help:
282
- - 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'.
283
- - 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'.
284
- - For better results with Pony Diffusion, try using sampler DPM++ 1s or DPM2 with Compel or Classic prompt weights.
285
- """
286
- )
287
-
288
- EXAMPLES_GUI_HELP = (
289
- """### The following examples perform specific tasks:
290
- 1. Generation with SDXL and upscale
291
- 2. Generation with FLUX dev
292
- 3. ControlNet Canny SDXL
293
- 4. Optical pattern (Optical illusion) SDXL
294
- 5. Convert an image to a coloring drawing
295
- 6. ControlNet OpenPose SD 1.5 and Latent upscale
296
-
297
- - 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.
298
- """
299
- )
300
-
301
- EXAMPLES_GUI = [
302
- [
303
- "1girl, souryuu asuka langley, neon genesis evangelion, rebuild of evangelion, lance of longinus, cat hat, plugsuit, pilot suit, red bodysuit, sitting, crossed legs, black eye patch, throne, looking down, from bottom, looking at viewer, outdoors, (masterpiece), (best quality), (ultra-detailed), very aesthetic, illustration, disheveled hair, perfect composition, moist skin, intricate details",
304
- "nfsw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, unfinished, very displeasing, oldest, early, chromatic aberration, artistic error, scan, abstract",
305
- 28,
306
- 7.0,
307
- -1,
308
- "None",
309
- 0.33,
310
- "Euler a",
311
- 1152,
312
- 896,
313
- "cagliostrolab/animagine-xl-3.1",
314
- "txt2img",
315
- "image.webp", # img conttol
316
- 1024, # img resolution
317
- 0.35, # strength
318
- 1.0, # cn scale
319
- 0.0, # cn start
320
- 1.0, # cn end
321
- "Classic",
322
- "Nearest",
323
- 45,
324
- False,
325
- ],
326
- [
327
- "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",
328
- "",
329
- 24,
330
- 3.5,
331
- -1,
332
- "None",
333
- 0.33,
334
- "Euler a",
335
- 1152,
336
- 896,
337
- "black-forest-labs/FLUX.1-dev",
338
- "txt2img",
339
- None, # img conttol
340
- 1024, # img resolution
341
- 0.35, # strength
342
- 1.0, # cn scale
343
- 0.0, # cn start
344
- 1.0, # cn end
345
- "Classic",
346
- None,
347
- 70,
348
- True,
349
- ],
350
- [
351
- "((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",
352
- "(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",
353
- 48,
354
- 3.5,
355
- -1,
356
- "None",
357
- 0.33,
358
- "DPM++ 2M SDE Lu",
359
- 1024,
360
- 1024,
361
- "misri/epicrealismXL_v7FinalDestination",
362
- "canny ControlNet",
363
- "image.webp", # img conttol
364
- 1024, # img resolution
365
- 0.35, # strength
366
- 1.0, # cn scale
367
- 0.0, # cn start
368
- 1.0, # cn end
369
- "Classic",
370
- None,
371
- 44,
372
- False,
373
- ],
374
- [
375
- "cinematic scenery old city ruins",
376
- "(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)",
377
- 50,
378
- 4.0,
379
- -1,
380
- "None",
381
- 0.33,
382
- "Euler a",
383
- 1024,
384
- 1024,
385
- "misri/juggernautXL_juggernautX",
386
- "optical pattern ControlNet",
387
- "spiral_no_transparent.png", # img conttol
388
- 1024, # img resolution
389
- 0.35, # strength
390
- 1.0, # cn scale
391
- 0.05, # cn start
392
- 0.75, # cn end
393
- "Classic",
394
- None,
395
- 35,
396
- False,
397
- ],
398
- [
399
- "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",
400
- "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",
401
- 20,
402
- 4.0,
403
- -1,
404
- "loras/Coloring_book_-_LineArt.safetensors",
405
- 1.0,
406
- "DPM++ 2M SDE Karras",
407
- 1024,
408
- 1024,
409
- "cagliostrolab/animagine-xl-3.1",
410
- "lineart ControlNet",
411
- "color_image.png", # img conttol
412
- 896, # img resolution
413
- 0.35, # strength
414
- 1.0, # cn scale
415
- 0.0, # cn start
416
- 1.0, # cn end
417
- "Compel",
418
- None,
419
- 35,
420
- False,
421
- ],
422
- [
423
- "1girl,face,curly hair,red hair,white background,",
424
- "(worst quality:2),(low quality:2),(normal quality:2),lowres,watermark,",
425
- 38,
426
- 5.0,
427
- -1,
428
- "None",
429
- 0.33,
430
- "DPM++ 2M SDE Karras",
431
- 512,
432
- 512,
433
- "digiplay/majicMIX_realistic_v7",
434
- "openpose ControlNet",
435
- "image.webp", # img conttol
436
- 1024, # img resolution
437
- 0.35, # strength
438
- 1.0, # cn scale
439
- 0.0, # cn start
440
- 0.9, # cn end
441
- "Compel",
442
- "Latent (antialiased)",
443
- 46,
444
- False,
445
- ],
446
- ]
447
-
448
- RESOURCES = (
449
- """### Resources
450
- - John6666's space has some great features you might find helpful [link](https://huggingface.co/spaces/John6666/DiffuseCraftMod).
451
- - You can also try the image generator in Colab’s free tier, which provides free GPU [link](https://github.com/R3gm/SD_diffusers_interactive).
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
+ )
dc.py CHANGED
@@ -1,6 +1,11 @@
1
  import spaces
2
  import os
3
- from stablepy import Model_Diffusers
 
 
 
 
 
4
  from constants import (
5
  PREPROCESSOR_CONTROLNET,
6
  TASK_STABLEPY,
@@ -33,6 +38,7 @@ from utils import (
33
  download_diffuser_repo,
34
  progress_step_bar,
35
  html_template_message,
 
36
  )
37
  from datetime import datetime
38
  import gradio as gr
@@ -109,6 +115,7 @@ model_list = load_diffusers_format_model + model_list
109
  ## BEGIN MOD
110
  lora_model_list = get_lora_model_list()
111
  vae_model_list = get_model_list(DIRECTORY_VAES)
 
112
  vae_model_list.insert(0, "None")
113
 
114
  #download_private_repo(HF_SDXL_EMBEDS_NEGATIVE_PRIVATE_REPO, DIRECTORY_EMBEDS_SDXL, False)
@@ -168,7 +175,12 @@ class GuiSD:
168
 
169
  yield f"Loading model: {model_name}"
170
 
171
- if vae_model:
 
 
 
 
 
172
  vae_type = "SDXL" if "sdxl" in vae_model.lower() else "SD 1.5"
173
  if model_type != vae_type:
174
  gr.Warning(WARNING_MSG_VAE)
@@ -241,6 +253,8 @@ class GuiSD:
241
  lora5,
242
  lora_scale5,
243
  sampler,
 
 
244
  img_height,
245
  img_width,
246
  model_name,
@@ -280,6 +294,7 @@ class GuiSD:
280
  image_previews,
281
  display_images,
282
  save_generated_images,
 
283
  image_storage_location,
284
  retain_compel_previous_load,
285
  retain_detailfix_model_previous_load,
@@ -356,14 +371,15 @@ class GuiSD:
356
  (image_ip2, mask_ip2, model_ip2, mode_ip2, scale_ip2),
357
  ]
358
 
359
- for imgip, mskip, modelip, modeip, scaleip in all_adapters:
360
- if imgip:
361
- params_ip_img.append(imgip)
362
- if mskip:
363
- params_ip_msk.append(mskip)
364
- params_ip_model.append(modelip)
365
- params_ip_mode.append(modeip)
366
- params_ip_scale.append(scaleip)
 
367
 
368
  concurrency = 5
369
  self.model.stream_config(concurrency=concurrency, latent_resize_by=1, vae_decoding=False)
@@ -454,6 +470,8 @@ class GuiSD:
454
  ## END MOD
455
  "syntax_weights": syntax_weights, # "Classic"
456
  "sampler": sampler,
 
 
457
  "xformers_memory_efficient_attention": xformers_memory_efficient_attention,
458
  "gui_active": True,
459
  "loop_generation": loop_generation,
@@ -471,6 +489,7 @@ class GuiSD:
471
  "image_previews": image_previews,
472
  "display_images": display_images,
473
  "save_generated_images": save_generated_images,
 
474
  "image_storage_location": image_storage_location,
475
  "retain_compel_previous_load": retain_compel_previous_load,
476
  "retain_detailfix_model_previous_load": retain_detailfix_model_previous_load,
@@ -505,7 +524,7 @@ class GuiSD:
505
 
506
  actual_progress = 0
507
  info_images = gr.update()
508
- for img, seed, image_path, metadata in self.model(**pipe_params):
509
  info_state = progress_step_bar(actual_progress, steps)
510
  actual_progress += concurrency
511
  if image_path:
@@ -527,7 +546,7 @@ class GuiSD:
527
  if msg_lora:
528
  info_images += msg_lora
529
 
530
- info_images = info_images + "<br>" + "GENERATION DATA:<br>" + metadata[0].replace("\n", "<br>") + "<br>-------<br>"
531
 
532
  download_links = "<br>".join(
533
  [
@@ -591,6 +610,14 @@ def sd_gen_generate_pipeline(*args):
591
  )
592
  print(lora_status)
593
 
 
 
 
 
 
 
 
 
594
  if verbose_arg:
595
  for status, lora in zip(lora_status, lora_list):
596
  if status:
@@ -675,7 +702,7 @@ from modutils import (safe_float, escape_lora_basename, to_lora_key, to_lora_pat
675
  def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps,
676
  model_name = load_diffusers_format_model[0], lora1 = None, lora1_wt = 1.0, lora2 = None, lora2_wt = 1.0,
677
  lora3 = None, lora3_wt = 1.0, lora4 = None, lora4_wt = 1.0, lora5 = None, lora5_wt = 1.0,
678
- sampler = "Euler a", vae = None, translate=True, progress=gr.Progress(track_tqdm=True)):
679
  import PIL
680
  import numpy as np
681
  MAX_SEED = np.iinfo(np.int32).max
@@ -684,6 +711,9 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
684
  load_lora_cpu = False
685
  verbose_info = False
686
  gpu_duration = 59
 
 
 
687
 
688
  images: list[tuple[PIL.Image.Image, str | None]] = []
689
  progress(0, desc="Preparing...")
@@ -715,11 +745,11 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
715
  progress(0, desc="Starting Inference...")
716
  for info_state, stream_images, info_images in sd_gen_generate_pipeline(prompt, negative_prompt, 1, num_inference_steps,
717
  guidance_scale, True, generator, lora1, lora1_wt, lora2, lora2_wt, lora3, lora3_wt,
718
- lora4, lora4_wt, lora5, lora5_wt, sampler,
719
  height, width, model_name, vae, TASK_MODEL_LIST[0], None, "Canny", 512, 1024,
720
  None, None, None, 0.35, 100, 200, 0.1, 0.1, 1.0, 0., 1., False, "Classic", None,
721
  1.0, 100, 10, 30, 0.55, "Use same sampler", "", "",
722
- False, True, 1, True, False, image_previews, False, False, "./images", False, False, False, True, 1, 0.55,
723
  False, False, False, True, False, "Use same sampler", False, "", "", 0.35, True, True, False, 4, 4, 32,
724
  False, "", "", 0.35, True, True, False, 4, 4, 32,
725
  True, None, None, "plus_face", "original", 0.7, None, None, "base", "style", 0.7, 0.0,
 
1
  import spaces
2
  import os
3
+ from stablepy import (
4
+ Model_Diffusers,
5
+ SCHEDULE_TYPE_OPTIONS,
6
+ SCHEDULE_PREDICTION_TYPE_OPTIONS,
7
+ check_scheduler_compatibility,
8
+ )
9
  from constants import (
10
  PREPROCESSOR_CONTROLNET,
11
  TASK_STABLEPY,
 
38
  download_diffuser_repo,
39
  progress_step_bar,
40
  html_template_message,
41
+ escape_html,
42
  )
43
  from datetime import datetime
44
  import gradio as gr
 
115
  ## BEGIN MOD
116
  lora_model_list = get_lora_model_list()
117
  vae_model_list = get_model_list(DIRECTORY_VAES)
118
+ vae_model_list.insert(0, "BakedVAE")
119
  vae_model_list.insert(0, "None")
120
 
121
  #download_private_repo(HF_SDXL_EMBEDS_NEGATIVE_PRIVATE_REPO, DIRECTORY_EMBEDS_SDXL, False)
 
175
 
176
  yield f"Loading model: {model_name}"
177
 
178
+ if vae_model == "BakedVAE":
179
+ if not os.path.exists(model_name):
180
+ vae_model = model_name
181
+ else:
182
+ vae_model = None
183
+ elif vae_model:
184
  vae_type = "SDXL" if "sdxl" in vae_model.lower() else "SD 1.5"
185
  if model_type != vae_type:
186
  gr.Warning(WARNING_MSG_VAE)
 
253
  lora5,
254
  lora_scale5,
255
  sampler,
256
+ schedule_type,
257
+ schedule_prediction_type,
258
  img_height,
259
  img_width,
260
  model_name,
 
294
  image_previews,
295
  display_images,
296
  save_generated_images,
297
+ filename_pattern,
298
  image_storage_location,
299
  retain_compel_previous_load,
300
  retain_detailfix_model_previous_load,
 
371
  (image_ip2, mask_ip2, model_ip2, mode_ip2, scale_ip2),
372
  ]
373
 
374
+ if not hasattr(self.model.pipe, "transformer"):
375
+ for imgip, mskip, modelip, modeip, scaleip in all_adapters:
376
+ if imgip:
377
+ params_ip_img.append(imgip)
378
+ if mskip:
379
+ params_ip_msk.append(mskip)
380
+ params_ip_model.append(modelip)
381
+ params_ip_mode.append(modeip)
382
+ params_ip_scale.append(scaleip)
383
 
384
  concurrency = 5
385
  self.model.stream_config(concurrency=concurrency, latent_resize_by=1, vae_decoding=False)
 
470
  ## END MOD
471
  "syntax_weights": syntax_weights, # "Classic"
472
  "sampler": sampler,
473
+ "schedule_type": schedule_type,
474
+ "schedule_prediction_type": schedule_prediction_type,
475
  "xformers_memory_efficient_attention": xformers_memory_efficient_attention,
476
  "gui_active": True,
477
  "loop_generation": loop_generation,
 
489
  "image_previews": image_previews,
490
  "display_images": display_images,
491
  "save_generated_images": save_generated_images,
492
+ "filename_pattern": filename_pattern,
493
  "image_storage_location": image_storage_location,
494
  "retain_compel_previous_load": retain_compel_previous_load,
495
  "retain_detailfix_model_previous_load": retain_detailfix_model_previous_load,
 
524
 
525
  actual_progress = 0
526
  info_images = gr.update()
527
+ for img, [seed, image_path, metadata] in self.model(**pipe_params):
528
  info_state = progress_step_bar(actual_progress, steps)
529
  actual_progress += concurrency
530
  if image_path:
 
546
  if msg_lora:
547
  info_images += msg_lora
548
 
549
+ info_images = info_images + "<br>" + "GENERATION DATA:<br>" + escape_html(metadata[0]) + "<br>-------<br>"
550
 
551
  download_links = "<br>".join(
552
  [
 
610
  )
611
  print(lora_status)
612
 
613
+ sampler_name = args[17]
614
+ schedule_type_name = args[18]
615
+ _, _, msg_sampler = check_scheduler_compatibility(
616
+ sd_gen.model.class_name, sampler_name, schedule_type_name
617
+ )
618
+ if msg_sampler:
619
+ gr.Warning(msg_sampler)
620
+
621
  if verbose_arg:
622
  for status, lora in zip(lora_status, lora_list):
623
  if status:
 
702
  def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps,
703
  model_name = load_diffusers_format_model[0], lora1 = None, lora1_wt = 1.0, lora2 = None, lora2_wt = 1.0,
704
  lora3 = None, lora3_wt = 1.0, lora4 = None, lora4_wt = 1.0, lora5 = None, lora5_wt = 1.0,
705
+ sampler = "Euler", vae = None, translate=True, progress=gr.Progress(track_tqdm=True)):
706
  import PIL
707
  import numpy as np
708
  MAX_SEED = np.iinfo(np.int32).max
 
711
  load_lora_cpu = False
712
  verbose_info = False
713
  gpu_duration = 59
714
+ schedule_type = SCHEDULE_TYPE_OPTIONS[0]
715
+ schedule_prediction_type = SCHEDULE_PREDICTION_TYPE_OPTIONS[0]
716
+ filename_pattern = "model,seed"
717
 
718
  images: list[tuple[PIL.Image.Image, str | None]] = []
719
  progress(0, desc="Preparing...")
 
745
  progress(0, desc="Starting Inference...")
746
  for info_state, stream_images, info_images in sd_gen_generate_pipeline(prompt, negative_prompt, 1, num_inference_steps,
747
  guidance_scale, True, generator, lora1, lora1_wt, lora2, lora2_wt, lora3, lora3_wt,
748
+ lora4, lora4_wt, lora5, lora5_wt, sampler, schedule_type, schedule_prediction_type,
749
  height, width, model_name, vae, TASK_MODEL_LIST[0], None, "Canny", 512, 1024,
750
  None, None, None, 0.35, 100, 200, 0.1, 0.1, 1.0, 0., 1., False, "Classic", None,
751
  1.0, 100, 10, 30, 0.55, "Use same sampler", "", "",
752
+ False, True, 1, True, False, image_previews, False, False, filename_pattern, "./images", False, False, False, True, 1, 0.55,
753
  False, False, False, True, False, "Use same sampler", False, "", "", 0.35, True, True, False, 4, 4, 32,
754
  False, "", "", 0.35, True, True, False, 4, 4, 32,
755
  True, None, None, "plus_face", "original", 0.7, None, None, "base", "style", 0.7, 0.0,
env.py CHANGED
@@ -39,21 +39,34 @@ LOAD_DIFFUSERS_FORMAT_MODEL = [
39
  'votepurchase/juggernautXL_hyper_8step_sfw',
40
  'votepurchase/ponyRealism_v21MainVAE',
41
  'stabilityai/stable-diffusion-xl-base-1.0',
 
42
  'John6666/blue-pencil-flux1-v021-fp8-flux',
43
  'John6666/wai-ani-flux-v10forfp8-fp8-flux',
44
  'John6666/xe-anime-flux-v04-fp8-flux',
45
  'John6666/lyh-anime-flux-v2a1-fp8-flux',
46
  'John6666/carnival-unchained-v10-fp8-flux',
47
- 'cagliostrolab/animagine-xl-3.1',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  'John6666/epicrealism-xl-v8kiss-sdxl',
49
- 'misri/epicrealismXL_v7FinalDestination',
50
- 'misri/juggernautXL_juggernautX',
51
  'misri/zavychromaxl_v80',
52
  'SG161222/RealVisXL_V4.0',
53
  'SG161222/RealVisXL_V5.0',
54
  'misri/newrealityxlAllInOne_Newreality40',
55
- 'eienmojiki/Anything-XL',
56
- 'eienmojiki/Starry-XL-v5.2',
57
  'gsdf/CounterfeitXL',
58
  'John6666/silvermoon-mix-01xl-v11-sdxl',
59
  'WhiteAiZ/autismmixSDXL_autismmixConfetti_diffusers',
@@ -72,17 +85,24 @@ LOAD_DIFFUSERS_FORMAT_MODEL = [
72
  'John6666/wai-real-mix-v11-sdxl',
73
  'John6666/wai-c-v6-sdxl',
74
  'John6666/iniverse-mix-xl-sfwnsfw-pony-guofeng-v43-sdxl',
 
75
  'John6666/photo-realistic-pony-v5-sdxl',
76
  'John6666/pony-realism-v21main-sdxl',
77
  'John6666/pony-realism-v22main-sdxl',
78
  'John6666/cyberrealistic-pony-v63-sdxl',
79
  'John6666/cyberrealistic-pony-v64-sdxl',
 
80
  'GraydientPlatformAPI/realcartoon-pony-diffusion',
81
  'John6666/nova-anime-xl-pony-v5-sdxl',
82
  'John6666/autismmix-sdxl-autismmix-pony-sdxl',
83
  'John6666/aimz-dream-real-pony-mix-v3-sdxl',
84
  'John6666/duchaiten-pony-real-v11fix-sdxl',
85
  'John6666/duchaiten-pony-real-v20-sdxl',
 
 
 
 
 
86
  'yodayo-ai/kivotos-xl-2.0',
87
  'yodayo-ai/holodayo-xl-2.1',
88
  'yodayo-ai/clandestine-xl-1.0',
@@ -109,16 +129,19 @@ LOAD_DIFFUSERS_FORMAT_MODEL = [
109
  'GraydientPlatformAPI/realcartoon3d-17',
110
  'GraydientPlatformAPI/realcartoon-pixar11',
111
  'GraydientPlatformAPI/realcartoon-real17',
 
112
  'KBlueLeaf/Kohaku-XL-Epsilon-rev2',
113
  'KBlueLeaf/Kohaku-XL-Epsilon-rev3',
114
  'KBlueLeaf/Kohaku-XL-Zeta',
115
- 'kayfahaarukku/UrangDiffusion-1.4',
 
116
  'Eugeoter/artiwaifu-diffusion-2.0',
117
  'comin/IterComp',
118
  'OnomaAIResearch/Illustrious-xl-early-release-v0',
119
  'Raelina/Rae-Diffusion-XL-V2',
120
  'Raelina/Raemu-XL-V4',
121
  'Raelina/Raehoshi-illust-XL',
 
122
  "camenduru/FLUX.1-dev-diffusers",
123
  "black-forest-labs/FLUX.1-schnell",
124
  "sayakpaul/FLUX.1-merged",
 
39
  'votepurchase/juggernautXL_hyper_8step_sfw',
40
  'votepurchase/ponyRealism_v21MainVAE',
41
  'stabilityai/stable-diffusion-xl-base-1.0',
42
+ 'black-forest-labs/FLUX.1-dev',
43
  'John6666/blue-pencil-flux1-v021-fp8-flux',
44
  'John6666/wai-ani-flux-v10forfp8-fp8-flux',
45
  'John6666/xe-anime-flux-v04-fp8-flux',
46
  'John6666/lyh-anime-flux-v2a1-fp8-flux',
47
  'John6666/carnival-unchained-v10-fp8-flux',
48
+ 'Freepik/flux.1-lite-8B-alpha',
49
+ 'ostris/OpenFLUX.1',
50
+ 'John6666/noobai-xl-nai-xl-epsilonpred10version-sdxl',
51
+ 'John6666/noobai-xl-nai-xl-epsilonpred075version-sdxl',
52
+ 'John6666/noobai-xl-nai-xl-epsilonpred05version-sdxl',
53
+ 'John6666/noobai-cyberfix-v10-sdxl',
54
+ 'John6666/noobaiiter-xl-vpred-v075-sdxl',
55
+ 'John6666/complicated-noobai-merge-vprediction-sdxl',
56
+ 'John6666/noobai-fusion2-vpred-itercomp-v1-sdxl',
57
+ 'John6666/noobai-xl-nai-xl-vpredtestversion-sdxl',
58
+ 'John6666/chadmix-noobai075-illustrious01-v10-sdxl',
59
+ 'OnomaAIResearch/Illustrious-xl-early-release-v0',
60
+ 'John6666/obsession-illustriousxl-v21-sdxl',
61
+ 'eienmojiki/Anything-XL',
62
+ 'eienmojiki/Starry-XL-v5.2',
63
+ 'John6666/meinaxl-v2-sdxl',
64
+ 'John6666/epicrealism-xl-v10kiss2-sdxl',
65
  'John6666/epicrealism-xl-v8kiss-sdxl',
 
 
66
  'misri/zavychromaxl_v80',
67
  'SG161222/RealVisXL_V4.0',
68
  'SG161222/RealVisXL_V5.0',
69
  'misri/newrealityxlAllInOne_Newreality40',
 
 
70
  'gsdf/CounterfeitXL',
71
  'John6666/silvermoon-mix-01xl-v11-sdxl',
72
  'WhiteAiZ/autismmixSDXL_autismmixConfetti_diffusers',
 
85
  'John6666/wai-real-mix-v11-sdxl',
86
  'John6666/wai-c-v6-sdxl',
87
  'John6666/iniverse-mix-xl-sfwnsfw-pony-guofeng-v43-sdxl',
88
+ 'John6666/sifw-annihilation-xl-v2-sdxl',
89
  'John6666/photo-realistic-pony-v5-sdxl',
90
  'John6666/pony-realism-v21main-sdxl',
91
  'John6666/pony-realism-v22main-sdxl',
92
  'John6666/cyberrealistic-pony-v63-sdxl',
93
  'John6666/cyberrealistic-pony-v64-sdxl',
94
+ 'John6666/cyberrealistic-pony-v65-sdxl',
95
  'GraydientPlatformAPI/realcartoon-pony-diffusion',
96
  'John6666/nova-anime-xl-pony-v5-sdxl',
97
  'John6666/autismmix-sdxl-autismmix-pony-sdxl',
98
  'John6666/aimz-dream-real-pony-mix-v3-sdxl',
99
  'John6666/duchaiten-pony-real-v11fix-sdxl',
100
  'John6666/duchaiten-pony-real-v20-sdxl',
101
+ 'John6666/duchaiten-pony-xl-no-score-v70-sdxl',
102
+ 'Eugeoter/artiwaifu-diffusion-2.0',
103
+ 'comin/IterComp',
104
+ 'KBlueLeaf/Kohaku-XL-Zeta',
105
+ 'cagliostrolab/animagine-xl-3.1',
106
  'yodayo-ai/kivotos-xl-2.0',
107
  'yodayo-ai/holodayo-xl-2.1',
108
  'yodayo-ai/clandestine-xl-1.0',
 
129
  'GraydientPlatformAPI/realcartoon3d-17',
130
  'GraydientPlatformAPI/realcartoon-pixar11',
131
  'GraydientPlatformAPI/realcartoon-real17',
132
+ 'nitrosocke/Ghibli-Diffusion',
133
  'KBlueLeaf/Kohaku-XL-Epsilon-rev2',
134
  'KBlueLeaf/Kohaku-XL-Epsilon-rev3',
135
  'KBlueLeaf/Kohaku-XL-Zeta',
136
+ 'kayfahaarukku/UrangDiffusion-2.0',
137
+ 'kayfahaarukku/irAsu-1.0',
138
  'Eugeoter/artiwaifu-diffusion-2.0',
139
  'comin/IterComp',
140
  'OnomaAIResearch/Illustrious-xl-early-release-v0',
141
  'Raelina/Rae-Diffusion-XL-V2',
142
  'Raelina/Raemu-XL-V4',
143
  'Raelina/Raehoshi-illust-XL',
144
+ 'Raelina/Raehoshi-illust-xl-2',
145
  "camenduru/FLUX.1-dev-diffusers",
146
  "black-forest-labs/FLUX.1-schnell",
147
  "sayakpaul/FLUX.1-merged",
requirements.txt CHANGED
@@ -4,7 +4,7 @@ diffusers
4
  invisible_watermark
5
  transformers
6
  xformers
7
- git+https://github.com/R3gm/stablepy.git@flux_beta
8
  torch==2.2.0
9
  gdown
10
  opencv-python
 
4
  invisible_watermark
5
  transformers
6
  xformers
7
+ git+https://github.com/R3gm/stablepy.git@1bb7400 # -b refactor_sampler_fix
8
  torch==2.2.0
9
  gdown
10
  opencv-python
utils.py CHANGED
@@ -232,9 +232,9 @@ def extract_parameters(input_string):
232
  parameters['height'] = height
233
 
234
  # Extracting other parameters
235
- other_parameters = re.findall(r'(\w+): (.*?)(?=, \w+|$)', input_string)
236
  for param in other_parameters:
237
- parameters[param[0]] = param[1].strip('"')
238
 
239
  return parameters
240
 
@@ -419,3 +419,8 @@ def html_template_message(msg):
419
  </div>
420
  </div>
421
  """
 
 
 
 
 
 
232
  parameters['height'] = height
233
 
234
  # Extracting other parameters
235
+ other_parameters = re.findall(r'([^,:]+): (.*?)(?=, [^,:]+:|$)', input_string)
236
  for param in other_parameters:
237
+ parameters[param[0].strip()] = param[1].strip('"')
238
 
239
  return parameters
240
 
 
419
  </div>
420
  </div>
421
  """
422
+
423
+
424
+ def escape_html(text):
425
+ """Escapes HTML special characters in the input text."""
426
+ return text.replace("<", "&lt;").replace(">", "&gt;").replace("\n", "<br>")