John6666 commited on
Commit
e6e361c
1 Parent(s): 81ebe98

Upload 8 files

Browse files
Files changed (8) hide show
  1. app.py +10 -6
  2. constants.py +471 -453
  3. dc.py +51 -24
  4. env.py +29 -6
  5. lora_dict.json +161 -0
  6. modutils.py +20 -20
  7. requirements.txt +1 -1
  8. utils.py +7 -2
app.py CHANGED
@@ -7,7 +7,8 @@ from dc import (infer, _infer, pass_result, get_diffusers_model_list, get_sample
7
  get_vaes, enable_model_recom_prompt, enable_diffusers_model_detail, extract_exif_data, esrgan_upscale, UPSCALER_KEYS,
8
  preset_quality, preset_styles, process_style_prompt, get_all_lora_tupled_list, update_loras, apply_lora_prompt,
9
  download_my_lora, search_civitai_lora, update_civitai_selection, select_civitai_lora, search_civitai_lora_json,
10
- get_t2i_model_info, get_civitai_tag, CIVITAI_SORT, CIVITAI_PERIOD, CIVITAI_BASEMODEL)
 
11
  # Translator
12
  from llmdolphin import (dolphin_respond_auto, dolphin_parse_simple,
13
  get_llm_formats, get_dolphin_model_format, get_dolphin_models,
@@ -91,7 +92,9 @@ 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):
@@ -161,7 +164,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():
@@ -200,7 +203,7 @@ with gr.Blocks(fill_width=True, elem_id="container", css=css, delete_cache=(60,
200
  inputs=[prompt, negative_prompt, seed, randomize_seed, width, height,
201
  guidance_scale, num_inference_steps, model_name,
202
  lora1, lora1_wt, lora2, lora2_wt, lora3, lora3_wt, lora4, lora4_wt, lora5, lora5_wt,
203
- sampler, vae_model, auto_trans],
204
  outputs=[result],
205
  queue=True,
206
  show_progress="full",
@@ -213,7 +216,7 @@ with gr.Blocks(fill_width=True, elem_id="container", css=css, delete_cache=(60,
213
  inputs=[prompt, negative_prompt, seed, randomize_seed, width, height,
214
  guidance_scale, num_inference_steps, model_name,
215
  lora1, lora1_wt, lora2, lora2_wt, lora3, lora3_wt, lora4, lora4_wt, lora5, lora5_wt,
216
- sampler, vae_model, auto_trans],
217
  outputs=[result],
218
  queue=False,
219
  show_api=True,
@@ -236,7 +239,7 @@ with gr.Blocks(fill_width=True, elem_id="container", css=css, delete_cache=(60,
236
  inputs=[prompt, negative_prompt, seed, randomize_seed, width, height,
237
  guidance_scale, num_inference_steps, model_name,
238
  lora1, lora1_wt, lora2, lora2_wt, lora3, lora3_wt, lora4, lora4_wt, lora5, lora5_wt,
239
- sampler, vae_model],
240
  outputs=[result],
241
  queue=True,
242
  show_progress="full",
@@ -294,6 +297,7 @@ with gr.Blocks(fill_width=True, elem_id="container", css=css, delete_cache=(60,
294
  outputs=[prompt, negative_prompt],
295
  queue=False,
296
  trigger_mode="once",
 
297
  )
298
 
299
  model_detail.change(enable_diffusers_model_detail, [model_detail, model_name], [model_detail, model_name], queue=False, show_api=False)
 
7
  get_vaes, enable_model_recom_prompt, enable_diffusers_model_detail, extract_exif_data, esrgan_upscale, UPSCALER_KEYS,
8
  preset_quality, preset_styles, process_style_prompt, get_all_lora_tupled_list, update_loras, apply_lora_prompt,
9
  download_my_lora, search_civitai_lora, update_civitai_selection, select_civitai_lora, search_civitai_lora_json,
10
+ get_t2i_model_info, get_civitai_tag, CIVITAI_SORT, CIVITAI_PERIOD, CIVITAI_BASEMODEL,
11
+ SCHEDULE_TYPE_OPTIONS, SCHEDULE_PREDICTION_TYPE_OPTIONS)
12
  # Translator
13
  from llmdolphin import (dolphin_respond_auto, dolphin_parse_simple,
14
  get_llm_formats, get_dolphin_model_format, get_dolphin_models,
 
92
  model_detail = gr.Checkbox(label="Show detail of model in list", value=False)
93
 
94
  with gr.Row():
95
+ sampler = gr.Dropdown(label="Sampler", choices=get_samplers(), value="Euler")
96
+ schedule_type = gr.Dropdown(label="Schedule type", choices=SCHEDULE_TYPE_OPTIONS, value=SCHEDULE_TYPE_OPTIONS[0])
97
+ schedule_prediction_type = gr.Dropdown(label="Discrete Sampling Type", choices=SCHEDULE_PREDICTION_TYPE_OPTIONS, value=SCHEDULE_PREDICTION_TYPE_OPTIONS[0])
98
  vae_model = gr.Dropdown(label="VAE Model", choices=get_vaes(), value=get_vaes()[0])
99
 
100
  with gr.Accordion("LoRA", open=True, visible=True):
 
164
  with gr.Accordion("Select from Gallery", open=False):
165
  lora_search_civitai_gallery = gr.Gallery([], label="Results", allow_preview=False, columns=5, show_share_button=False, interactive=False)
166
  lora_search_civitai_result = gr.Dropdown(label="Search Results", choices=[("", "")], value="", allow_custom_value=True, visible=False)
167
+ lora_download_url = gr.Textbox(label="LoRA's download 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)
168
  lora_download = gr.Button("Get and set LoRA and apply to prompt")
169
 
170
  with gr.Row():
 
203
  inputs=[prompt, negative_prompt, seed, randomize_seed, width, height,
204
  guidance_scale, num_inference_steps, model_name,
205
  lora1, lora1_wt, lora2, lora2_wt, lora3, lora3_wt, lora4, lora4_wt, lora5, lora5_wt,
206
+ sampler, vae_model, auto_trans, schedule_type, schedule_prediction_type],
207
  outputs=[result],
208
  queue=True,
209
  show_progress="full",
 
216
  inputs=[prompt, negative_prompt, seed, randomize_seed, width, height,
217
  guidance_scale, num_inference_steps, model_name,
218
  lora1, lora1_wt, lora2, lora2_wt, lora3, lora3_wt, lora4, lora4_wt, lora5, lora5_wt,
219
+ sampler, vae_model, auto_trans, schedule_type, schedule_prediction_type],
220
  outputs=[result],
221
  queue=False,
222
  show_api=True,
 
239
  inputs=[prompt, negative_prompt, seed, randomize_seed, width, height,
240
  guidance_scale, num_inference_steps, model_name,
241
  lora1, lora1_wt, lora2, lora2_wt, lora3, lora3_wt, lora4, lora4_wt, lora5, lora5_wt,
242
+ sampler, vae_model, auto_trans, schedule_type, schedule_prediction_type],
243
  outputs=[result],
244
  queue=True,
245
  show_progress="full",
 
297
  outputs=[prompt, negative_prompt],
298
  queue=False,
299
  trigger_mode="once",
300
+ show_api=False,
301
  )
302
 
303
  model_detail.change(enable_diffusers_model_detail, [model_detail, model_name], [model_detail, model_name], queue=False, show_api=False)
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:
@@ -663,27 +690,30 @@ sd_gen = GuiSD()
663
 
664
  from pathlib import Path
665
  from PIL import Image
666
- import random, json
 
 
 
 
667
  from modutils import (safe_float, escape_lora_basename, to_lora_key, to_lora_path,
668
  get_local_model_list, get_private_lora_model_lists, get_valid_lora_name,
669
  get_valid_lora_path, get_valid_lora_wt, get_lora_info, CIVITAI_SORT, CIVITAI_PERIOD, CIVITAI_BASEMODEL,
670
  normalize_prompt_list, get_civitai_info, search_lora_on_civitai, translate_to_en, get_t2i_model_info, get_civitai_tag, save_image_history)
671
 
672
 
673
-
674
  #@spaces.GPU
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
682
 
683
  image_previews = True
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,
@@ -736,8 +766,6 @@ def __infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidan
736
  model_name = load_diffusers_format_model[0], lora1 = None, lora1_wt = 1.0, lora2 = None, lora2_wt = 1.0,
737
  lora3 = None, lora3_wt = 1.0, lora4 = None, lora4_wt = 1.0, lora5 = None, lora5_wt = 1.0,
738
  sampler = "Euler a", vae = None, translate=True, progress=gr.Progress(track_tqdm=True)):
739
- import PIL
740
- import numpy as np
741
  MAX_SEED = np.iinfo(np.int32).max
742
 
743
  load_lora_cpu = False
@@ -794,7 +822,8 @@ def __infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidan
794
  def _infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps,
795
  model_name = load_diffusers_format_model[0], lora1 = None, lora1_wt = 1.0, lora2 = None, lora2_wt = 1.0,
796
  lora3 = None, lora3_wt = 1.0, lora4 = None, lora4_wt = 1.0, lora5 = None, lora5_wt = 1.0,
797
- sampler = "Euler a", vae = None, translate = True, progress=gr.Progress(track_tqdm=True)):
 
798
  return gr.update(visible=True)
799
 
800
 
@@ -838,7 +867,6 @@ def enable_diffusers_model_detail(is_enable: bool = False, model_name: str = "")
838
 
839
 
840
  def load_model_prompt_dict():
841
- import json
842
  dict = {}
843
  try:
844
  with open('model_dict.json', encoding='utf-8') as f:
@@ -975,7 +1003,6 @@ def download_lora(dl_urls: str):
975
 
976
 
977
  def copy_lora(path: str, new_path: str):
978
- import shutil
979
  if path == new_path: return new_path
980
  cpath = Path(path)
981
  npath = Path(new_path)
 
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:
 
690
 
691
  from pathlib import Path
692
  from PIL import Image
693
+ import PIL
694
+ import numpy as np
695
+ import random
696
+ import json
697
+ import shutil
698
  from modutils import (safe_float, escape_lora_basename, to_lora_key, to_lora_path,
699
  get_local_model_list, get_private_lora_model_lists, get_valid_lora_name,
700
  get_valid_lora_path, get_valid_lora_wt, get_lora_info, CIVITAI_SORT, CIVITAI_PERIOD, CIVITAI_BASEMODEL,
701
  normalize_prompt_list, get_civitai_info, search_lora_on_civitai, translate_to_en, get_t2i_model_info, get_civitai_tag, save_image_history)
702
 
703
 
 
704
  #@spaces.GPU
705
  def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps,
706
  model_name = load_diffusers_format_model[0], lora1 = None, lora1_wt = 1.0, lora2 = None, lora2_wt = 1.0,
707
  lora3 = None, lora3_wt = 1.0, lora4 = None, lora4_wt = 1.0, lora5 = None, lora5_wt = 1.0,
708
+ sampler = "Euler", vae = None, translate=True, schedule_type=SCHEDULE_TYPE_OPTIONS[0], schedule_prediction_type=SCHEDULE_PREDICTION_TYPE_OPTIONS[0],
709
+ progress=gr.Progress(track_tqdm=True)):
 
710
  MAX_SEED = np.iinfo(np.int32).max
711
 
712
  image_previews = True
713
  load_lora_cpu = False
714
  verbose_info = False
715
  gpu_duration = 59
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,
 
766
  model_name = load_diffusers_format_model[0], lora1 = None, lora1_wt = 1.0, lora2 = None, lora2_wt = 1.0,
767
  lora3 = None, lora3_wt = 1.0, lora4 = None, lora4_wt = 1.0, lora5 = None, lora5_wt = 1.0,
768
  sampler = "Euler a", vae = None, translate=True, progress=gr.Progress(track_tqdm=True)):
 
 
769
  MAX_SEED = np.iinfo(np.int32).max
770
 
771
  load_lora_cpu = False
 
822
  def _infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps,
823
  model_name = load_diffusers_format_model[0], lora1 = None, lora1_wt = 1.0, lora2 = None, lora2_wt = 1.0,
824
  lora3 = None, lora3_wt = 1.0, lora4 = None, lora4_wt = 1.0, lora5 = None, lora5_wt = 1.0,
825
+ sampler = "Euler", vae = None, translate = True, schedule_type=SCHEDULE_TYPE_OPTIONS[0], schedule_prediction_type=SCHEDULE_PREDICTION_TYPE_OPTIONS[0],
826
+ progress=gr.Progress(track_tqdm=True)):
827
  return gr.update(visible=True)
828
 
829
 
 
867
 
868
 
869
  def load_model_prompt_dict():
 
870
  dict = {}
871
  try:
872
  with open('model_dict.json', encoding='utf-8') as f:
 
1003
 
1004
 
1005
  def copy_lora(path: str, new_path: str):
 
1006
  if path == new_path: return new_path
1007
  cpath = Path(path)
1008
  npath = Path(new_path)
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",
lora_dict.json CHANGED
@@ -1273,6 +1273,13 @@
1273
  "https://civitai.com/models/517566",
1274
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/05585176-3473-4b64-89ff-6cb7209c0585/width=450/19516227.jpeg"
1275
  ],
 
 
 
 
 
 
 
1276
  "JAV_GTJ130_Pony_V1": [
1277
  "1girl, solo forcas, nude, Simple background, black background, depth of field, (vomiting), rope, bondage, arms behind back, spread legs, shibari, breast bondage, Crying, tears, cum, facial, cumdrip, sex, anal sex, 1 boy, hetero, large penis, large insertion, large penis, thick penis, vaginal, deepthroat, black bed , toilet, black mattress, crying, tears, / deepthroat,oral,Portrait, (close-up face), Crying, tears, cum, facial, cum in mouth, parted lips, cum string, saliva, cumdrip, forehead,cock in mouth / deepthroat,oral,cowboy shot, toilet, forehead, cock in mouth, Stringy drool, saliva / after fellatio, Portrait,(close-up mouth), tongue, foam, open mouth, (cum in mouth), tongue out, soap bubbles, crying, tears / sex, 2+boys, Multiple penises, nude,cum, bukkake, facial, oral, fellatio, lying, on back, rope, bondage, arms behind back, bound arms, bound wrists, open mouth, cum in mouth,on bed, hetero, kneeling, arched back, all fours / open mouth, hetero, multiple boys, facial, group sex, close-up mouth, sweat, multiple penises, tongue out, pee, peeing, Water Play / sex, 1boy, hetero, toilet, bound, rope, penis, spread legs, legs up, restrained, arms behind back, suspension, large insertion, large penis, thick penis / sex, 1boy, hetero, bed, rope, bdsm, bondage, bound, vaginal, spread legs, lying, asphyxiation, large insertion, large penis, thick penis / toilet, bdsm, bondage, bound, breasts, nipples, nude, rope, arms behind back, shibari, legs up, suspension, sitting, spread legs, spread_pussy, Urethral, close up pussy, detailed pussy, gaping pussy, detailed anus, gaping anus, pussy juice trail",
1278
  "Pony",
@@ -2960,6 +2967,13 @@
2960
  "https://civitai.com/models/569468",
2961
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/6eae53b1-37c8-478a-a3c9-5a6ecafccebe/width=450/19246209.jpeg"
2962
  ],
 
 
 
 
 
 
 
2963
  "apron_XL_V1_0": [
2964
  "apron / filrds",
2965
  "SDXL 1.0",
@@ -3779,6 +3793,13 @@
3779
  "https://civitai.com/models/633914",
3780
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/095ac00b-32f3-4c07-8afa-f95c5ac6a8fd/width=450/23473842.jpeg"
3781
  ],
 
 
 
 
 
 
 
3782
  "concept_wombwriting-pony-rls": [
3783
  "womb writing",
3784
  "Pony",
@@ -4003,6 +4024,13 @@
4003
  "https://civitai.com/models/628775",
4004
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/83566548-b845-4d8b-a0d0-be8cc8822a81/width=450/23142557.jpeg"
4005
  ],
 
 
 
 
 
 
 
4006
  "danmen_illustrious_V1_0": [
4007
  "danmen,penis,vaginal / uterus / x-ray / cross-section / internal cumshot",
4008
  "Illustrious",
@@ -4017,6 +4045,13 @@
4017
  "https://civitai.com/models/853101",
4018
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/9bbdb650-67f6-4b7a-b020-2f1b15363919/width=450/34507990.jpeg"
4019
  ],
 
 
 
 
 
 
 
4020
  "dawa": [
4021
  "dawa",
4022
  "SDXL 1.0",
@@ -4045,6 +4080,20 @@
4045
  "https://civitai.com/models/838545",
4046
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/4611cac5-7c02-484c-9937-a4b7fb5c3817/width=450/33675457.jpeg"
4047
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4048
  "deflowered_pony": [
4049
  "1woman, perfect face, fully nude, imminent penetration:1.4, deflowered:1.1, blood on thighs, blood dripping, semen, cum, overflow:1.2, / 1male, huge penis, large testicles, / female pubic hair, uncensored pussy, hairy pussy, blush / <lora:deflowered_pony:0.7>,",
4050
  "Pony",
@@ -4423,6 +4472,13 @@
4423
  "https://civitai.com/models/577378",
4424
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/459bd20d-a9d6-4a0b-8947-7dcebc061c0f/width=450/19781986.jpeg"
4425
  ],
 
 
 
 
 
 
 
4426
  "genbaneko_v4_illustrious_uo_1024-000040": [
4427
  "genbaneko / cat, headwear, hat, grey headwear, baseball cap, / speech bubble, speech text,",
4428
  "SDXL 1.0",
@@ -4563,6 +4619,13 @@
4563
  "https://civitai.com/models/32541",
4564
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/a02818c5-568b-4da2-a6f3-0c54f3fd604d/width=450/16910321.jpeg"
4565
  ],
 
 
 
 
 
 
 
4566
  "guided_penetration_pony_V1_0": [
4567
  "",
4568
  "Pony",
@@ -4871,6 +4934,13 @@
4871
  "https://civitai.com/models/498731",
4872
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/06a0dc3a-42ba-42b5-9ea9-d6b6faa3543b/width=450/14812284.jpeg"
4873
  ],
 
 
 
 
 
 
 
4874
  "hotarueye_xl_tareme1_v10": [
4875
  "",
4876
  "Pony",
@@ -5011,6 +5081,13 @@
5011
  "https://civitai.com/models/637685",
5012
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/94123112-87d5-43fb-9f06-06e621b237bc/width=450/23732178.jpeg"
5013
  ],
 
 
 
 
 
 
 
5014
  "infundibulum_insertion_pony_V1_0": [
5015
  "infundibulum insertion",
5016
  "Pony",
@@ -5648,6 +5725,13 @@
5648
  "https://civitai.com/models/488098",
5649
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/58767062-22a1-4f52-ac2e-7f01fae26908/width=450/14206684.jpeg"
5650
  ],
 
 
 
 
 
 
 
5651
  "manguri_Pony_V1_0": [
5652
  "manguri / legs up / folded / spread legs / upside-down / legs together / knee to chest",
5653
  "Pony",
@@ -6824,6 +6908,20 @@
6824
  "https://civitai.com/models/570003",
6825
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/100c8fcb-077b-4ef0-9bf3-41082f1ce453/width=450/19285744.jpeg"
6826
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6827
  "ribbon-trimmed_underwear_3-000010": [
6828
  "ribbon-trimmed bra / ribbon-trimmed panties",
6829
  "SD 1.5",
@@ -6852,6 +6950,13 @@
6852
  "https://civitai.com/models/554166",
6853
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/ac359acf-7294-4f2c-bf7f-708379deebdb/width=450/18275119.jpeg"
6854
  ],
 
 
 
 
 
 
 
6855
  "rouka_SDXL_V2": [
6856
  "rouka, hallway, window, scenery, school, reflective floor, indoors, door, reflection, building, tiles, tile floor, sunlight, day, ceiling light, realistic / rouka",
6857
  "SDXL 1.0",
@@ -7027,6 +7132,20 @@
7027
  "https://civitai.com/models/311263",
7028
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/27503dd2-9b3b-44d5-8f30-fd7a1be2668b/width=450/8190285.jpeg"
7029
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7030
  "sento": [
7031
  "sento",
7032
  "Pony",
@@ -7083,6 +7202,20 @@
7083
  "https://civitai.com/models/834937",
7084
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/a4fd210d-90db-4995-8868-482e597fe927/width=450/33459038.jpeg"
7085
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7086
  "shiReroVT1": [
7087
  "shirerocrazy, cross-eyed, tongue, cherry on tongue, saliva, tongue out, looking at viewer, open mouth, parody, cherry, ",
7088
  "Pony",
@@ -7230,6 +7363,13 @@
7230
  "https://civitai.com/models/574708",
7231
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/557c4224-c6c8-4b71-b6fe-adc82e552f25/width=450/19613178.jpeg"
7232
  ],
 
 
 
 
 
 
 
7233
  "soap_bubbles_pony_V1_0": [
7234
  "soap bubbles / soap",
7235
  "Pony",
@@ -7650,6 +7790,20 @@
7650
  "https://civitai.com/models/349716",
7651
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/dec948dc-ac1b-4918-90ac-fe35daaf6d63/width=450/7927405.jpeg"
7652
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7653
  "tears_XL_V1_0": [
7654
  "tears",
7655
  "SDXL 1.0",
@@ -7776,6 +7930,13 @@
7776
  "https://civitai.com/models/499436",
7777
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/8f4ac8a2-2034-4c53-9d20-fc2108840cf5/width=450/14855524.jpeg"
7778
  ],
 
 
 
 
 
 
 
7779
  "topanglexl16": [
7780
  "above / from above",
7781
  "SDXL 1.0",
 
1273
  "https://civitai.com/models/517566",
1274
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/05585176-3473-4b64-89ff-6cb7209c0585/width=450/19516227.jpeg"
1275
  ],
1276
+ "JAV_DDT636_643_Pony_V1": [
1277
+ "1girl, legs up, m legs, licking, slave, spread legs, wide spread legs, nude, abuse, crying, screaming, shiny skin, drooling, saliva, 2boys, mmf threesome, hetero, dirty, dildo, vibrator, oral, cunnilingus, bdsm, ankle cuffs , chain , bondage, bound, restrained, stationary restraints against wall, bound ankles, bound arms, bound legs, bound wrists, chained, / 1girl, legs up, m legs, licking, slave, spread legs, wide spread legs, nude, abuse, crying, ((screaming)), shiny skin, drooling, saliva, 2boys, mmf threesome, hetero, dirty, bdsm, ankle cuffs , chain , bondage, bound, restrained, stationary restraints against wall, bound ankles, bound arms, bound legs, bound wrists, chained, (pov:1.25), (sex), large insertion, large penis, thick penis, ",
1278
+ "Pony",
1279
+ "JAV HARD BDSM Generator (bondage wall ) Pony XL | \u62d8\u675f\u5c11\u5973\u5feb\u697d\u62f7\u554f \u30a2\u30c0\u30eb\u30c8 \u30d3\u30c7\u30aa \u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u30fc",
1280
+ "https://civitai.com/models/903161",
1281
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/46a8fa98-4746-4185-89d5-f50c4b87ae71/width=450/37421621.jpeg"
1282
+ ],
1283
  "JAV_GTJ130_Pony_V1": [
1284
  "1girl, solo forcas, nude, Simple background, black background, depth of field, (vomiting), rope, bondage, arms behind back, spread legs, shibari, breast bondage, Crying, tears, cum, facial, cumdrip, sex, anal sex, 1 boy, hetero, large penis, large insertion, large penis, thick penis, vaginal, deepthroat, black bed , toilet, black mattress, crying, tears, / deepthroat,oral,Portrait, (close-up face), Crying, tears, cum, facial, cum in mouth, parted lips, cum string, saliva, cumdrip, forehead,cock in mouth / deepthroat,oral,cowboy shot, toilet, forehead, cock in mouth, Stringy drool, saliva / after fellatio, Portrait,(close-up mouth), tongue, foam, open mouth, (cum in mouth), tongue out, soap bubbles, crying, tears / sex, 2+boys, Multiple penises, nude,cum, bukkake, facial, oral, fellatio, lying, on back, rope, bondage, arms behind back, bound arms, bound wrists, open mouth, cum in mouth,on bed, hetero, kneeling, arched back, all fours / open mouth, hetero, multiple boys, facial, group sex, close-up mouth, sweat, multiple penises, tongue out, pee, peeing, Water Play / sex, 1boy, hetero, toilet, bound, rope, penis, spread legs, legs up, restrained, arms behind back, suspension, large insertion, large penis, thick penis / sex, 1boy, hetero, bed, rope, bdsm, bondage, bound, vaginal, spread legs, lying, asphyxiation, large insertion, large penis, thick penis / toilet, bdsm, bondage, bound, breasts, nipples, nude, rope, arms behind back, shibari, legs up, suspension, sitting, spread legs, spread_pussy, Urethral, close up pussy, detailed pussy, gaping pussy, detailed anus, gaping anus, pussy juice trail",
1285
  "Pony",
 
2967
  "https://civitai.com/models/569468",
2968
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/6eae53b1-37c8-478a-a3c9-5a6ecafccebe/width=450/19246209.jpeg"
2969
  ],
2970
+ "anti25d_xl_v10": [
2971
+ "",
2972
+ "Pony",
2973
+ "[SDXL] Convert 2.5D to 2D / 2.5D\u21922D\u5909\u63db",
2974
+ "https://civitai.com/models/914453",
2975
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/e6487d07-0423-4a72-8817-72d81d489b8a/width=450/38108964.jpeg"
2976
+ ],
2977
  "apron_XL_V1_0": [
2978
  "apron / filrds",
2979
  "SDXL 1.0",
 
3793
  "https://civitai.com/models/633914",
3794
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/095ac00b-32f3-4c07-8afa-f95c5ac6a8fd/width=450/23473842.jpeg"
3795
  ],
3796
+ "competitive_Swimsuit_illustrious_V1_0": [
3797
+ " competitive swimsuit",
3798
+ "Illustrious",
3799
+ "\u7af6\u6cf3\u6c34\u7740/competitive swimsuit",
3800
+ "https://civitai.com/models/552104",
3801
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/e1cfe19c-df2b-4f7b-b1d0-23d1f5a457a7/width=450/38086508.jpeg"
3802
+ ],
3803
  "concept_wombwriting-pony-rls": [
3804
  "womb writing",
3805
  "Pony",
 
4024
  "https://civitai.com/models/628775",
4025
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/83566548-b845-4d8b-a0d0-be8cc8822a81/width=450/23142557.jpeg"
4026
  ],
4027
+ "danmen(double)_pony_V1_0": [
4028
+ "cross-section, rectum, uterus, cervix, x-ray, sex, penis, vaginal / dounble insertion",
4029
+ "Pony",
4030
+ "\u65ad\u9762\u56f3(\u4e8c\u7a74)/uterus(double insertion)",
4031
+ "https://civitai.com/models/889276",
4032
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/336a5b39-3981-4402-addf-cf0f064ef92e/width=450/36597088.jpeg"
4033
+ ],
4034
  "danmen_illustrious_V1_0": [
4035
  "danmen,penis,vaginal / uterus / x-ray / cross-section / internal cumshot",
4036
  "Illustrious",
 
4045
  "https://civitai.com/models/853101",
4046
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/9bbdb650-67f6-4b7a-b020-2f1b15363919/width=450/34507990.jpeg"
4047
  ],
4048
+ "darkness_xl_v10": [
4049
+ "",
4050
+ "Pony",
4051
+ "[SDXL] Darkness / \u6697\u95c7\u5316",
4052
+ "https://civitai.com/models/902671",
4053
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/592b31db-41b0-4f0b-a3d5-b9dff6246608/width=450/37391766.jpeg"
4054
+ ],
4055
  "dawa": [
4056
  "dawa",
4057
  "SDXL 1.0",
 
4080
  "https://civitai.com/models/838545",
4081
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/4611cac5-7c02-484c-9937-a4b7fb5c3817/width=450/33675457.jpeg"
4082
  ],
4083
+ "defloration_illustrious_V1_0": [
4084
+ "defloration, cum, blood",
4085
+ "Illustrious",
4086
+ "\u51e6\u5973\u55aa\u5931/defloration",
4087
+ "https://civitai.com/models/913320",
4088
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/406031e3-c88b-48c3-aecd-931c494758c5/width=450/38051071.jpeg"
4089
+ ],
4090
+ "defloration_pony_V1_0": [
4091
+ "defloration,cum,blood",
4092
+ "Pony",
4093
+ "\u51e6\u5973\u55aa\u5931/defloration",
4094
+ "https://civitai.com/models/913320",
4095
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/1f82a67e-38d2-4fb5-ac26-e81c513b0b82/width=450/38042460.jpeg"
4096
+ ],
4097
  "deflowered_pony": [
4098
  "1woman, perfect face, fully nude, imminent penetration:1.4, deflowered:1.1, blood on thighs, blood dripping, semen, cum, overflow:1.2, / 1male, huge penis, large testicles, / female pubic hair, uncensored pussy, hairy pussy, blush / <lora:deflowered_pony:0.7>,",
4099
  "Pony",
 
4472
  "https://civitai.com/models/577378",
4473
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/459bd20d-a9d6-4a0b-8947-7dcebc061c0f/width=450/19781986.jpeg"
4474
  ],
4475
+ "gekioko_xl_v10": [
4476
+ "",
4477
+ "Pony",
4478
+ "[SDXL] Extremely angry eyes / \u6fc0\u304a\u3053\u9854",
4479
+ "https://civitai.com/models/905782",
4480
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/c6651f05-d287-445e-82cf-96d6863fcf6d/width=450/37585494.jpeg"
4481
+ ],
4482
  "genbaneko_v4_illustrious_uo_1024-000040": [
4483
  "genbaneko / cat, headwear, hat, grey headwear, baseball cap, / speech bubble, speech text,",
4484
  "SDXL 1.0",
 
4619
  "https://civitai.com/models/32541",
4620
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/a02818c5-568b-4da2-a6f3-0c54f3fd604d/width=450/16910321.jpeg"
4621
  ],
4622
+ "guided_penetration_illustrious_V1_0": [
4623
+ "guided penetration, 1boy, penis, vaginal,grabbing penis",
4624
+ "Illustrious",
4625
+ "\u30bb\u30eb\u30d5\u633f\u5165/guided penetration",
4626
+ "https://civitai.com/models/619646",
4627
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/e579696c-d1e7-4ac0-ac90-ecfe022c7009/width=450/37375648.jpeg"
4628
+ ],
4629
  "guided_penetration_pony_V1_0": [
4630
  "",
4631
  "Pony",
 
4934
  "https://civitai.com/models/498731",
4935
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/06a0dc3a-42ba-42b5-9ea9-d6b6faa3543b/width=450/14812284.jpeg"
4936
  ],
4937
+ "hotarueye_xl_surprised_v20": [
4938
+ "",
4939
+ "Pony",
4940
+ "[SDXL] Surprised eyes / \u9a5a\u3044\u305f\u76ee",
4941
+ "https://civitai.com/models/902610",
4942
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/fb8d8351-8cc9-4386-bb65-3db4169824fd/width=450/37388656.jpeg"
4943
+ ],
4944
  "hotarueye_xl_tareme1_v10": [
4945
  "",
4946
  "Pony",
 
5081
  "https://civitai.com/models/637685",
5082
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/94123112-87d5-43fb-9f06-06e621b237bc/width=450/23732178.jpeg"
5083
  ],
5084
+ "index_fingers_together_pony_V1_0": [
5085
+ " index fingers together, blush",
5086
+ "Pony",
5087
+ "\u6307\u3064\u3093/index fingers together",
5088
+ "https://civitai.com/models/887719",
5089
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/3cb02852-eae7-436e-86b1-8403152e5b84/width=450/36517681.jpeg"
5090
+ ],
5091
  "infundibulum_insertion_pony_V1_0": [
5092
  "infundibulum insertion",
5093
  "Pony",
 
5725
  "https://civitai.com/models/488098",
5726
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/58767062-22a1-4f52-ac2e-7f01fae26908/width=450/14206684.jpeg"
5727
  ],
5728
+ "make25d_xl_v10": [
5729
+ "",
5730
+ "Pony",
5731
+ "[SDXL] Convert 2D to 2.5D / 2D\u21922.5D\u5909\u63db",
5732
+ "https://civitai.com/models/914435",
5733
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/8a760cee-7786-4dbf-a556-f8983f5b4d16/width=450/38108254.jpeg"
5734
+ ],
5735
  "manguri_Pony_V1_0": [
5736
  "manguri / legs up / folded / spread legs / upside-down / legs together / knee to chest",
5737
  "Pony",
 
6908
  "https://civitai.com/models/570003",
6909
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/100c8fcb-077b-4ef0-9bf3-41082f1ce453/width=450/19285744.jpeg"
6910
  ],
6911
+ "reverse_cowgirl_position_illustrious_V1_0": [
6912
+ " reverse cowgirl position, 1boy, girl on top, sex, penis, vaginal,",
6913
+ "Illustrious",
6914
+ "\u80cc\u9762\u5ea7\u4f4d/reverse cowgirl position",
6915
+ "https://civitai.com/models/902720",
6916
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/8551d304-9efc-43bc-ae8a-a5bed19f8f9e/width=450/37681569.jpeg"
6917
+ ],
6918
+ "reverse_cowgirl_position_pony_V1_0": [
6919
+ "reverse cowgirl position, 1boy, girl on top, sex, penis, vaginal / skirt lift",
6920
+ "Pony",
6921
+ "\u80cc\u9762\u5ea7\u4f4d/reverse cowgirl position",
6922
+ "https://civitai.com/models/902720",
6923
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/fca4982f-0362-4c0a-9d49-1e0e6ebf1074/width=450/37393655.jpeg"
6924
+ ],
6925
  "ribbon-trimmed_underwear_3-000010": [
6926
  "ribbon-trimmed bra / ribbon-trimmed panties",
6927
  "SD 1.5",
 
6950
  "https://civitai.com/models/554166",
6951
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/ac359acf-7294-4f2c-bf7f-708379deebdb/width=450/18275119.jpeg"
6952
  ],
6953
+ "roseinmouth_Illust_v1": [
6954
+ "rose in mouth",
6955
+ "Illustrious",
6956
+ "rose in mouth / \u53e3\u306b\u8594\u8587",
6957
+ "https://civitai.com/models/911701",
6958
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/bbcea28e-ffc2-4787-bcde-c8dfd0f3951d/width=450/37942270.jpeg"
6959
+ ],
6960
  "rouka_SDXL_V2": [
6961
  "rouka, hallway, window, scenery, school, reflective floor, indoors, door, reflection, building, tiles, tile floor, sunlight, day, ceiling light, realistic / rouka",
6962
  "SDXL 1.0",
 
7132
  "https://civitai.com/models/311263",
7133
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/27503dd2-9b3b-44d5-8f30-fd7a1be2668b/width=450/8190285.jpeg"
7134
  ],
7135
+ "sensualface1_xl_v20": [
7136
+ "",
7137
+ "Pony",
7138
+ "[SDXL] Sensual face / \u5b98\u80fd\u7684(\u60a9\u307e\u3057\u3052)\u306a\u8868\u60c5",
7139
+ "https://civitai.com/models/911293",
7140
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/df39de6a-abd7-491e-9b57-cd8bf58534f1/width=450/37923561.jpeg"
7141
+ ],
7142
+ "sensualface2_xl_v20": [
7143
+ "",
7144
+ "Pony",
7145
+ "[SDXL] Sensual face / \u5b98\u80fd\u7684(\u60a9\u307e\u3057\u3052)\u306a\u8868\u60c5",
7146
+ "https://civitai.com/models/911293",
7147
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/ae12f246-5b6c-47f0-b7c4-5c414bd40138/width=450/37923681.jpeg"
7148
+ ],
7149
  "sento": [
7150
  "sento",
7151
  "Pony",
 
7202
  "https://civitai.com/models/834937",
7203
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/a4fd210d-90db-4995-8868-482e597fe927/width=450/33459038.jpeg"
7204
  ],
7205
+ "shiJojoStandV2": [
7206
+ " shijojostand, stand \\(jojo\\), 1other, ",
7207
+ "Pony",
7208
+ "Jojo Stand Prototype Concept | PonyXL",
7209
+ "https://civitai.com/models/900698",
7210
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/51375190-53e8-4369-a49a-839cbc94fae7/width=450/37278575.jpeg"
7211
+ ],
7212
+ "shiMesugakiV1": [
7213
+ "shimesugaki, mesugaki",
7214
+ "Pony",
7215
+ "Mesugaki / \u30e1\u30b9\u30ac\u30ad | Concept | PonyXL",
7216
+ "https://civitai.com/models/889834",
7217
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/c265d91e-7c40-42fb-bf5b-cf6b7ebe3540/width=450/36638170.jpeg"
7218
+ ],
7219
  "shiReroVT1": [
7220
  "shirerocrazy, cross-eyed, tongue, cherry on tongue, saliva, tongue out, looking at viewer, open mouth, parody, cherry, ",
7221
  "Pony",
 
7363
  "https://civitai.com/models/574708",
7364
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/557c4224-c6c8-4b71-b6fe-adc82e552f25/width=450/19613178.jpeg"
7365
  ],
7366
+ "smugface_xl_v10": [
7367
+ "",
7368
+ "Pony",
7369
+ "[SDXL] Evil smug face / \u5c0f\u60aa\u9b54\u306e\u7b11\u307f",
7370
+ "https://civitai.com/models/905746",
7371
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/07ef9845-3d87-4e07-9d01-94d4a7b2581f/width=450/37583480.jpeg"
7372
+ ],
7373
  "soap_bubbles_pony_V1_0": [
7374
  "soap bubbles / soap",
7375
  "Pony",
 
7790
  "https://civitai.com/models/349716",
7791
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/dec948dc-ac1b-4918-90ac-fe35daaf6d63/width=450/7927405.jpeg"
7792
  ],
7793
+ "tearing_clothes_illustrious_V1_0": [
7794
+ " tearing clothes, torn clothes,1boy,grabbing clothes",
7795
+ "Illustrious",
7796
+ "\u670d\u88c2\u304d/tearing clothes",
7797
+ "https://civitai.com/models/725787",
7798
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/6df5e6ec-9b90-4a7a-99ba-4fecdcb8db28/width=450/37339779.jpeg"
7799
+ ],
7800
+ "tearing_clothes_pony_V1_0": [
7801
+ " tearing clothes, torn clothes",
7802
+ "Pony",
7803
+ "\u670d\u88c2\u304d/tearing clothes",
7804
+ "https://civitai.com/models/725787",
7805
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/11a24cc7-3997-4d0d-adeb-679b40eb9b42/width=450/28009090.jpeg"
7806
+ ],
7807
  "tears_XL_V1_0": [
7808
  "tears",
7809
  "SDXL 1.0",
 
7930
  "https://civitai.com/models/499436",
7931
  "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/8f4ac8a2-2034-4c53-9d20-fc2108840cf5/width=450/14855524.jpeg"
7932
  ],
7933
+ "tongue_out_mouth_pointy_pony_V1_0": [
7934
+ "\uff4douth pointy,tongue out",
7935
+ "Pony",
7936
+ "\u820c\u51fa\u3057/tongue out(\uff4douth pointy)",
7937
+ "https://civitai.com/models/889045",
7938
+ "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/b2994582-1653-4a4c-9127-b50995e97ab9/width=450/36579483.jpeg"
7939
+ ],
7940
  "topanglexl16": [
7941
  "above / from above",
7942
  "SDXL 1.0",
modutils.py CHANGED
@@ -1320,10 +1320,10 @@ style_list = [
1320
 
1321
 
1322
  optimization_list = {
1323
- "None": [28, 7., 'Euler a', False, 'None', 1.],
1324
- "Default": [28, 7., 'Euler a', False, 'None', 1.],
1325
- "SPO": [28, 7., 'Euler a', True, 'loras/spo_sdxl_10ep_4k-data_lora_diffusers.safetensors', 1.],
1326
- "DPO": [28, 7., 'Euler a', True, 'loras/sdxl-DPO-LoRA.safetensors', 1.],
1327
  "DPO Turbo": [8, 2.5, 'LCM', True, 'loras/sd_xl_dpo_turbo_lora_v1-128dim.safetensors', 1.],
1328
  "SDXL Turbo": [8, 2.5, 'LCM', True, 'loras/sd_xl_turbo_lora_v1.safetensors', 1.],
1329
  "Hyper-SDXL 12step": [12, 5., 'TCD', True, 'loras/Hyper-SDXL-12steps-CFG-lora.safetensors', 1.],
@@ -1331,10 +1331,10 @@ optimization_list = {
1331
  "Hyper-SDXL 4step": [4, 0, 'TCD', True, 'loras/Hyper-SDXL-4steps-lora.safetensors', 1.],
1332
  "Hyper-SDXL 2step": [2, 0, 'TCD', True, 'loras/Hyper-SDXL-2steps-lora.safetensors', 1.],
1333
  "Hyper-SDXL 1step": [1, 0, 'TCD', True, 'loras/Hyper-SDXL-1steps-lora.safetensors', 1.],
1334
- "PCM 16step": [16, 4., 'Euler a trailing', True, 'loras/pcm_sdxl_normalcfg_16step_converted.safetensors', 1.],
1335
- "PCM 8step": [8, 4., 'Euler a trailing', True, 'loras/pcm_sdxl_normalcfg_8step_converted.safetensors', 1.],
1336
- "PCM 4step": [4, 2., 'Euler a trailing', True, 'loras/pcm_sdxl_smallcfg_4step_converted.safetensors', 1.],
1337
- "PCM 2step": [2, 1., 'Euler a trailing', True, 'loras/pcm_sdxl_smallcfg_2step_converted.safetensors', 1.],
1338
  }
1339
 
1340
 
@@ -1362,13 +1362,13 @@ def set_optimization(opt, steps_gui, cfg_gui, sampler_gui, clip_skip_gui, lora_g
1362
 
1363
  # [sampler_gui, steps_gui, cfg_gui, clip_skip_gui, img_width_gui, img_height_gui, optimization_gui]
1364
  preset_sampler_setting = {
1365
- "None": ["Euler a", 28, 7., True, 1024, 1024, "None"],
1366
  "Anime 3:4 Fast": ["LCM", 8, 2.5, True, 896, 1152, "DPO Turbo"],
1367
- "Anime 3:4 Standard": ["Euler a", 28, 7., True, 896, 1152, "None"],
1368
- "Anime 3:4 Heavy": ["Euler a", 40, 7., True, 896, 1152, "None"],
1369
  "Anime 1:1 Fast": ["LCM", 8, 2.5, True, 1024, 1024, "DPO Turbo"],
1370
- "Anime 1:1 Standard": ["Euler a", 28, 7., True, 1024, 1024, "None"],
1371
- "Anime 1:1 Heavy": ["Euler a", 40, 7., True, 1024, 1024, "None"],
1372
  "Photo 3:4 Fast": ["LCM", 8, 2.5, False, 896, 1152, "DPO Turbo"],
1373
  "Photo 3:4 Standard": ["DPM++ 2M Karras", 28, 7., False, 896, 1152, "None"],
1374
  "Photo 3:4 Heavy": ["DPM++ 2M Karras", 40, 7., False, 896, 1152, "None"],
@@ -1380,9 +1380,9 @@ preset_sampler_setting = {
1380
 
1381
  def set_sampler_settings(sampler_setting):
1382
  if not sampler_setting in list(preset_sampler_setting.keys()) or sampler_setting == "None":
1383
- return gr.update(value="Euler a"), gr.update(value=28), gr.update(value=7.), gr.update(value=True),\
1384
  gr.update(value=1024), gr.update(value=1024), gr.update(value="None")
1385
- v = preset_sampler_setting.get(sampler_setting, ["Euler a", 28, 7., True, 1024, 1024])
1386
  # sampler, steps, cfg, clip_skip, width, height, optimization
1387
  return gr.update(value=v[0]), gr.update(value=v[1]), gr.update(value=v[2]), gr.update(value=v[3]),\
1388
  gr.update(value=v[4]), gr.update(value=v[5]), gr.update(value=v[6])
@@ -1573,7 +1573,7 @@ EXAMPLES_GUI = [
1573
  7.5,
1574
  True,
1575
  -1,
1576
- "Euler a",
1577
  1152,
1578
  896,
1579
  "votepurchase/animagine-xl-3.1",
@@ -1586,7 +1586,7 @@ EXAMPLES_GUI = [
1586
  5.,
1587
  True,
1588
  -1,
1589
- "Euler a",
1590
  1024,
1591
  1024,
1592
  "votepurchase/ponyDiffusionV6XL",
@@ -1599,7 +1599,7 @@ EXAMPLES_GUI = [
1599
  7.0,
1600
  True,
1601
  -1,
1602
- "Euler a",
1603
  1024,
1604
  1024,
1605
  "Raelina/Rae-Diffusion-XL-V2",
@@ -1612,7 +1612,7 @@ EXAMPLES_GUI = [
1612
  7.0,
1613
  True,
1614
  -1,
1615
- "Euler a",
1616
  1024,
1617
  1024,
1618
  "Raelina/Raemu-XL-V4",
@@ -1625,7 +1625,7 @@ EXAMPLES_GUI = [
1625
  7.,
1626
  True,
1627
  -1,
1628
- "Euler a",
1629
  1024,
1630
  1024,
1631
  "cagliostrolab/animagine-xl-3.1",
 
1320
 
1321
 
1322
  optimization_list = {
1323
+ "None": [28, 7., 'Euler', False, 'None', 1.],
1324
+ "Default": [28, 7., 'Euler', False, 'None', 1.],
1325
+ "SPO": [28, 7., 'Euler', True, 'loras/spo_sdxl_10ep_4k-data_lora_diffusers.safetensors', 1.],
1326
+ "DPO": [28, 7., 'Euler', True, 'loras/sdxl-DPO-LoRA.safetensors', 1.],
1327
  "DPO Turbo": [8, 2.5, 'LCM', True, 'loras/sd_xl_dpo_turbo_lora_v1-128dim.safetensors', 1.],
1328
  "SDXL Turbo": [8, 2.5, 'LCM', True, 'loras/sd_xl_turbo_lora_v1.safetensors', 1.],
1329
  "Hyper-SDXL 12step": [12, 5., 'TCD', True, 'loras/Hyper-SDXL-12steps-CFG-lora.safetensors', 1.],
 
1331
  "Hyper-SDXL 4step": [4, 0, 'TCD', True, 'loras/Hyper-SDXL-4steps-lora.safetensors', 1.],
1332
  "Hyper-SDXL 2step": [2, 0, 'TCD', True, 'loras/Hyper-SDXL-2steps-lora.safetensors', 1.],
1333
  "Hyper-SDXL 1step": [1, 0, 'TCD', True, 'loras/Hyper-SDXL-1steps-lora.safetensors', 1.],
1334
+ "PCM 16step": [16, 4., 'Euler trailing', True, 'loras/pcm_sdxl_normalcfg_16step_converted.safetensors', 1.],
1335
+ "PCM 8step": [8, 4., 'Euler trailing', True, 'loras/pcm_sdxl_normalcfg_8step_converted.safetensors', 1.],
1336
+ "PCM 4step": [4, 2., 'Euler trailing', True, 'loras/pcm_sdxl_smallcfg_4step_converted.safetensors', 1.],
1337
+ "PCM 2step": [2, 1., 'Euler trailing', True, 'loras/pcm_sdxl_smallcfg_2step_converted.safetensors', 1.],
1338
  }
1339
 
1340
 
 
1362
 
1363
  # [sampler_gui, steps_gui, cfg_gui, clip_skip_gui, img_width_gui, img_height_gui, optimization_gui]
1364
  preset_sampler_setting = {
1365
+ "None": ["Euler", 28, 7., True, 1024, 1024, "None"],
1366
  "Anime 3:4 Fast": ["LCM", 8, 2.5, True, 896, 1152, "DPO Turbo"],
1367
+ "Anime 3:4 Standard": ["Euler", 28, 7., True, 896, 1152, "None"],
1368
+ "Anime 3:4 Heavy": ["Euler", 40, 7., True, 896, 1152, "None"],
1369
  "Anime 1:1 Fast": ["LCM", 8, 2.5, True, 1024, 1024, "DPO Turbo"],
1370
+ "Anime 1:1 Standard": ["Euler", 28, 7., True, 1024, 1024, "None"],
1371
+ "Anime 1:1 Heavy": ["Euler", 40, 7., True, 1024, 1024, "None"],
1372
  "Photo 3:4 Fast": ["LCM", 8, 2.5, False, 896, 1152, "DPO Turbo"],
1373
  "Photo 3:4 Standard": ["DPM++ 2M Karras", 28, 7., False, 896, 1152, "None"],
1374
  "Photo 3:4 Heavy": ["DPM++ 2M Karras", 40, 7., False, 896, 1152, "None"],
 
1380
 
1381
  def set_sampler_settings(sampler_setting):
1382
  if not sampler_setting in list(preset_sampler_setting.keys()) or sampler_setting == "None":
1383
+ return gr.update(value="Euler"), gr.update(value=28), gr.update(value=7.), gr.update(value=True),\
1384
  gr.update(value=1024), gr.update(value=1024), gr.update(value="None")
1385
+ v = preset_sampler_setting.get(sampler_setting, ["Euler", 28, 7., True, 1024, 1024])
1386
  # sampler, steps, cfg, clip_skip, width, height, optimization
1387
  return gr.update(value=v[0]), gr.update(value=v[1]), gr.update(value=v[2]), gr.update(value=v[3]),\
1388
  gr.update(value=v[4]), gr.update(value=v[5]), gr.update(value=v[6])
 
1573
  7.5,
1574
  True,
1575
  -1,
1576
+ "Euler",
1577
  1152,
1578
  896,
1579
  "votepurchase/animagine-xl-3.1",
 
1586
  5.,
1587
  True,
1588
  -1,
1589
+ "Euler",
1590
  1024,
1591
  1024,
1592
  "votepurchase/ponyDiffusionV6XL",
 
1599
  7.0,
1600
  True,
1601
  -1,
1602
+ "Euler",
1603
  1024,
1604
  1024,
1605
  "Raelina/Rae-Diffusion-XL-V2",
 
1612
  7.0,
1613
  True,
1614
  -1,
1615
+ "Euler",
1616
  1024,
1617
  1024,
1618
  "Raelina/Raemu-XL-V4",
 
1625
  7.,
1626
  True,
1627
  -1,
1628
+ "Euler",
1629
  1024,
1630
  1024,
1631
  "cagliostrolab/animagine-xl-3.1",
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>")