Commit 136c8859 authored by AUTOMATIC1111's avatar AUTOMATIC1111
Browse files

add backwards compatibility --lyco-dir-backcompat option, use that for LyCORIS...

add backwards compatibility --lyco-dir-backcompat option, use that for LyCORIS directory instead of hardcoded value
prevent running preload.py for disabled extensions
parent eb7c9b58
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -58,9 +58,7 @@
 * fix: check fill size none zero when resize  (fixes #11425)
 * use submit and blur for quick settings textbox
 * save img2img batch with images.save_image()
 * 


 * prevent running preload.py for disabled extensions


## 1.4.1
+2 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ import network_full
import torch
from typing import Union

from modules import shared, devices, sd_models, errors, scripts, sd_hijack, paths
from modules import shared, devices, sd_models, errors, scripts, sd_hijack

module_types = [
    network_lora.ModuleTypeLora(),
@@ -399,7 +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"]))
    candidates += list(shared.walk_files(shared.cmd_opts.lyco_dir_backcompat, allowed_extensions=[".pt", ".ckpt", ".safetensors"]))
    for filename in candidates:
        if os.path.isdir(filename):
            continue
+1 −0
Original line number Diff line number Diff line
@@ -4,3 +4,4 @@ from modules import paths

def preload(parser):
    parser.add_argument("--lora-dir", type=str, help="Path to directory with Lora networks.", default=os.path.join(paths.models_path, 'Lora'))
    parser.add_argument("--lyco-dir-backcompat", type=str, help="Path to directory with LyCORIS networks (for backawards compatibility; can also use --lyco-dir).", default=os.path.join(paths.models_path, 'LyCORIS'))
+2 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ import os
import network
import networks

from modules import shared, ui_extra_networks, paths
from modules import shared, ui_extra_networks
from modules.ui_extra_networks import quote_js
from ui_edit_user_metadata import LoraUserMetadataEditor

@@ -72,7 +72,7 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage):
                yield item

    def allowed_directories_for_previews(self):
        return [shared.cmd_opts.lora_dir, os.path.join(paths.models_path, "LyCORIS")]
        return [shared.cmd_opts.lora_dir, shared.cmd_opts.lyco_dir_backcompat]

    def create_user_metadata_editor(self, ui, tabname):
        return LoraUserMetadataEditor(ui, tabname, self)
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ run_pip = launch_utils.run_pip
check_run_python = launch_utils.check_run_python
git_clone = launch_utils.git_clone
git_pull_recursive = launch_utils.git_pull_recursive
list_extensions = launch_utils.list_extensions
run_extension_installer = launch_utils.run_extension_installer
prepare_environment = launch_utils.prepare_environment
configure_for_tests = launch_utils.configure_for_tests
Loading