aboutsummaryrefslogtreecommitdiffstats
path: root/extensions-builtin
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-17 07:06:02 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2023-07-17 07:06:02 +0000
commit35510f7529dc05437a82496187ef06b852be9ab1 (patch)
tree2f45e5e1e9e79ff7f02bef40ef0a793b4a05fd2f /extensions-builtin
parent2e07a8ae6b1d92838b3a8a0f6eaf5fcf4a92d48f (diff)
downloadstable-diffusion-webui-gfx803-35510f7529dc05437a82496187ef06b852be9ab1.tar.gz
stable-diffusion-webui-gfx803-35510f7529dc05437a82496187ef06b852be9ab1.tar.bz2
stable-diffusion-webui-gfx803-35510f7529dc05437a82496187ef06b852be9ab1.zip
add alias to lyco network
read networks from LyCORIS dir if it exists add credits
Diffstat (limited to 'extensions-builtin')
-rw-r--r--extensions-builtin/Lora/networks.py3
-rw-r--r--extensions-builtin/Lora/scripts/lora_script.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/extensions-builtin/Lora/networks.py b/extensions-builtin/Lora/networks.py
index 401430e8..7b4c0312 100644
--- a/extensions-builtin/Lora/networks.py
+++ b/extensions-builtin/Lora/networks.py
@@ -11,7 +11,7 @@ import network_full
import torch
from typing import Union
-from modules import shared, devices, sd_models, errors, scripts, sd_hijack
+from modules import shared, devices, sd_models, errors, scripts, sd_hijack, paths
module_types = [
network_lora.ModuleTypeLora(),
@@ -399,6 +399,7 @@ def list_available_networks():
os.makedirs(shared.cmd_opts.lora_dir, exist_ok=True)
candidates = list(shared.walk_files(shared.cmd_opts.lora_dir, allowed_extensions=[".pt", ".ckpt", ".safetensors"]))
+ candidates += list(shared.walk_files(os.path.join(paths.models_path, "LyCORIS"), allowed_extensions=[".pt", ".ckpt", ".safetensors"]))
for filename in candidates:
if os.path.isdir(filename):
continue
diff --git a/extensions-builtin/Lora/scripts/lora_script.py b/extensions-builtin/Lora/scripts/lora_script.py
index 4c75821e..f478f718 100644
--- a/extensions-builtin/Lora/scripts/lora_script.py
+++ b/extensions-builtin/Lora/scripts/lora_script.py
@@ -22,7 +22,10 @@ def unload():
def before_ui():
ui_extra_networks.register_page(ui_extra_networks_lora.ExtraNetworksPageLora())
- extra_networks.register_extra_network(extra_networks_lora.ExtraNetworkLora())
+
+ extra_network = extra_networks_lora.ExtraNetworkLora()
+ extra_networks.register_extra_network(extra_network)
+ extra_networks.register_extra_network_alias(extra_network, "lyco")
if not hasattr(torch.nn, 'Linear_forward_before_network'):