Spaces:
Running
on
Zero
Running
on
Zero
Upload 4 files
Browse files- app.py +12 -10
- model_dict.json +0 -0
- modutils.py +11 -11
- tagger.py +2 -2
app.py
CHANGED
@@ -274,6 +274,7 @@ model_list = load_diffusers_format_model + model_list
|
|
274 |
## BEGIN MOD
|
275 |
lora_model_list = list_uniq(get_private_lora_model_lists() + get_model_list(directory_loras))
|
276 |
lora_model_list.insert(0, "None")
|
|
|
277 |
vae_model_list = get_model_list(directory_vaes)
|
278 |
vae_model_list.insert(0, "None")
|
279 |
|
@@ -304,6 +305,7 @@ def get_my_lora(link_url):
|
|
304 |
update_lora_dict(str(new_path))
|
305 |
new_lora_model_list = list_uniq(get_private_lora_model_lists() + get_model_list(directory_loras))
|
306 |
new_lora_model_list.insert(0, "None")
|
|
|
307 |
|
308 |
return gr.update(
|
309 |
choices=get_lora_tupled_list(new_lora_model_list), value=new_lora_model_list[-1]
|
@@ -1081,39 +1083,39 @@ with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", elem_id="main", css=CSS) as app:
|
|
1081 |
hires_negative_prompt_gui = gr.Textbox(label="Hires Negative Prompt", placeholder="Main negative prompt will be use", lines=3)
|
1082 |
|
1083 |
with gr.Accordion("LoRA", open=False, visible=True) as menu_lora:
|
1084 |
-
lora1_gui = gr.Dropdown(label="Lora1", choices=get_lora_tupled_list(lora_model_list), value="
|
1085 |
lora_scale_1_gui = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="Lora Scale 1")
|
1086 |
with gr.Row():
|
1087 |
with gr.Group():
|
1088 |
-
lora1_trigger_gui = gr.Textbox(label="Lora1 prompts", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
|
1089 |
lora1_copy_button = gr.Button(value="Copy example to prompt", visible=False)
|
1090 |
lora1_desc_gui = gr.Markdown(value="", visible=False)
|
1091 |
-
lora2_gui = gr.Dropdown(label="Lora2", choices=get_lora_tupled_list(lora_model_list), value="
|
1092 |
lora_scale_2_gui = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="Lora Scale 2")
|
1093 |
with gr.Row():
|
1094 |
with gr.Group():
|
1095 |
-
lora2_trigger_gui = gr.Textbox(label="Lora2 prompts", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
|
1096 |
lora2_copy_button = gr.Button(value="Copy example to prompt", visible=False)
|
1097 |
lora2_desc_gui = gr.Markdown(value="", visible=False)
|
1098 |
-
lora3_gui = gr.Dropdown(label="Lora3", choices=get_lora_tupled_list(lora_model_list), value="
|
1099 |
lora_scale_3_gui = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="Lora Scale 3")
|
1100 |
with gr.Row():
|
1101 |
with gr.Group():
|
1102 |
-
lora3_trigger_gui = gr.Textbox(label="Lora3 prompts", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
|
1103 |
lora3_copy_button = gr.Button(value="Copy example to prompt", visible=False)
|
1104 |
lora3_desc_gui = gr.Markdown(value="", visible=False)
|
1105 |
-
lora4_gui = gr.Dropdown(label="Lora4", choices=get_lora_tupled_list(lora_model_list), value="
|
1106 |
lora_scale_4_gui = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="Lora Scale 4")
|
1107 |
with gr.Row():
|
1108 |
with gr.Group():
|
1109 |
-
lora4_trigger_gui = gr.Textbox(label="Lora4 prompts", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
|
1110 |
lora4_copy_button = gr.Button(value="Copy example to prompt", visible=False)
|
1111 |
lora4_desc_gui = gr.Markdown(value="", visible=False)
|
1112 |
-
lora5_gui = gr.Dropdown(label="Lora5", choices=get_lora_tupled_list(lora_model_list), value="
|
1113 |
lora_scale_5_gui = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="Lora Scale 5")
|
1114 |
with gr.Row():
|
1115 |
with gr.Group():
|
1116 |
-
lora5_trigger_gui = gr.Textbox(label="Lora5 prompts", info="Example of prompt", value="", show_copy_button=True, interactive=False, visible=False)
|
1117 |
lora5_copy_button = gr.Button(value="Copy example to prompt", visible=False)
|
1118 |
lora5_desc_gui = gr.Markdown(value="", visible=False)
|
1119 |
with gr.Accordion("From URL", open=True, visible=True):
|
|
|
274 |
## BEGIN MOD
|
275 |
lora_model_list = list_uniq(get_private_lora_model_lists() + get_model_list(directory_loras))
|
276 |
lora_model_list.insert(0, "None")
|
277 |
+
lora_model_list.insert(0, "")
|
278 |
vae_model_list = get_model_list(directory_vaes)
|
279 |
vae_model_list.insert(0, "None")
|
280 |
|
|
|
305 |
update_lora_dict(str(new_path))
|
306 |
new_lora_model_list = list_uniq(get_private_lora_model_lists() + get_model_list(directory_loras))
|
307 |
new_lora_model_list.insert(0, "None")
|
308 |
+
new_lora_model_list.insert(0, "")
|
309 |
|
310 |
return gr.update(
|
311 |
choices=get_lora_tupled_list(new_lora_model_list), value=new_lora_model_list[-1]
|
|
|
1083 |
hires_negative_prompt_gui = gr.Textbox(label="Hires Negative Prompt", placeholder="Main negative prompt will be use", lines=3)
|
1084 |
|
1085 |
with gr.Accordion("LoRA", open=False, visible=True) as menu_lora:
|
1086 |
+
lora1_gui = gr.Dropdown(label="Lora1", choices=get_lora_tupled_list(lora_model_list), value="", allow_custom_value=True)
|
1087 |
lora_scale_1_gui = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="Lora Scale 1")
|
1088 |
with gr.Row():
|
1089 |
with gr.Group():
|
1090 |
+
lora1_trigger_gui = gr.Textbox(label="Lora1 prompts", info="Example of prompt:", value="None", show_copy_button=True, interactive=False, visible=False)
|
1091 |
lora1_copy_button = gr.Button(value="Copy example to prompt", visible=False)
|
1092 |
lora1_desc_gui = gr.Markdown(value="", visible=False)
|
1093 |
+
lora2_gui = gr.Dropdown(label="Lora2", choices=get_lora_tupled_list(lora_model_list), value="", allow_custom_value=True)
|
1094 |
lora_scale_2_gui = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="Lora Scale 2")
|
1095 |
with gr.Row():
|
1096 |
with gr.Group():
|
1097 |
+
lora2_trigger_gui = gr.Textbox(label="Lora2 prompts", info="Example of prompt:", value="None", show_copy_button=True, interactive=False, visible=False)
|
1098 |
lora2_copy_button = gr.Button(value="Copy example to prompt", visible=False)
|
1099 |
lora2_desc_gui = gr.Markdown(value="", visible=False)
|
1100 |
+
lora3_gui = gr.Dropdown(label="Lora3", choices=get_lora_tupled_list(lora_model_list), value="", allow_custom_value=True)
|
1101 |
lora_scale_3_gui = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="Lora Scale 3")
|
1102 |
with gr.Row():
|
1103 |
with gr.Group():
|
1104 |
+
lora3_trigger_gui = gr.Textbox(label="Lora3 prompts", info="Example of prompt:", value="None", show_copy_button=True, interactive=False, visible=False)
|
1105 |
lora3_copy_button = gr.Button(value="Copy example to prompt", visible=False)
|
1106 |
lora3_desc_gui = gr.Markdown(value="", visible=False)
|
1107 |
+
lora4_gui = gr.Dropdown(label="Lora4", choices=get_lora_tupled_list(lora_model_list), value="", allow_custom_value=True)
|
1108 |
lora_scale_4_gui = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="Lora Scale 4")
|
1109 |
with gr.Row():
|
1110 |
with gr.Group():
|
1111 |
+
lora4_trigger_gui = gr.Textbox(label="Lora4 prompts", info="Example of prompt:", value="None", show_copy_button=True, interactive=False, visible=False)
|
1112 |
lora4_copy_button = gr.Button(value="Copy example to prompt", visible=False)
|
1113 |
lora4_desc_gui = gr.Markdown(value="", visible=False)
|
1114 |
+
lora5_gui = gr.Dropdown(label="Lora5", choices=get_lora_tupled_list(lora_model_list), value="", allow_custom_value=True)
|
1115 |
lora_scale_5_gui = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="Lora Scale 5")
|
1116 |
with gr.Row():
|
1117 |
with gr.Group():
|
1118 |
+
lora5_trigger_gui = gr.Textbox(label="Lora5 prompts", info="Example of prompt", value="None", show_copy_button=True, interactive=False, visible=False)
|
1119 |
lora5_copy_button = gr.Button(value="Copy example to prompt", visible=False)
|
1120 |
lora5_desc_gui = gr.Markdown(value="", visible=False)
|
1121 |
with gr.Accordion("From URL", open=True, visible=True):
|
model_dict.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
modutils.py
CHANGED
@@ -301,12 +301,11 @@ def set_lora_prompt(prompt_gui, prompt_syntax_gui, lora1_gui, lora_scale_1_gui,
|
|
301 |
return gr.update(value=prompt)
|
302 |
|
303 |
|
304 |
-
|
305 |
-
lora_trigger_dict = {}
|
306 |
with open('lora_dict.json', encoding='utf-8') as f:
|
307 |
temp_dict = json.load(f)
|
308 |
-
for k, v in temp_dict.items():
|
309 |
-
|
310 |
|
311 |
|
312 |
civitai_not_exists_list = []
|
@@ -364,8 +363,8 @@ def get_lora_tupled_list(lora_model_list):
|
|
364 |
tupled_list = []
|
365 |
local_models = set(get_local_model_list(directory_loras))
|
366 |
for model in lora_model_list:
|
367 |
-
if not model: continue
|
368 |
-
basename = Path(model).stem
|
369 |
key = escape_lora_basename(basename)
|
370 |
items = None
|
371 |
if key in lora_trigger_dict.keys():
|
@@ -387,12 +386,12 @@ def get_lora_tupled_list(lora_model_list):
|
|
387 |
|
388 |
def set_lora_trigger(lora_gui: str):
|
389 |
if not lora_gui or lora_gui == "None": return gr.update(value="", visible=False), gr.update(visible=False),\
|
390 |
-
gr.update(value="", visible=False), gr.update(value="
|
391 |
path = Path(lora_gui)
|
392 |
new_path = Path(f'{path.parent.name}/{escape_lora_basename(path.stem)}{path.suffix}')
|
393 |
if not new_path.stem in lora_trigger_dict.keys() and not str(path) in set(get_private_lora_model_lists() + get_local_model_list(directory_loras)):
|
394 |
return gr.update(value="", visible=False), gr.update(visible=False),\
|
395 |
-
gr.update(value="", visible=False), gr.update(value=""
|
396 |
if not new_path.exists():
|
397 |
download_private_file_from_somewhere(str(path), True)
|
398 |
basename = new_path.stem
|
@@ -459,6 +458,7 @@ def move_file_lora(filepaths):
|
|
459 |
|
460 |
new_lora_model_list = list_uniq(get_private_lora_model_lists() + get_local_model_list(directory_loras))
|
461 |
new_lora_model_list.insert(0, "None")
|
|
|
462 |
|
463 |
return gr.update(
|
464 |
choices=get_lora_tupled_list(new_lora_model_list), value=new_lora_model_list[-1]
|
@@ -546,7 +546,7 @@ quality_prompt_list = [
|
|
546 |
},
|
547 |
{
|
548 |
"name": "Animagine Common",
|
549 |
-
"prompt": "anime artwork, anime style,
|
550 |
"negative_prompt": "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]",
|
551 |
},
|
552 |
{
|
@@ -600,7 +600,7 @@ style_list = [
|
|
600 |
},
|
601 |
{
|
602 |
"name": "Anime",
|
603 |
-
"prompt": "anime artwork, anime style,
|
604 |
"negative_prompt": "photo, deformed, black and white, realism, disfigured, low contrast",
|
605 |
},
|
606 |
{
|
@@ -678,7 +678,7 @@ def process_style_prompt(prompt: str, neg_prompt: str, styles_key: str = "None",
|
|
678 |
def list_uniq(l):
|
679 |
return sorted(set(l), key=l.index)
|
680 |
|
681 |
-
animagine_ps = to_list("anime artwork, anime style,
|
682 |
animagine_nps = to_list("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]")
|
683 |
pony_ps = to_list("source_anime, score_9, score_8_up, score_7_up, masterpiece, best quality, very aesthetic, absurdres")
|
684 |
pony_nps = to_list("source_pony, source_furry, source_cartoon, score_6, score_5, score_4, busty, ugly face, mutated hands, low res, blurry face, black and white, the simpsons, overwatch, apex legends")
|
|
|
301 |
return gr.update(value=prompt)
|
302 |
|
303 |
|
304 |
+
lora_trigger_dict = {"None": ["", "", "", "", ""], "": ["", "", "", "", ""]}
|
|
|
305 |
with open('lora_dict.json', encoding='utf-8') as f:
|
306 |
temp_dict = json.load(f)
|
307 |
+
for k, v in temp_dict.items():
|
308 |
+
lora_trigger_dict[escape_lora_basename(k)] = v
|
309 |
|
310 |
|
311 |
civitai_not_exists_list = []
|
|
|
363 |
tupled_list = []
|
364 |
local_models = set(get_local_model_list(directory_loras))
|
365 |
for model in lora_model_list:
|
366 |
+
#if not model: continue
|
367 |
+
basename = Path(model).stem if model else ""
|
368 |
key = escape_lora_basename(basename)
|
369 |
items = None
|
370 |
if key in lora_trigger_dict.keys():
|
|
|
386 |
|
387 |
def set_lora_trigger(lora_gui: str):
|
388 |
if not lora_gui or lora_gui == "None": return gr.update(value="", visible=False), gr.update(visible=False),\
|
389 |
+
gr.update(value="", visible=False), gr.update(value="")
|
390 |
path = Path(lora_gui)
|
391 |
new_path = Path(f'{path.parent.name}/{escape_lora_basename(path.stem)}{path.suffix}')
|
392 |
if not new_path.stem in lora_trigger_dict.keys() and not str(path) in set(get_private_lora_model_lists() + get_local_model_list(directory_loras)):
|
393 |
return gr.update(value="", visible=False), gr.update(visible=False),\
|
394 |
+
gr.update(value="", visible=False), gr.update(value="")
|
395 |
if not new_path.exists():
|
396 |
download_private_file_from_somewhere(str(path), True)
|
397 |
basename = new_path.stem
|
|
|
458 |
|
459 |
new_lora_model_list = list_uniq(get_private_lora_model_lists() + get_local_model_list(directory_loras))
|
460 |
new_lora_model_list.insert(0, "None")
|
461 |
+
new_lora_model_list.insert(0, "")
|
462 |
|
463 |
return gr.update(
|
464 |
choices=get_lora_tupled_list(new_lora_model_list), value=new_lora_model_list[-1]
|
|
|
546 |
},
|
547 |
{
|
548 |
"name": "Animagine Common",
|
549 |
+
"prompt": "anime artwork, anime style, vibrant, studio anime, highly detailed, masterpiece, best quality, very aesthetic, absurdres",
|
550 |
"negative_prompt": "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]",
|
551 |
},
|
552 |
{
|
|
|
600 |
},
|
601 |
{
|
602 |
"name": "Anime",
|
603 |
+
"prompt": "anime artwork, anime style, vibrant, studio anime, highly detailed",
|
604 |
"negative_prompt": "photo, deformed, black and white, realism, disfigured, low contrast",
|
605 |
},
|
606 |
{
|
|
|
678 |
def list_uniq(l):
|
679 |
return sorted(set(l), key=l.index)
|
680 |
|
681 |
+
animagine_ps = to_list("anime artwork, anime style, vibrant, studio anime, highly detailed, masterpiece, best quality, very aesthetic, absurdres")
|
682 |
animagine_nps = to_list("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]")
|
683 |
pony_ps = to_list("source_anime, score_9, score_8_up, score_7_up, masterpiece, best quality, very aesthetic, absurdres")
|
684 |
pony_nps = to_list("source_pony, source_furry, source_cartoon, score_6, score_5, score_4, busty, ugly face, mutated hands, low res, blurry face, black and white, the simpsons, overwatch, apex legends")
|
tagger.py
CHANGED
@@ -242,11 +242,11 @@ def convert_tags_to_ja(input_prompt: str = ""):
|
|
242 |
enable_auto_recom_prompt = True
|
243 |
|
244 |
|
245 |
-
animagine_ps = to_list("anime artwork, anime style,
|
246 |
animagine_nps = to_list("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]")
|
247 |
pony_ps = to_list("source_anime, score_9, score_8_up, score_7_up, masterpiece, best quality, very aesthetic, absurdres")
|
248 |
pony_nps = to_list("source_pony, source_furry, source_cartoon, score_6, score_5, score_4, busty, ugly face, mutated hands, low res, blurry face, black and white, the simpsons, overwatch, apex legends")
|
249 |
-
other_ps = to_list("anime artwork, anime style,
|
250 |
other_nps = to_list("photo, deformed, black and white, realism, disfigured, low contrast, drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly")
|
251 |
default_ps = to_list("score_9, score_8_up, score_7_up, highly detailed, masterpiece, best quality, very aesthetic, absurdres")
|
252 |
default_nps = to_list("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]")
|
|
|
242 |
enable_auto_recom_prompt = True
|
243 |
|
244 |
|
245 |
+
animagine_ps = to_list("anime artwork, anime style, vibrant, studio anime, highly detailed, masterpiece, best quality, very aesthetic, absurdres")
|
246 |
animagine_nps = to_list("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]")
|
247 |
pony_ps = to_list("source_anime, score_9, score_8_up, score_7_up, masterpiece, best quality, very aesthetic, absurdres")
|
248 |
pony_nps = to_list("source_pony, source_furry, source_cartoon, score_6, score_5, score_4, busty, ugly face, mutated hands, low res, blurry face, black and white, the simpsons, overwatch, apex legends")
|
249 |
+
other_ps = to_list("anime artwork, anime style, vibrant, studio anime, highly detailed, cinematic photo, 35mm photograph, film, bokeh, professional, 4k, highly detailed")
|
250 |
other_nps = to_list("photo, deformed, black and white, realism, disfigured, low contrast, drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly")
|
251 |
default_ps = to_list("score_9, score_8_up, score_7_up, highly detailed, masterpiece, best quality, very aesthetic, absurdres")
|
252 |
default_nps = to_list("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]")
|