diff --git a/extensions-builtin/Lora/networks.py b/extensions-builtin/Lora/networks.py index 4b0e58281..50a2de90c 100644 --- a/extensions-builtin/Lora/networks.py +++ b/extensions-builtin/Lora/networks.py @@ -438,7 +438,6 @@ def list_available_networks(): forbidden_network_aliases.clear() available_network_hash_lookup.clear() forbidden_network_aliases.update({"none": 1, "Addams": 1}) - os.makedirs(shared.cmd_opts.lora_dir, exist_ok=True) directories = [] if os.path.exists(shared.cmd_opts.lora_dir): directories.append(shared.cmd_opts.lora_dir) diff --git a/modules/control/run.py b/modules/control/run.py index 00337a56d..52f7a2532 100644 --- a/modules/control/run.py +++ b/modules/control/run.py @@ -85,7 +85,7 @@ def control_run(units: List[unit.Unit], inputs, inits, mask, unit_type: str, is_ n_iter = batch_count, batch_size = batch_size, inpaint_full_res = masking.opts.mask_only, - inpaint_full_res_padding = masking.opts.mask_padding, + # inpaint_full_res_padding = masking.opts.mask_padding, inpainting_mask_invert = 1 if masking.opts.invert else 0, inpainting_fill = 1, hdr_mode=hdr_mode, hdr_brightness=hdr_brightness, hdr_color=hdr_color, hdr_sharpen=hdr_sharpen, hdr_clamp=hdr_clamp, diff --git a/modules/masking.py b/modules/masking.py index fac742d78..a23cafcef 100644 --- a/modules/masking.py +++ b/modules/masking.py @@ -385,7 +385,7 @@ def run_mask(input_image: gr.Image, input_mask: gr.Image = None, return_type: st return_type = return_type or opts.preview_type - shared.log.debug(f'Mask: size={input_image.width}x{input_image.height} masked={mask_size}px area={area_size/total_size:.2f} auto={opts.auto_mask} type={return_type} time={t1-t0:.2f}') + shared.log.debug(f'Mask: size={input_image.width}x{input_image.height} masked={mask_size}px area={area_size/total_size:.2f} auto={opts.auto_mask} blur={opts.mask_blur} erode={opts.mask_erode} dilate={opts.mask_dilate} type={return_type} time={t1-t0:.2f}') if return_type == 'None': return input_mask elif return_type == 'Binary': diff --git a/modules/onnx_impl/__init__.py b/modules/onnx_impl/__init__.py index d1785da9b..815c54cfc 100644 --- a/modules/onnx_impl/__init__.py +++ b/modules/onnx_impl/__init__.py @@ -199,9 +199,6 @@ def initialize_onnx(): from modules.paths import models_path from modules.shared import opts from .execution_providers import ExecutionProvider, TORCH_DEVICE_TO_EP, available_execution_providers - onnx_dir = os.path.join(models_path, "ONNX") - if not os.path.isdir(onnx_dir): - os.mkdir(onnx_dir) if devices.backend == "rocm": TORCH_DEVICE_TO_EP["cuda"] = ExecutionProvider.ROCm from .pipelines.onnx_stable_diffusion_pipeline import OnnxStableDiffusionPipeline diff --git a/modules/paths.py b/modules/paths.py index 7295f6575..1b6f4a389 100644 --- a/modules/paths.py +++ b/modules/paths.py @@ -28,6 +28,7 @@ models_config = cli.models_dir or config.get('models_dir') or 'models' models_path = models_config if os.path.isabs(models_config) else os.path.join(data_path, models_config) extensions_dir = os.path.join(data_path, "extensions") extensions_builtin_dir = "extensions-builtin" +onnx_dir = os.path.join(models_path, "ONNX") sd_configs_path = os.path.join(script_path, "configs") sd_default_config = os.path.join(sd_configs_path, "v1-inference.yaml") sd_model_file = cli.ckpt or os.path.join(script_path, 'model.ckpt') # not used @@ -94,6 +95,7 @@ def create_paths(opts): create_path(sd_configs_path) create_path(extensions_dir) create_path(extensions_builtin_dir) + create_path(onnx_dir) create_path(fix_path('temp_dir')) create_path(fix_path('ckpt_dir')) create_path(fix_path('diffusers_dir')) diff --git a/modules/postprocess/codeformer_model.py b/modules/postprocess/codeformer_model.py index 59a990ce2..4a812fdb7 100644 --- a/modules/postprocess/codeformer_model.py +++ b/modules/postprocess/codeformer_model.py @@ -17,8 +17,11 @@ codeformer = None def setup_model(dirname): - if not os.path.exists(model_path): - os.makedirs(model_path) + try: + if not os.path.exists(model_path): + os.makedirs(model_path) + except Exception: + pass path = modules.paths.paths.get("CodeFormer", None) if path is None: return diff --git a/modules/postprocess/gfpgan_model.py b/modules/postprocess/gfpgan_model.py index b85c900e6..e466acb53 100644 --- a/modules/postprocess/gfpgan_model.py +++ b/modules/postprocess/gfpgan_model.py @@ -66,8 +66,11 @@ gfpgan_constructor = None def setup_model(dirname): - if not os.path.exists(model_path): - os.makedirs(model_path) + try: + if not os.path.exists(model_path): + os.makedirs(model_path) + except Exception: + pass try: import gfpgan import facexlib diff --git a/modules/sd_models.py b/modules/sd_models.py index c4ae53a24..c7ea1b79a 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -122,8 +122,6 @@ class NoWatermark: def setup_model(): - if not os.path.exists(model_path): - os.makedirs(model_path, exist_ok=True) list_models() if shared.backend == shared.Backend.ORIGINAL: enable_midas_autodownload() diff --git a/modules/shared.py b/modules/shared.py index 95db8f170..8fbd81bd9 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -486,13 +486,12 @@ options_templates.update(options_section(('system-paths', "System Paths"), { "swinir_models_path": OptionInfo(os.path.join(paths.models_path, 'SwinIR'), "Folder with SwinIR models", folder=True), "ldsr_models_path": OptionInfo(os.path.join(paths.models_path, 'LDSR'), "Folder with LDSR models", folder=True), "clip_models_path": OptionInfo(os.path.join(paths.models_path, 'CLIP'), "Folder with CLIP models", folder=True), - "onnx_cached_models_path": OptionInfo(os.path.join(paths.models_path, 'ONNX', 'cache'), "Folder with ONNX cached models", folder=True), - "other_paths_sep_options": OptionInfo("