diff --git a/CHANGELOG.md b/CHANGELOG.md index 88657cb60..e4a0f3eeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log for SD.Next -## Update for 2023-08-09 +## Update for 2023-08-10 - diffusers: - **pipeline autodetect** diff --git a/modules/sd_models.py b/modules/sd_models.py index af5b4335f..02a4383d6 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -522,6 +522,7 @@ class ModelData: model_data = ModelData() + def change_backend(): shared.log.info(f'Pipeline changed: {shared.backend}') unload_model_weights() @@ -626,7 +627,7 @@ def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=No sd_model = None try: - if shared.cmd_opts.ckpt is not None and model_data.initial: # initial load\ + if shared.cmd_opts.ckpt is not None and model_data.initial: # initial load ckpt_basename = os.path.basename(shared.cmd_opts.ckpt) model_name = modelloader.find_diffuser(ckpt_basename) if model_name is not None: @@ -800,8 +801,7 @@ def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=No if op == 'refiner' and shared.opts.diffusers_move_refiner and not sd_model.has_accelerate: shared.log.debug('Moving refiner model to CPU') sd_model.to(devices.cpu) - elif not sd_model.has_accelerate: - # In offload modes, accelerate will move models around. + elif not sd_model.has_accelerate: # In offload modes, accelerate will move models around sd_model.to(devices.device) if op == 'refiner' and base_sent_to_cpu: shared.log.debug('Moving base model back to GPU') @@ -1034,18 +1034,18 @@ def unload_model_weights(op='model'): from modules import sd_hijack if op == 'model' or op == 'dict': if model_data.sd_model: - model_data.sd_model.to('meta') + model_data.sd_model.to(devices.cpu) if shared.backend == shared.Backend.ORIGINAL: sd_hijack.model_hijack.undo_hijack(model_data.sd_model) model_data.sd_model = None - shared.log.debug(f'Weights unloaded {op}: {memory_stats()}') + shared.log.debug(f'Unload weights {op}: {memory_stats()}') else: if model_data.sd_refiner: - model_data.sd_refiner.to('meta') + model_data.sd_refiner.to(devices.cpu) if shared.backend == shared.Backend.ORIGINAL: sd_hijack.model_hijack.undo_hijack(model_data.sd_refiner) model_data.sd_refiner = None - shared.log.debug(f'Weights unloaded {op}: {memory_stats()}') + shared.log.debug(f'Unload weights {op}: {memory_stats()}') devices.torch_gc(force=True) diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py index 9526e730f..aa7c60ef5 100644 --- a/modules/ui_extensions.py +++ b/modules/ui_extensions.py @@ -151,6 +151,8 @@ def install_extension_from_url(dirname, url, branch_name, search_text, sort_colu normalized_url = normalize_git_url(url) assert len([x for x in extensions.extensions if normalize_git_url(x.remote) == normalized_url]) == 0, 'Extension with this URL is already installed' tmpdir = os.path.join(paths.data_path, "tmp", dirname) + if url.endswith('.git'): + url = url.replace('.git', '') try: shutil.rmtree(tmpdir, True) if not branch_name: @@ -175,6 +177,8 @@ def install_extension_from_url(dirname, url, branch_name, search_text, sort_colu run_extension_installer(target_dir) extensions.list_extensions() return [refresh_extensions_list_from_data(search_text, sort_column), html.escape(f"Extension installed: {target_dir} | Restart required")] + except Exception as e: + shared.log.error(f'Error installing extension: {url} {e}') finally: shutil.rmtree(tmpdir, True) diff --git a/wiki b/wiki index 2e5c2a156..581054504 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 2e5c2a156e1868a7b93329fa1b43e302e9dcfa0b +Subproject commit 581054504c3ad2cfa7f0e625147484836e8a84ba