Spaces:
Running
on
Zero
Running
on
Zero
Upload 5 files
Browse files- app.py +173 -192
- lora_dict.json +91 -0
- modutils.py +13 -18
app.py
CHANGED
@@ -842,9 +842,10 @@ sd_gen = GuiSD()
|
|
842 |
|
843 |
## BEGIN MOD
|
844 |
CSS ="""
|
845 |
-
.
|
846 |
-
|
847 |
-
#
|
|
|
848 |
"""
|
849 |
## END MOD
|
850 |
|
@@ -865,7 +866,7 @@ def update_task_options(model_name, task_name):
|
|
865 |
return gr.update(value=task_name, choices=task_model_list)
|
866 |
|
867 |
## BEGIN MOD
|
868 |
-
with gr.Blocks(theme="NoCrypt/miku", elem_id="main", css=CSS) as app:
|
869 |
gr.Markdown("# 🧩 DiffuseCraft Mod")
|
870 |
gr.Markdown(
|
871 |
f"""
|
@@ -1111,155 +1112,156 @@ with gr.Blocks(theme="NoCrypt/miku", elem_id="main", css=CSS) as app:
|
|
1111 |
file_output_lora = gr.File(label="Uploaded LoRA", file_types=['.ckpt', '.pt', '.pth', '.safetensors', '.bin'], file_count="multiple", interactive=False, visible=False)
|
1112 |
upload_button_lora = gr.UploadButton(label="Upload LoRA from your disk (very slow)", file_types=['.ckpt' , '.pt', '.pth', '.safetensors', '.bin'], file_count="multiple")
|
1113 |
|
1114 |
-
with gr.Accordion("
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
|
|
1263 |
gr.Examples(
|
1264 |
examples=[
|
1265 |
[
|
@@ -1595,8 +1597,8 @@ with gr.Blocks(theme="NoCrypt/miku", elem_id="main", css=CSS) as app:
|
|
1595 |
interface_mode_gui.change(
|
1596 |
change_interface_mode,
|
1597 |
[interface_mode_gui],
|
1598 |
-
[menu_model, menu_from_image, menu_negative, menu_gen, menu_hires, menu_lora,
|
1599 |
-
|
1600 |
)
|
1601 |
model_name_gui.change(get_t2i_model_info, [model_name_gui], [model_info_gui])
|
1602 |
|
@@ -1644,12 +1646,14 @@ with gr.Blocks(theme="NoCrypt/miku", elem_id="main", css=CSS) as app:
|
|
1644 |
.success(set_lora_trigger, [lora4_gui], [lora4_trigger_gui, lora4_copy_button, lora4_desc_gui, lora4_gui], scroll_to_output=True)
|
1645 |
lora5_gui.change(set_lora_prompt, [prompt_gui, prompt_syntax_gui, lora1_gui, lora_scale_1_gui, lora2_gui, lora_scale_2_gui, lora3_gui, lora_scale_3_gui, lora4_gui, lora_scale_4_gui, lora5_gui, lora_scale_5_gui], [prompt_gui])\
|
1646 |
.success(set_lora_trigger, [lora5_gui], [lora5_trigger_gui, lora5_copy_button, lora5_desc_gui, lora5_gui], scroll_to_output=True)
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
|
|
|
|
1653 |
lora1_copy_button.click(apply_lora_prompt, [prompt_gui, lora1_trigger_gui], [prompt_gui])
|
1654 |
lora2_copy_button.click(apply_lora_prompt, [prompt_gui, lora2_trigger_gui], [prompt_gui])
|
1655 |
lora3_copy_button.click(apply_lora_prompt, [prompt_gui, lora3_trigger_gui], [prompt_gui])
|
@@ -1665,18 +1669,14 @@ with gr.Blocks(theme="NoCrypt/miku", elem_id="main", css=CSS) as app:
|
|
1665 |
search_civitai_result_lora.change(select_civitai_lora, [search_civitai_result_lora], [text_lora, search_civitai_desc_lora], scroll_to_output=True)
|
1666 |
button_lora.click(get_my_lora, [text_lora], [lora1_gui, lora2_gui, lora3_gui, lora4_gui, lora5_gui], scroll_to_output=True)
|
1667 |
upload_button_lora.upload(upload_file_lora, [upload_button_lora], [file_output_lora, upload_button_lora]).success(
|
1668 |
-
move_file_lora,
|
1669 |
-
[file_output_lora],
|
1670 |
-
[lora1_gui, lora2_gui, lora3_gui, lora4_gui, lora5_gui],
|
1671 |
-
scroll_to_output=True,
|
1672 |
-
)
|
1673 |
|
1674 |
use_textual_inversion_gui.change(set_textual_inversion_prompt, [use_textual_inversion_gui, prompt_gui, neg_prompt_gui, prompt_syntax_gui], [prompt_gui, neg_prompt_gui])
|
1675 |
|
1676 |
generate_from_image_btn_gui.click(
|
1677 |
predict_tags_wd,
|
1678 |
[input_image_gui, prompt_gui, image_algorithms, general_threshold_gui, character_threshold_gui],
|
1679 |
-
[series_dbt, character_dbt, prompt_gui, copy_button_dbt
|
1680 |
).success(
|
1681 |
compose_prompt_to_copy, [character_dbt, series_dbt, prompt_gui], [prompt_gui]
|
1682 |
).success(
|
@@ -1687,17 +1687,8 @@ with gr.Blocks(theme="NoCrypt/miku", elem_id="main", css=CSS) as app:
|
|
1687 |
insert_recom_prompt, [prompt_gui, neg_prompt_gui, recom_prompt_gui], [prompt_gui, neg_prompt_gui],
|
1688 |
)
|
1689 |
|
1690 |
-
v2b.input_components = [
|
1691 |
-
|
1692 |
-
series_dbt,
|
1693 |
-
character_dbt,
|
1694 |
-
prompt_gui,
|
1695 |
-
rating_dbt,
|
1696 |
-
aspect_ratio_dbt,
|
1697 |
-
length_dbt,
|
1698 |
-
identity_dbt,
|
1699 |
-
ban_tags_dbt,
|
1700 |
-
]
|
1701 |
|
1702 |
insert_prompt_gui.change(
|
1703 |
process_style_prompt,
|
@@ -1883,17 +1874,8 @@ with gr.Blocks(theme="NoCrypt/miku", elem_id="main", css=CSS) as app:
|
|
1883 |
|
1884 |
description_ui()
|
1885 |
|
1886 |
-
v2.input_components = [
|
1887 |
-
|
1888 |
-
input_copyright,
|
1889 |
-
input_character,
|
1890 |
-
input_general,
|
1891 |
-
input_rating,
|
1892 |
-
input_aspect_ratio,
|
1893 |
-
input_length,
|
1894 |
-
input_identity,
|
1895 |
-
input_ban_tags,
|
1896 |
-
]
|
1897 |
|
1898 |
translate_input_prompt_button.click(translate_prompt, inputs=[input_general], outputs=[input_general])
|
1899 |
translate_input_prompt_button.click(translate_prompt, inputs=[input_character], outputs=[input_character])
|
@@ -1910,9 +1892,8 @@ with gr.Blocks(theme="NoCrypt/miku", elem_id="main", css=CSS) as app:
|
|
1910 |
).success(
|
1911 |
insert_recom_prompt, inputs=[input_general, dummy_np, recom_prompt], outputs=[input_general, dummy_np],
|
1912 |
)
|
1913 |
-
copy_input_btn.click(compose_prompt_to_copy, inputs=[input_character, input_copyright, input_general], outputs=[input_tags_to_copy])
|
1914 |
-
gradio_copy_text, inputs=[input_tags_to_copy], js=COPY_ACTION_JS
|
1915 |
-
)
|
1916 |
|
1917 |
pick_random_character.click(select_random_character, [input_copyright, input_character], [input_copyright, input_character])
|
1918 |
|
|
|
842 |
|
843 |
## BEGIN MOD
|
844 |
CSS ="""
|
845 |
+
.gradio-container, #main {width:100%; height:100%; max-width:100%; padding-left:0; padding-right:0; margin-left:0; margin-right:0; !important;}
|
846 |
+
.contain {display: flex; flex-direction: column; !important;}
|
847 |
+
#component-0 {height: 100%; !important;}
|
848 |
+
#gallery {flex-grow: 1; !important;}
|
849 |
"""
|
850 |
## END MOD
|
851 |
|
|
|
866 |
return gr.update(value=task_name, choices=task_model_list)
|
867 |
|
868 |
## BEGIN MOD
|
869 |
+
with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", elem_id="main", css=CSS) as app:
|
870 |
gr.Markdown("# 🧩 DiffuseCraft Mod")
|
871 |
gr.Markdown(
|
872 |
f"""
|
|
|
1112 |
file_output_lora = gr.File(label="Uploaded LoRA", file_types=['.ckpt', '.pt', '.pth', '.safetensors', '.bin'], file_count="multiple", interactive=False, visible=False)
|
1113 |
upload_button_lora = gr.UploadButton(label="Upload LoRA from your disk (very slow)", file_types=['.ckpt' , '.pt', '.pth', '.safetensors', '.bin'], file_count="multiple")
|
1114 |
|
1115 |
+
with gr.Accordion("Advanced functions", open=False, visible=True) as menu_advanced:
|
1116 |
+
with gr.Accordion("IP-Adapter", open=False, visible=True) as menu_ipa:##############
|
1117 |
+
|
1118 |
+
IP_MODELS = sorted(list(set(IP_ADAPTERS_SD + IP_ADAPTERS_SDXL)))
|
1119 |
+
MODE_IP_OPTIONS = ["original", "style", "layout", "style+layout"]
|
1120 |
+
|
1121 |
+
with gr.Accordion("IP-Adapter 1", open=False, visible=True):
|
1122 |
+
image_ip1 = gr.Image(label="IP Image", type="filepath")
|
1123 |
+
mask_ip1 = gr.Image(label="IP Mask", type="filepath")
|
1124 |
+
model_ip1 = gr.Dropdown(value="plus_face", label="Model", choices=IP_MODELS)
|
1125 |
+
mode_ip1 = gr.Dropdown(value="original", label="Mode", choices=MODE_IP_OPTIONS)
|
1126 |
+
scale_ip1 = gr.Slider(minimum=0., maximum=2., step=0.01, value=0.7, label="Scale")
|
1127 |
+
with gr.Accordion("IP-Adapter 2", open=False, visible=True):
|
1128 |
+
image_ip2 = gr.Image(label="IP Image", type="filepath")
|
1129 |
+
mask_ip2 = gr.Image(label="IP Mask (optional)", type="filepath")
|
1130 |
+
model_ip2 = gr.Dropdown(value="base", label="Model", choices=IP_MODELS)
|
1131 |
+
mode_ip2 = gr.Dropdown(value="style", label="Mode", choices=MODE_IP_OPTIONS)
|
1132 |
+
scale_ip2 = gr.Slider(minimum=0., maximum=2., step=0.01, value=0.7, label="Scale")
|
1133 |
+
|
1134 |
+
with gr.Accordion("ControlNet / Img2img / Inpaint", open=False, visible=True) as menu_i2i:
|
1135 |
+
image_control = gr.Image(label="Image ControlNet/Inpaint/Img2img", type="filepath")
|
1136 |
+
image_mask_gui = gr.Image(label="Image Mask", type="filepath")
|
1137 |
+
strength_gui = gr.Slider(
|
1138 |
+
minimum=0.01, maximum=1.0, step=0.01, value=0.55, label="Strength",
|
1139 |
+
info="This option adjusts the level of changes for img2img and inpainting."
|
1140 |
+
)
|
1141 |
+
image_resolution_gui = gr.Slider(minimum=64, maximum=2048, step=64, value=1024, label="Image Resolution")
|
1142 |
+
preprocessor_name_gui = gr.Dropdown(label="Preprocessor Name", choices=preprocessor_controlnet["canny"], value=preprocessor_controlnet["canny"][0])
|
1143 |
+
|
1144 |
+
def change_preprocessor_choices(task):
|
1145 |
+
task = task_stablepy[task]
|
1146 |
+
if task in preprocessor_controlnet.keys():
|
1147 |
+
choices_task = preprocessor_controlnet[task]
|
1148 |
+
else:
|
1149 |
+
choices_task = preprocessor_controlnet["canny"]
|
1150 |
+
return gr.update(choices=choices_task, value=choices_task[0])
|
1151 |
+
|
1152 |
+
task_gui.change(
|
1153 |
+
change_preprocessor_choices,
|
1154 |
+
[task_gui],
|
1155 |
+
[preprocessor_name_gui],
|
1156 |
+
)
|
1157 |
+
preprocess_resolution_gui = gr.Slider(minimum=64, maximum=2048, step=64, value=512, label="Preprocess Resolution")
|
1158 |
+
low_threshold_gui = gr.Slider(minimum=1, maximum=255, step=1, value=100, label="Canny low threshold")
|
1159 |
+
high_threshold_gui = gr.Slider(minimum=1, maximum=255, step=1, value=200, label="Canny high threshold")
|
1160 |
+
value_threshold_gui = gr.Slider(minimum=1, maximum=2.0, step=0.01, value=0.1, label="Hough value threshold (MLSD)")
|
1161 |
+
distance_threshold_gui = gr.Slider(minimum=1, maximum=20.0, step=0.01, value=0.1, label="Hough distance threshold (MLSD)")
|
1162 |
+
control_net_output_scaling_gui = gr.Slider(minimum=0, maximum=5.0, step=0.1, value=1, label="ControlNet Output Scaling in UNet")
|
1163 |
+
control_net_start_threshold_gui = gr.Slider(minimum=0, maximum=1, step=0.01, value=0, label="ControlNet Start Threshold (%)")
|
1164 |
+
control_net_stop_threshold_gui = gr.Slider(minimum=0, maximum=1, step=0.01, value=1, label="ControlNet Stop Threshold (%)")
|
1165 |
+
|
1166 |
+
with gr.Accordion("T2I adapter", open=False, visible=True) as menu_t2i:
|
1167 |
+
t2i_adapter_preprocessor_gui = gr.Checkbox(value=True, label="T2i Adapter Preprocessor")
|
1168 |
+
adapter_conditioning_scale_gui = gr.Slider(minimum=0, maximum=5., step=0.1, value=1, label="Adapter Conditioning Scale")
|
1169 |
+
adapter_conditioning_factor_gui = gr.Slider(minimum=0, maximum=1., step=0.01, value=0.55, label="Adapter Conditioning Factor (%)")
|
1170 |
+
|
1171 |
+
with gr.Accordion("Styles", open=False, visible=True) as menu_styles:
|
1172 |
+
|
1173 |
+
try:
|
1174 |
+
style_names_found = sd_gen.model.STYLE_NAMES
|
1175 |
+
except:
|
1176 |
+
style_names_found = STYLE_NAMES
|
1177 |
+
|
1178 |
+
style_prompt_gui = gr.Dropdown(
|
1179 |
+
style_names_found,
|
1180 |
+
multiselect=True,
|
1181 |
+
value=None,
|
1182 |
+
label="Style Prompt",
|
1183 |
+
interactive=True,
|
1184 |
+
)
|
1185 |
+
style_json_gui = gr.File(label="Style JSON File")
|
1186 |
+
style_button = gr.Button("Load styles")
|
1187 |
+
|
1188 |
+
def load_json_style_file(json):
|
1189 |
+
if not sd_gen.model:
|
1190 |
+
gr.Info("First load the model")
|
1191 |
+
return gr.update(value=None, choices=STYLE_NAMES)
|
1192 |
+
|
1193 |
+
sd_gen.model.load_style_file(json)
|
1194 |
+
gr.Info(f"{len(sd_gen.model.STYLE_NAMES)} styles loaded")
|
1195 |
+
return gr.update(value=None, choices=sd_gen.model.STYLE_NAMES)
|
1196 |
+
|
1197 |
+
style_button.click(load_json_style_file, [style_json_gui], [style_prompt_gui])
|
1198 |
+
|
1199 |
+
with gr.Accordion("Textual inversion", open=False, visible=True) as menu_ti:
|
1200 |
+
active_textual_inversion_gui = gr.Checkbox(value=False, label="Active Textual Inversion in prompt")
|
1201 |
+
use_textual_inversion_gui = gr.CheckboxGroup(choices=get_embed_list(get_model_pipeline(model_name_gui.value)) if active_textual_inversion_gui.value else [], value=None, label="Use Textual Invertion in prompt")
|
1202 |
+
def update_textual_inversion_gui(active_textual_inversion_gui, model_name_gui):
|
1203 |
+
return gr.update(choices=get_embed_list(get_model_pipeline(model_name_gui)) if active_textual_inversion_gui else [])
|
1204 |
+
active_textual_inversion_gui.change(update_textual_inversion_gui, [active_textual_inversion_gui, model_name_gui], [use_textual_inversion_gui])
|
1205 |
+
model_name_gui.change(update_textual_inversion_gui, [active_textual_inversion_gui, model_name_gui], [use_textual_inversion_gui])
|
1206 |
+
|
1207 |
+
with gr.Accordion("Detailfix", open=False, visible=True) as menu_detail:
|
1208 |
+
|
1209 |
+
# Adetailer Inpaint Only
|
1210 |
+
adetailer_inpaint_only_gui = gr.Checkbox(label="Inpaint only", value=True)
|
1211 |
+
|
1212 |
+
# Adetailer Verbose
|
1213 |
+
adetailer_verbose_gui = gr.Checkbox(label="Verbose", value=False)
|
1214 |
+
|
1215 |
+
# Adetailer Sampler
|
1216 |
+
adetailer_sampler_options = ["Use same sampler"] + scheduler_names[:-1]
|
1217 |
+
adetailer_sampler_gui = gr.Dropdown(label="Adetailer sampler:", choices=adetailer_sampler_options, value="Use same sampler")
|
1218 |
+
|
1219 |
+
with gr.Accordion("Detailfix A", open=False, visible=True):
|
1220 |
+
# Adetailer A
|
1221 |
+
adetailer_active_a_gui = gr.Checkbox(label="Enable Adetailer A", value=False)
|
1222 |
+
prompt_ad_a_gui = gr.Textbox(label="Main prompt", placeholder="Main prompt will be use", lines=3)
|
1223 |
+
negative_prompt_ad_a_gui = gr.Textbox(label="Negative prompt", placeholder="Main negative prompt will be use", lines=3)
|
1224 |
+
strength_ad_a_gui = gr.Number(label="Strength:", value=0.35, step=0.01, minimum=0.01, maximum=1.0)
|
1225 |
+
face_detector_ad_a_gui = gr.Checkbox(label="Face detector", value=True)
|
1226 |
+
person_detector_ad_a_gui = gr.Checkbox(label="Person detector", value=True)
|
1227 |
+
hand_detector_ad_a_gui = gr.Checkbox(label="Hand detector", value=False)
|
1228 |
+
mask_dilation_a_gui = gr.Number(label="Mask dilation:", value=4, minimum=1)
|
1229 |
+
mask_blur_a_gui = gr.Number(label="Mask blur:", value=4, minimum=1)
|
1230 |
+
mask_padding_a_gui = gr.Number(label="Mask padding:", value=32, minimum=1)
|
1231 |
+
|
1232 |
+
with gr.Accordion("Detailfix B", open=False, visible=True):
|
1233 |
+
# Adetailer B
|
1234 |
+
adetailer_active_b_gui = gr.Checkbox(label="Enable Adetailer B", value=False)
|
1235 |
+
prompt_ad_b_gui = gr.Textbox(label="Main prompt", placeholder="Main prompt will be use", lines=3)
|
1236 |
+
negative_prompt_ad_b_gui = gr.Textbox(label="Negative prompt", placeholder="Main negative prompt will be use", lines=3)
|
1237 |
+
strength_ad_b_gui = gr.Number(label="Strength:", value=0.35, step=0.01, minimum=0.01, maximum=1.0)
|
1238 |
+
face_detector_ad_b_gui = gr.Checkbox(label="Face detector", value=True)
|
1239 |
+
person_detector_ad_b_gui = gr.Checkbox(label="Person detector", value=True)
|
1240 |
+
hand_detector_ad_b_gui = gr.Checkbox(label="Hand detector", value=False)
|
1241 |
+
mask_dilation_b_gui = gr.Number(label="Mask dilation:", value=4, minimum=1)
|
1242 |
+
mask_blur_b_gui = gr.Number(label="Mask blur:", value=4, minimum=1)
|
1243 |
+
mask_padding_b_gui = gr.Number(label="Mask padding:", value=32, minimum=1)
|
1244 |
+
|
1245 |
+
with gr.Accordion("Other settings", open=False, visible=True) as menu_other:
|
1246 |
+
image_previews_gui = gr.Checkbox(value=True, label="Image Previews")
|
1247 |
+
hires_before_adetailer_gui = gr.Checkbox(value=False, label="Hires Before Adetailer")
|
1248 |
+
hires_after_adetailer_gui = gr.Checkbox(value=True, label="Hires After Adetailer")
|
1249 |
+
generator_in_cpu_gui = gr.Checkbox(value=False, label="Generator in CPU")
|
1250 |
+
|
1251 |
+
with gr.Accordion("More settings", open=False, visible=False):
|
1252 |
+
loop_generation_gui = gr.Slider(minimum=1, value=1, label="Loop Generation")
|
1253 |
+
retain_task_cache_gui = gr.Checkbox(value=False, label="Retain task model in cache")
|
1254 |
+
leave_progress_bar_gui = gr.Checkbox(value=True, label="Leave Progress Bar")
|
1255 |
+
disable_progress_bar_gui = gr.Checkbox(value=False, label="Disable Progress Bar")
|
1256 |
+
display_images_gui = gr.Checkbox(value=True, label="Display Images")
|
1257 |
+
save_generated_images_gui = gr.Checkbox(value=False, label="Save Generated Images")
|
1258 |
+
image_storage_location_gui = gr.Textbox(value="./images", label="Image Storage Location")
|
1259 |
+
retain_compel_previous_load_gui = gr.Checkbox(value=False, label="Retain Compel Previous Load")
|
1260 |
+
retain_detailfix_model_previous_load_gui = gr.Checkbox(value=False, label="Retain Detailfix Model Previous Load")
|
1261 |
+
retain_hires_model_previous_load_gui = gr.Checkbox(value=False, label="Retain Hires Model Previous Load")
|
1262 |
+
xformers_memory_efficient_attention_gui = gr.Checkbox(value=False, label="Xformers Memory Efficient Attention")
|
1263 |
+
|
1264 |
+
with gr.Accordion("Examples and help", open=False, visible=True) as menu_example:
|
1265 |
gr.Examples(
|
1266 |
examples=[
|
1267 |
[
|
|
|
1597 |
interface_mode_gui.change(
|
1598 |
change_interface_mode,
|
1599 |
[interface_mode_gui],
|
1600 |
+
[menu_model, menu_from_image, menu_negative, menu_gen, menu_hires, menu_lora, menu_advanced,
|
1601 |
+
menu_example, task_gui, quick_speed_gui]
|
1602 |
)
|
1603 |
model_name_gui.change(get_t2i_model_info, [model_name_gui], [model_info_gui])
|
1604 |
|
|
|
1646 |
.success(set_lora_trigger, [lora4_gui], [lora4_trigger_gui, lora4_copy_button, lora4_desc_gui, lora4_gui], scroll_to_output=True)
|
1647 |
lora5_gui.change(set_lora_prompt, [prompt_gui, prompt_syntax_gui, lora1_gui, lora_scale_1_gui, lora2_gui, lora_scale_2_gui, lora3_gui, lora_scale_3_gui, lora4_gui, lora_scale_4_gui, lora5_gui, lora_scale_5_gui], [prompt_gui])\
|
1648 |
.success(set_lora_trigger, [lora5_gui], [lora5_trigger_gui, lora5_copy_button, lora5_desc_gui, lora5_gui], scroll_to_output=True)
|
1649 |
+
gr.on(
|
1650 |
+
triggers=[lora_scale_1_gui.change, lora_scale_2_gui.change, lora_scale_3_gui.change,\
|
1651 |
+
lora_scale_4_gui.change, lora_scale_5_gui.change, prompt_syntax_gui.change],
|
1652 |
+
fn=set_lora_prompt,
|
1653 |
+
inputs=[prompt_gui, prompt_syntax_gui, lora1_gui, lora_scale_1_gui, lora2_gui, lora_scale_2_gui,\
|
1654 |
+
lora3_gui, lora_scale_3_gui, lora4_gui, lora_scale_4_gui, lora5_gui, lora_scale_5_gui],
|
1655 |
+
outputs=[prompt_gui],
|
1656 |
+
)
|
1657 |
lora1_copy_button.click(apply_lora_prompt, [prompt_gui, lora1_trigger_gui], [prompt_gui])
|
1658 |
lora2_copy_button.click(apply_lora_prompt, [prompt_gui, lora2_trigger_gui], [prompt_gui])
|
1659 |
lora3_copy_button.click(apply_lora_prompt, [prompt_gui, lora3_trigger_gui], [prompt_gui])
|
|
|
1669 |
search_civitai_result_lora.change(select_civitai_lora, [search_civitai_result_lora], [text_lora, search_civitai_desc_lora], scroll_to_output=True)
|
1670 |
button_lora.click(get_my_lora, [text_lora], [lora1_gui, lora2_gui, lora3_gui, lora4_gui, lora5_gui], scroll_to_output=True)
|
1671 |
upload_button_lora.upload(upload_file_lora, [upload_button_lora], [file_output_lora, upload_button_lora]).success(
|
1672 |
+
move_file_lora, [file_output_lora], [lora1_gui, lora2_gui, lora3_gui, lora4_gui, lora5_gui], scroll_to_output=True)
|
|
|
|
|
|
|
|
|
1673 |
|
1674 |
use_textual_inversion_gui.change(set_textual_inversion_prompt, [use_textual_inversion_gui, prompt_gui, neg_prompt_gui, prompt_syntax_gui], [prompt_gui, neg_prompt_gui])
|
1675 |
|
1676 |
generate_from_image_btn_gui.click(
|
1677 |
predict_tags_wd,
|
1678 |
[input_image_gui, prompt_gui, image_algorithms, general_threshold_gui, character_threshold_gui],
|
1679 |
+
[series_dbt, character_dbt, prompt_gui, copy_button_dbt],
|
1680 |
).success(
|
1681 |
compose_prompt_to_copy, [character_dbt, series_dbt, prompt_gui], [prompt_gui]
|
1682 |
).success(
|
|
|
1687 |
insert_recom_prompt, [prompt_gui, neg_prompt_gui, recom_prompt_gui], [prompt_gui, neg_prompt_gui],
|
1688 |
)
|
1689 |
|
1690 |
+
v2b.input_components = [model_name_dbt, series_dbt, character_dbt, prompt_gui,
|
1691 |
+
rating_dbt, aspect_ratio_dbt, length_dbt, identity_dbt, ban_tags_dbt]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1692 |
|
1693 |
insert_prompt_gui.change(
|
1694 |
process_style_prompt,
|
|
|
1874 |
|
1875 |
description_ui()
|
1876 |
|
1877 |
+
v2.input_components = [model_name, input_copyright, input_character, input_general,
|
1878 |
+
input_rating, input_aspect_ratio, input_length, input_identity, input_ban_tags]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1879 |
|
1880 |
translate_input_prompt_button.click(translate_prompt, inputs=[input_general], outputs=[input_general])
|
1881 |
translate_input_prompt_button.click(translate_prompt, inputs=[input_character], outputs=[input_character])
|
|
|
1892 |
).success(
|
1893 |
insert_recom_prompt, inputs=[input_general, dummy_np, recom_prompt], outputs=[input_general, dummy_np],
|
1894 |
)
|
1895 |
+
copy_input_btn.click(compose_prompt_to_copy, inputs=[input_character, input_copyright, input_general], outputs=[input_tags_to_copy])\
|
1896 |
+
.success(gradio_copy_text, inputs=[input_tags_to_copy], js=COPY_ACTION_JS)
|
|
|
1897 |
|
1898 |
pick_random_character.click(select_random_character, [input_copyright, input_character], [input_copyright, input_character])
|
1899 |
|
lora_dict.json
CHANGED
@@ -209,6 +209,13 @@
|
|
209 |
"https://civitai.com/models/325531",
|
210 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/187ad035-b560-4caf-8287-c3ea7f658d2b/width=450/16498861.jpeg"
|
211 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
"BallsTesticles_sucking_LoRa__PonyXL": [
|
213 |
"testicle sucking, testicles, penis / testicles in mouth",
|
214 |
"Pony",
|
@@ -314,6 +321,20 @@
|
|
314 |
"https://civitai.com/models/539254",
|
315 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/f1a04fff-620a-4ff5-bb24-caaac08f94f0/width=450/17282530.jpeg"
|
316 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
"Concept_2_dicks_1_mouth_double_barrel_blowjob": [
|
318 |
"2dicks1mouth, double barrel blowjob, multiple penises, fellatio, blowjob",
|
319 |
"Pony",
|
@@ -482,6 +503,13 @@
|
|
482 |
"https://civitai.com/models/554308",
|
483 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/7aadace1-0159-4ef9-bb6e-09602ead9e29/width=450/18303807.jpeg"
|
484 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
"GachamiHoYoXL_ANI31_lokr_V42310": [
|
486 |
"grey background, [:your tags here:2]",
|
487 |
"SDXL 1.0",
|
@@ -727,6 +755,13 @@
|
|
727 |
"https://civitai.com/models/537044",
|
728 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/21cb499b-78e0-4099-94ac-c6ecc8d6765b/width=450/17146842.jpeg"
|
729 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
730 |
"KabedompovPonyXL": [
|
731 |
"kabedon / pov hands",
|
732 |
"Pony",
|
@@ -1091,6 +1126,13 @@
|
|
1091 |
"https://civitai.com/models/392579",
|
1092 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/fd660261-765f-4ed2-af92-810a9587bfc6/width=450/11300400.jpeg"
|
1093 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1094 |
"Sailor_Swimsuit_PONY": [
|
1095 |
"ssswimsuit / highleg, one-piece swimsuit, sailor swimsuit, sailor collar",
|
1096 |
"Pony",
|
@@ -1469,6 +1511,13 @@
|
|
1469 |
"https://civitai.com/models/528284",
|
1470 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/4ab90a51-eeb2-4caa-b562-4ca7ef86c3eb/width=450/16543700.jpeg"
|
1471 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1472 |
"_sdxl-transchool-pony": [
|
1473 |
"transchool",
|
1474 |
"Pony",
|
@@ -2260,6 +2309,20 @@
|
|
2260 |
"https://civitai.com/models/48999",
|
2261 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/bdb3fb3d-0b58-4f64-c355-d5a92cd1a900/width=450/579582.jpeg"
|
2262 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2263 |
"full_encasement": [
|
2264 |
"encasement / in container / fetal position",
|
2265 |
"Pony",
|
@@ -4017,6 +4080,13 @@
|
|
4017 |
"https://civitai.com/models/537445",
|
4018 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/ad654bb6-4edb-43a0-84ba-44e5cd96d12b/width=450/17342314.jpeg"
|
4019 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4020 |
"tongue_in_foreskin_XL_CAME_3": [
|
4021 |
"foreskinlicsolo, 1girl, 1boy, hetero, penis, oral, licking penis,arms behind back / foreskinpullik, 1girl, penis, 1boy, tongue, oral, hetero, fellatio, tongue out, licking penis, licking,pov, solo focus, foreskin,holding / doubforeskinlic, ,2girls,licking,tongue, tongue out,pov,huge penis,foreskin",
|
4022 |
"Pony",
|
@@ -4108,6 +4178,20 @@
|
|
4108 |
"https://civitai.com/models/292024",
|
4109 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/381c91b8-5f2d-4f6e-9416-fc76beab210b/width=450/7299766.jpeg"
|
4110 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4111 |
"underanglexl16": [
|
4112 |
" from below,shoes,delicate detailed eyes",
|
4113 |
"SDXL 1.0",
|
@@ -4185,6 +4269,13 @@
|
|
4185 |
"https://civitai.com/models/312746",
|
4186 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/0c1c723e-a888-4058-81d8-1f3b9868d1c7/width=450/6830824.jpeg"
|
4187 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4188 |
"wallsex": [
|
4189 |
"wallsex / against wall / breast press",
|
4190 |
"Pony",
|
|
|
209 |
"https://civitai.com/models/325531",
|
210 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/187ad035-b560-4caf-8287-c3ea7f658d2b/width=450/16498861.jpeg"
|
211 |
],
|
212 |
+
"Backtits-PonyXL-v0_7": [
|
213 |
+
"breasts apart / breast gap / cleavage",
|
214 |
+
"Pony",
|
215 |
+
"Lying Back Breast-Morph / Backtits - PONY",
|
216 |
+
"https://civitai.com/models/483381",
|
217 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/9b8d0a91-22a5-4380-9066-470f82124de5/width=450/18326439.jpeg"
|
218 |
+
],
|
219 |
"BallsTesticles_sucking_LoRa__PonyXL": [
|
220 |
"testicle sucking, testicles, penis / testicles in mouth",
|
221 |
"Pony",
|
|
|
321 |
"https://civitai.com/models/539254",
|
322 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/f1a04fff-620a-4ff5-bb24-caaac08f94f0/width=450/17282530.jpeg"
|
323 |
],
|
324 |
+
"Competitive_Swimsuit_XL_V1_0": [
|
325 |
+
"competitive swimsuit",
|
326 |
+
"SDXL 1.0",
|
327 |
+
"\u7af6\u6cf3\u6c34\u7740/competitive swimsuit",
|
328 |
+
"https://civitai.com/models/552104",
|
329 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/cb7f232a-05e2-43cd-aaae-b71408a12f12/width=450/18275491.jpeg"
|
330 |
+
],
|
331 |
+
"Competitive_Swimsuit_pony_V1_0": [
|
332 |
+
"competitive swimsuit",
|
333 |
+
"Pony",
|
334 |
+
"\u7af6\u6cf3\u6c34\u7740/competitive swimsuit",
|
335 |
+
"https://civitai.com/models/552104",
|
336 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/fa5140b3-5335-47fc-bea2-9edd4d1a53c9/width=450/18131620.jpeg"
|
337 |
+
],
|
338 |
"Concept_2_dicks_1_mouth_double_barrel_blowjob": [
|
339 |
"2dicks1mouth, double barrel blowjob, multiple penises, fellatio, blowjob",
|
340 |
"Pony",
|
|
|
503 |
"https://civitai.com/models/554308",
|
504 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/7aadace1-0159-4ef9-bb6e-09602ead9e29/width=450/18303807.jpeg"
|
505 |
],
|
506 |
+
"Fundoshi_x_Pubic_Hair-000002": [
|
507 |
+
"hairy_fundoshi",
|
508 |
+
"Pony",
|
509 |
+
"Fundoshi x Pubic Hair",
|
510 |
+
"https://civitai.com/models/554770",
|
511 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/4ca0fb31-a8c1-48a2-b688-ab9c8e42f885/width=450/18319217.jpeg"
|
512 |
+
],
|
513 |
"GachamiHoYoXL_ANI31_lokr_V42310": [
|
514 |
"grey background, [:your tags here:2]",
|
515 |
"SDXL 1.0",
|
|
|
755 |
"https://civitai.com/models/537044",
|
756 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/21cb499b-78e0-4099-94ac-c6ecc8d6765b/width=450/17146842.jpeg"
|
757 |
],
|
758 |
+
"Just_The_Tip_XL": [
|
759 |
+
"1woman, imminent_penetration,, just_the_tip, uncensored pussy, anus, 1boy, large penis, JTT / imminent vaginal, imminent_vaginal, penis on pussy, penis_on_pussy / imminent anal, imminent_anal, penis on anus, penis_on_anus / imminent_penetration:1.2, just the tip:1.2, just_the_tip:1.2, ",
|
760 |
+
"Pony",
|
761 |
+
"Just_The_Tip_XL",
|
762 |
+
"https://civitai.com/models/537044",
|
763 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/4d08fbef-40ea-4016-9bf3-54e51ce6c1a9/width=450/18366359.jpeg"
|
764 |
+
],
|
765 |
"KabedompovPonyXL": [
|
766 |
"kabedon / pov hands",
|
767 |
"Pony",
|
|
|
1126 |
"https://civitai.com/models/392579",
|
1127 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/fd660261-765f-4ed2-af92-810a9587bfc6/width=450/11300400.jpeg"
|
1128 |
],
|
1129 |
+
"STTLPony": [
|
1130 |
+
"sttldunf star trek black and red uniform / sttldunf star trek black and blue uniform / sttldunf star trek black and yellow uniform / black pants",
|
1131 |
+
"Pony",
|
1132 |
+
"Star Trek Lower Decks uniforms (pony)",
|
1133 |
+
"https://civitai.com/models/554864",
|
1134 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/6db35bb0-1019-4e36-bc72-0692e6f33a76/width=450/18317576.jpeg"
|
1135 |
+
],
|
1136 |
"Sailor_Swimsuit_PONY": [
|
1137 |
"ssswimsuit / highleg, one-piece swimsuit, sailor swimsuit, sailor collar",
|
1138 |
"Pony",
|
|
|
1511 |
"https://civitai.com/models/528284",
|
1512 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/4ab90a51-eeb2-4caa-b562-4ca7ef86c3eb/width=450/16543700.jpeg"
|
1513 |
],
|
1514 |
+
"_sdxl-sasayaki-pony": [
|
1515 |
+
"sasayaki / sasayaki pov",
|
1516 |
+
"Pony",
|
1517 |
+
"for PONY, ASMR-like? part where whispering in ear. (ASMR\u7684\u306a\uff1f\u8033\u6253\u3061\u3057\u3066\u3044\u308b\u3068\u3053\u308d) LoRA",
|
1518 |
+
"https://civitai.com/models/555199",
|
1519 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/1e486aae-2320-45fd-8e84-40bc901e928e/width=450/18336321.jpeg"
|
1520 |
+
],
|
1521 |
"_sdxl-transchool-pony": [
|
1522 |
"transchool",
|
1523 |
"Pony",
|
|
|
2309 |
"https://civitai.com/models/48999",
|
2310 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/bdb3fb3d-0b58-4f64-c355-d5a92cd1a900/width=450/579582.jpeg"
|
2311 |
],
|
2312 |
+
"fsn_style_pony": [
|
2313 |
+
"fsn_style",
|
2314 |
+
"Pony",
|
2315 |
+
"Fate Series Anime Style LoRA (Pony)",
|
2316 |
+
"https://civitai.com/models/429069",
|
2317 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/706692ff-2c37-4e7d-a229-a8c6c1ffa049/width=450/18314194.jpeg"
|
2318 |
+
],
|
2319 |
+
"fsn_ubw_style_pony": [
|
2320 |
+
"fsn_ubw_style",
|
2321 |
+
"Pony",
|
2322 |
+
"Fate Series Anime Style LoRA (Pony)",
|
2323 |
+
"https://civitai.com/models/429069",
|
2324 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/99b4c136-9d58-4a6e-87ae-5429aeb5a0bd/width=450/11205806.jpeg"
|
2325 |
+
],
|
2326 |
"full_encasement": [
|
2327 |
"encasement / in container / fetal position",
|
2328 |
"Pony",
|
|
|
4080 |
"https://civitai.com/models/537445",
|
4081 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/ad654bb6-4edb-43a0-84ba-44e5cd96d12b/width=450/17342314.jpeg"
|
4082 |
],
|
4083 |
+
"tongue_around_penis": [
|
4084 |
+
"tongue_around_penis, licking penis, ",
|
4085 |
+
"Pony",
|
4086 |
+
"Hentai Emporium - NSFW Warning",
|
4087 |
+
"https://civitai.com/models/466594",
|
4088 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/da3e10ca-2e5a-4328-a593-cc279db10dc2/width=450/18313889.jpeg"
|
4089 |
+
],
|
4090 |
"tongue_in_foreskin_XL_CAME_3": [
|
4091 |
"foreskinlicsolo, 1girl, 1boy, hetero, penis, oral, licking penis,arms behind back / foreskinpullik, 1girl, penis, 1boy, tongue, oral, hetero, fellatio, tongue out, licking penis, licking,pov, solo focus, foreskin,holding / doubforeskinlic, ,2girls,licking,tongue, tongue out,pov,huge penis,foreskin",
|
4092 |
"Pony",
|
|
|
4178 |
"https://civitai.com/models/292024",
|
4179 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/381c91b8-5f2d-4f6e-9416-fc76beab210b/width=450/7299766.jpeg"
|
4180 |
],
|
4181 |
+
"under_the_table_blowjob": [
|
4182 |
+
"under_the_table_blowjob",
|
4183 |
+
"Pony",
|
4184 |
+
"Hentai Emporium - NSFW Warning",
|
4185 |
+
"https://civitai.com/models/466594",
|
4186 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/88bd026f-0360-45ef-9c30-b867640ab7fe/width=450/16917567.jpeg"
|
4187 |
+
],
|
4188 |
+
"under_the_table_peek": [
|
4189 |
+
"under_the_table_peak",
|
4190 |
+
"Pony",
|
4191 |
+
"Hentai Emporium - NSFW Warning",
|
4192 |
+
"https://civitai.com/models/466594",
|
4193 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/5d30ac4a-1cef-4a57-8d63-595877f16e92/width=450/16917119.jpeg"
|
4194 |
+
],
|
4195 |
"underanglexl16": [
|
4196 |
" from below,shoes,delicate detailed eyes",
|
4197 |
"SDXL 1.0",
|
|
|
4269 |
"https://civitai.com/models/312746",
|
4270 |
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/0c1c723e-a888-4058-81d8-1f3b9868d1c7/width=450/6830824.jpeg"
|
4271 |
],
|
4272 |
+
"wadingpool_XL_v1": [
|
4273 |
+
"wading pool",
|
4274 |
+
"SDXL 1.0",
|
4275 |
+
"wading pool / \u30d3\u30cb\u30fc\u30eb\u30d7\u30fc\u30eb / \u5b50\u4f9b\u7528\u30d7\u30fc\u30eb",
|
4276 |
+
"https://civitai.com/models/555170",
|
4277 |
+
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/d15c55f6-0fa8-4a6f-8ba8-be1ab703a2fe/width=450/18333780.jpeg"
|
4278 |
+
],
|
4279 |
"wallsex": [
|
4280 |
"wallsex / against wall / breast press",
|
4281 |
"Pony",
|
modutils.py
CHANGED
@@ -21,24 +21,20 @@ def get_user_agent():
|
|
21 |
def change_interface_mode(mode: str):
|
22 |
if mode == "Fast":
|
23 |
return gr.update(open=False), gr.update(visible=True), gr.update(open=False), gr.update(open=False),\
|
24 |
-
gr.update(visible=True), gr.update(open=False), gr.update(visible=True), gr.update(
|
25 |
-
gr.update(visible=True), gr.update(
|
26 |
-
gr.update(visible=True), gr.update(visible=True), gr.update(value="Fast")
|
27 |
elif mode == "Simple": # t2i mode
|
28 |
-
return gr.update(open=True), gr.update(visible=True), gr.update(open=
|
29 |
-
gr.update(visible=True), gr.update(open=False), gr.update(visible=False), gr.update(
|
30 |
-
gr.update(visible=False), gr.update(
|
31 |
-
gr.update(visible=False), gr.update(visible=False), gr.update(value="Standard")
|
32 |
elif mode == "LoRA": # t2i LoRA mode
|
33 |
return gr.update(open=True), gr.update(visible=True), gr.update(open=True), gr.update(open=False),\
|
34 |
-
gr.update(visible=True), gr.update(open=True), gr.update(visible=True), gr.update(
|
35 |
-
gr.update(visible=
|
36 |
-
gr.update(visible=True), gr.update(visible=False), gr.update(value="Standard")
|
37 |
else: # Standard
|
38 |
return gr.update(open=False), gr.update(visible=True), gr.update(open=False), gr.update(open=False),\
|
39 |
-
gr.update(visible=True), gr.update(open=False), gr.update(visible=True), gr.update(
|
40 |
-
gr.update(visible=True), gr.update(
|
41 |
-
gr.update(visible=True), gr.update(visible=True), gr.update(value="Standard")
|
42 |
|
43 |
|
44 |
def get_model_list(directory_path):
|
@@ -250,8 +246,8 @@ def save_gallery_images(images):
|
|
250 |
|
251 |
|
252 |
optimization_list = {
|
253 |
-
"None": [28, 7., 'Euler a', False, None, 1.],
|
254 |
-
"Default": [28, 7., 'Euler a', False, None, 1.],
|
255 |
"SPO": [28, 7., 'Euler a', True, 'loras/spo_sdxl_10ep_4k-data_lora_diffusers.safetensors', 1.],
|
256 |
"DPO": [28, 7., 'Euler a', True, 'loras/sdxl-DPO-LoRA.safetensors', 1.],
|
257 |
"DPO Turbo": [8, 2.5, 'LCM', True, 'loras/sd_xl_dpo_turbo_lora_v1-128dim.safetensors', 1.],
|
@@ -411,8 +407,8 @@ def get_lora_tupled_list(lora_model_list):
|
|
411 |
|
412 |
def set_lora_trigger(lora_gui: str):
|
413 |
from pathlib import Path
|
414 |
-
if lora_gui == None: return gr.update(value="", visible=False), gr.update(visible=False),\
|
415 |
-
gr.update(value="", visible=False), gr.update(value="", visible=True)
|
416 |
path = Path(lora_gui)
|
417 |
new_path = Path(f'{path.parent.name}/{escape_lora_basename(path.stem)}{path.suffix}')
|
418 |
if not new_path.stem in lora_trigger_dict.keys() and not str(path) in set(get_private_lora_model_lists() + get_model_list(directory_loras)):
|
@@ -867,7 +863,6 @@ def get_model_pipeline(repo_id: str):
|
|
867 |
return default
|
868 |
else:
|
869 |
if model.private or model.gated: return default
|
870 |
-
|
871 |
tags = model.tags
|
872 |
if not 'diffusers' in tags: return default
|
873 |
if 'diffusers:StableDiffusionXLPipeline' in tags:
|
|
|
21 |
def change_interface_mode(mode: str):
|
22 |
if mode == "Fast":
|
23 |
return gr.update(open=False), gr.update(visible=True), gr.update(open=False), gr.update(open=False),\
|
24 |
+
gr.update(visible=True), gr.update(open=False), gr.update(visible=True), gr.update(open=False),\
|
25 |
+
gr.update(visible=True), gr.update(value="Fast")
|
|
|
26 |
elif mode == "Simple": # t2i mode
|
27 |
+
return gr.update(open=True), gr.update(visible=True), gr.update(open=False), gr.update(open=False),\
|
28 |
+
gr.update(visible=True), gr.update(open=False), gr.update(visible=False), gr.update(open=True),\
|
29 |
+
gr.update(visible=False), gr.update(value="Standard")
|
|
|
30 |
elif mode == "LoRA": # t2i LoRA mode
|
31 |
return gr.update(open=True), gr.update(visible=True), gr.update(open=True), gr.update(open=False),\
|
32 |
+
gr.update(visible=True), gr.update(open=True), gr.update(visible=True), gr.update(open=False),\
|
33 |
+
gr.update(visible=False), gr.update(value="Standard")
|
|
|
34 |
else: # Standard
|
35 |
return gr.update(open=False), gr.update(visible=True), gr.update(open=False), gr.update(open=False),\
|
36 |
+
gr.update(visible=True), gr.update(open=False), gr.update(visible=True), gr.update(open=False),\
|
37 |
+
gr.update(visible=True), gr.update(value="Standard")
|
|
|
38 |
|
39 |
|
40 |
def get_model_list(directory_path):
|
|
|
246 |
|
247 |
|
248 |
optimization_list = {
|
249 |
+
"None": [28, 7., 'Euler a', False, 'None', 1.],
|
250 |
+
"Default": [28, 7., 'Euler a', False, 'None', 1.],
|
251 |
"SPO": [28, 7., 'Euler a', True, 'loras/spo_sdxl_10ep_4k-data_lora_diffusers.safetensors', 1.],
|
252 |
"DPO": [28, 7., 'Euler a', True, 'loras/sdxl-DPO-LoRA.safetensors', 1.],
|
253 |
"DPO Turbo": [8, 2.5, 'LCM', True, 'loras/sd_xl_dpo_turbo_lora_v1-128dim.safetensors', 1.],
|
|
|
407 |
|
408 |
def set_lora_trigger(lora_gui: str):
|
409 |
from pathlib import Path
|
410 |
+
if not lora_gui or lora_gui == "None": return gr.update(value="", visible=False), gr.update(visible=False),\
|
411 |
+
gr.update(value="", visible=False), gr.update(value="None", visible=True)
|
412 |
path = Path(lora_gui)
|
413 |
new_path = Path(f'{path.parent.name}/{escape_lora_basename(path.stem)}{path.suffix}')
|
414 |
if not new_path.stem in lora_trigger_dict.keys() and not str(path) in set(get_private_lora_model_lists() + get_model_list(directory_loras)):
|
|
|
863 |
return default
|
864 |
else:
|
865 |
if model.private or model.gated: return default
|
|
|
866 |
tags = model.tags
|
867 |
if not 'diffusers' in tags: return default
|
868 |
if 'diffusers:StableDiffusionXLPipeline' in tags:
|