From 53ca8030f1bd1049d64f66bed1c7f819da2ba180 Mon Sep 17 00:00:00 2001 From: nosdregamon Date: Sun, 25 Jun 2023 01:22:42 +0200 Subject: [PATCH 1/4] Got 'Add Triggerwords to Prompt/Use Prompt' to work with LyCORIS folder --- javascript/civitai_helper.js | 8 +++++++- scripts/ch_lib/model.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/javascript/civitai_helper.js b/javascript/civitai_helper.js index 4454d0d..686731e 100644 --- a/javascript/civitai_helper.js +++ b/javascript/civitai_helper.js @@ -338,7 +338,7 @@ onUiLoaded(() => { // get all extra network tabs let tab_prefix_list = ["txt2img", "img2img"]; - let model_type_list = ["textual_inversion", "hypernetworks", "checkpoints", "lora"]; + let model_type_list = ["textual_inversion", "hypernetworks", "checkpoints", "lora", "lycoris"]; let cardid_suffix = "cards"; //get init py msg @@ -449,6 +449,9 @@ onUiLoaded(() => { break; case "lora": active_extra_tab_type = "lora"; + break; + case "lycoris": + active_extra_tab_type = "lycoris"; break; } @@ -467,6 +470,9 @@ onUiLoaded(() => { break; case "lora": model_type = "lora"; + break; + case "lycoris": + model_type = "lycoris"; break; } diff --git a/scripts/ch_lib/model.py b/scripts/ch_lib/model.py index 729012d..e1f3ae9 100644 --- a/scripts/ch_lib/model.py +++ b/scripts/ch_lib/model.py @@ -17,6 +17,7 @@ folders = { "hyper": os.path.join(root_path, "models", "hypernetworks"), "ckp": os.path.join(root_path, "models", "Stable-diffusion"), "lora": os.path.join(root_path, "models", "Lora"), + "lycoris": os.path.join(root_path, "models", "LyCORIS"), } exts = (".bin", ".pt", ".safetensors", ".ckpt") From 2aa71a6df9f2d70dd2410053239f30f94c122ad7 Mon Sep 17 00:00:00 2001 From: Goldmojo Date: Sun, 25 Jun 2023 19:36:42 +0200 Subject: [PATCH 2/4] Merge branch 'Add-LyCORIS-parsing' of https://github.com/goldmojo/Stable-Diffusion-Webui-Civitai-Helper into Add-LyCORIS-parsing --- scripts/ch_lib/civitai.py | 2 +- scripts/ch_lib/model.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ch_lib/civitai.py b/scripts/ch_lib/civitai.py index 2a15ae7..9002dcd 100644 --- a/scripts/ch_lib/civitai.py +++ b/scripts/ch_lib/civitai.py @@ -23,7 +23,7 @@ model_type_dict = { "TextualInversion": "ti", "Hypernetwork": "hyper", "LORA": "lora", - "LoCon": "lora", + "LoCon": "lycoris", } diff --git a/scripts/ch_lib/model.py b/scripts/ch_lib/model.py index e1f3ae9..2d65f78 100644 --- a/scripts/ch_lib/model.py +++ b/scripts/ch_lib/model.py @@ -17,7 +17,7 @@ folders = { "hyper": os.path.join(root_path, "models", "hypernetworks"), "ckp": os.path.join(root_path, "models", "Stable-diffusion"), "lora": os.path.join(root_path, "models", "Lora"), - "lycoris": os.path.join(root_path, "models", "LyCORIS"), + "lycoris": os.path.join(root_path, "models", "LyCORIS"), } exts = (".bin", ".pt", ".safetensors", ".ckpt") @@ -43,8 +43,8 @@ def get_custom_model_folder(): if shared.cmd_opts.lora_dir and os.path.isdir(shared.cmd_opts.lora_dir): folders["lora"] = shared.cmd_opts.lora_dir - - + if shared.cmd_opts.lyco_dir and os.path.isdir(shared.cmd_opts.lyco_dir): + folders["lycoris"] = shared.cmd_opts.lyco_dir # write model info to file From 32c12615ece732b1047f69306918c79341846d3d Mon Sep 17 00:00:00 2001 From: Goldmojo Date: Sun, 25 Jun 2023 19:39:33 +0200 Subject: [PATCH 3/4] modified: javascript/civitai_helper.js --- javascript/civitai_helper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/civitai_helper.js b/javascript/civitai_helper.js index 686731e..11ba250 100644 --- a/javascript/civitai_helper.js +++ b/javascript/civitai_helper.js @@ -450,7 +450,7 @@ onUiLoaded(() => { case "lora": active_extra_tab_type = "lora"; break; - case "lycoris": + case "lycoris": active_extra_tab_type = "lycoris"; break; } @@ -471,7 +471,7 @@ onUiLoaded(() => { case "lora": model_type = "lora"; break; - case "lycoris": + case "lycoris": model_type = "lycoris"; break; } From 778876dcd048f038ca0a6c1c3234ae8c5a77e6cf Mon Sep 17 00:00:00 2001 From: Goldmojo Date: Sat, 15 Jul 2023 17:28:58 +0200 Subject: [PATCH 4/4] =?UTF-8?q?Checks=20each=20checkbox=20by=20default=20i?= =?UTF-8?q?n=20"Check=20models=E2=80=99=20new=20version"=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/civitai_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/civitai_helper.py b/scripts/civitai_helper.py index ad9e70a..47cd8c2 100644 --- a/scripts/civitai_helper.py +++ b/scripts/civitai_helper.py @@ -152,7 +152,7 @@ def on_ui_tabs(): with gr.Column(): gr.Markdown("### Check models' new version") with gr.Row(): - model_types_ckbg = gr.CheckboxGroup(choices=model_types, label="Model Types", value=["lora"]) + model_types_ckbg = gr.CheckboxGroup(choices=model_types, label="Model Types", value=["ti", "hyper", "ckp", "lora", "lycoris"]) check_models_new_version_btn = gr.Button(value="Check New Version from Civitai", variant="primary") check_models_new_version_log_md = gr.HTML("It takes time, just wait. Check console log for detail")