mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
fixes
This commit is contained in:
@@ -31,7 +31,7 @@ Stuff to be investigated...
|
||||
|
||||
Pick & merge PRs from main repo...
|
||||
|
||||
- Merge backlog: <https://github.com/AUTOMATIC1111/stable-diffusion-webui/compare/5ab7f213bec2f816f9c5644becb32eb72c8ffb89..89f9faa63388756314e8a1d96cf86bf5e0663045>
|
||||
- Compare commits: <https://github.com/vladmandic/automatic/compare/e59ebe25..b6289d5>
|
||||
|
||||
## Models
|
||||
|
||||
|
||||
@@ -175,7 +175,6 @@ def load_lora(name, filename):
|
||||
else:
|
||||
print(f'Lora layer {key_diffusers} matched a layer with unsupported type: {type(sd_module).__name__}')
|
||||
continue
|
||||
assert False, f'Lora layer {key_diffusers} matched a layer with unsupported type: {type(sd_module).__name__}'
|
||||
|
||||
with torch.no_grad():
|
||||
module.weight.copy_(weight)
|
||||
@@ -190,7 +189,7 @@ def load_lora(name, filename):
|
||||
assert False, f'Bad Lora layer name: {key_diffusers} - must end in lora_up.weight, lora_down.weight or alpha'
|
||||
|
||||
if len(keys_failed_to_match) > 0:
|
||||
print(f"Failed to match keys when loading Lora {filename}: {keys_failed_to_match}")
|
||||
print(f"Failed to match keys when loading Lora {filename}: {len(keys_failed_to_match)}")
|
||||
|
||||
return lora
|
||||
|
||||
|
||||
Submodule extensions-builtin/sd-webui-controlnet updated: ce2278d5bc...cae8894767
+2
-2
@@ -63,7 +63,7 @@ def get_device_for(task):
|
||||
def torch_gc(force=False):
|
||||
if shared.opts.disable_gc and not force:
|
||||
return
|
||||
gc.collect()
|
||||
collected = gc.collect()
|
||||
if shared.cmd_opts.use_ipex:
|
||||
try:
|
||||
with torch.xpu.device("xpu"):
|
||||
@@ -77,7 +77,7 @@ def torch_gc(force=False):
|
||||
torch.cuda.ipc_collect()
|
||||
except:
|
||||
pass
|
||||
shared.log.debug(f'gc: device={torch.device(get_optimal_device_name())} {memstats.memory_stats()}')
|
||||
shared.log.debug(f'gc: collected={collected} device={torch.device(get_optimal_device_name())} {memstats.memory_stats()}')
|
||||
|
||||
|
||||
def test_fp16():
|
||||
|
||||
@@ -632,7 +632,7 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
|
||||
del samples_ddim
|
||||
if shared.cmd_opts.lowvram or shared.cmd_opts.medvram:
|
||||
lowvram.send_everything_to_cpu()
|
||||
devices.torch_gc()
|
||||
devices.torch_gc()
|
||||
if p.scripts is not None:
|
||||
p.scripts.postprocess_batch(p, x_samples_ddim, batch_number=n)
|
||||
for i, x_sample in enumerate(x_samples_ddim):
|
||||
@@ -700,7 +700,6 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
|
||||
|
||||
if not p.disable_extra_networks and extra_network_data:
|
||||
extra_networks.deactivate(p, extra_network_data)
|
||||
devices.torch_gc()
|
||||
res = Processed(
|
||||
p,
|
||||
images_list=output_images,
|
||||
|
||||
+8
-4
@@ -538,7 +538,9 @@ class Options:
|
||||
return data_label.default
|
||||
|
||||
def save(self, filename):
|
||||
assert not cmd_opts.freeze, "saving settings is disabled"
|
||||
if cmd_opts.freeze:
|
||||
log.warning(f'Settings saving is disabled: {filename}')
|
||||
return
|
||||
with open(filename, "w", encoding="utf8") as file:
|
||||
json.dump(self.data, file, indent=4)
|
||||
|
||||
@@ -550,6 +552,10 @@ class Options:
|
||||
return type_x == type_y
|
||||
|
||||
def load(self, filename):
|
||||
if not os.path.isfile(filename):
|
||||
log.debug(f'Created default config: {filename}')
|
||||
self.save(filename)
|
||||
return
|
||||
with open(filename, "r", encoding="utf8") as file:
|
||||
self.data = json.load(file)
|
||||
if self.data.get('quicksettings') is not None and self.data.get('quicksettings_list') is None:
|
||||
@@ -560,7 +566,6 @@ class Options:
|
||||
if info is not None and not self.same_type(info.default, v):
|
||||
log.error(f"Warning: bad setting value: {k}: {v} ({type(v).__name__}; expected {type(info.default).__name__})")
|
||||
bad_settings += 1
|
||||
|
||||
if bad_settings > 0:
|
||||
log.error(f"Error: Bad settings found in {filename}")
|
||||
|
||||
@@ -607,8 +612,7 @@ class Options:
|
||||
|
||||
opts = Options()
|
||||
config_filename = cmd_opts.config
|
||||
if os.path.exists(config_filename):
|
||||
opts.load(config_filename)
|
||||
opts.load(config_filename)
|
||||
cmd_opts = cmd_args.compatibility_args(opts, cmd_opts)
|
||||
|
||||
prompt_styles = modules.styles.StyleDatabase(opts.styles_dir)
|
||||
|
||||
@@ -14,7 +14,7 @@ extensions_index = "https://vladmandic.github.io/sd-data/pages/extensions.json"
|
||||
hide_tags = ["localization"]
|
||||
extensions_list = []
|
||||
sort_ordering = {
|
||||
"default": (True, lambda x: x.get('sort_string', '')),
|
||||
"default": (True, lambda x: x.get('sort_default', '')),
|
||||
"user extensions": (True, lambda x: x.get('sort_user', '')),
|
||||
"update avilable": (True, lambda x: x.get('sort_update', '')),
|
||||
"updated date": (True, lambda x: x.get('updated', '2000-01-01T00:00')),
|
||||
@@ -261,7 +261,7 @@ def search_extensions(search_text, sort_column):
|
||||
|
||||
|
||||
def refresh_extensions_list_from_data(search_text, sort_column):
|
||||
shared.log.debug(f'Extensions manager: refresh list search={search_text} sort={sort_column}')
|
||||
shared.log.debug(f'Extensions manager: refresh list search="{search_text}" sort="{sort_column}"')
|
||||
code = """
|
||||
<table id="extensions">
|
||||
<colgroup>
|
||||
@@ -294,6 +294,7 @@ def refresh_extensions_list_from_data(search_text, sort_column):
|
||||
ext['enabled'] = extension[0].enabled if len(extension) > 0 else ''
|
||||
ext['remote'] = extension[0].remote if len(extension) > 0 else None
|
||||
ext['path'] = extension[0].path if len(extension) > 0 else ''
|
||||
ext['sort_default'] = f"{'1' if ext['is_builtin'] else '0'}{'1' if ext['installed'] else '0'}{ext.get('updated', '2000-01-01T00:00')}"
|
||||
sort_reverse, sort_function = sort_ordering[sort_column]
|
||||
|
||||
def dt(x: str):
|
||||
@@ -321,7 +322,6 @@ def refresh_extensions_list_from_data(search_text, sort_column):
|
||||
remote = ext.get("remote", None)
|
||||
commit_date = ext.get("commit_date", 1577836800) or 1577836800
|
||||
update_available = (remote is not None) & (installed) & (datetime.utcfromtimestamp(commit_date + 60 * 60) < datetime.fromisoformat(ext.get('updated', '2000-01-01T00:00:00.000Z')[:-1]))
|
||||
ext['sort_string'] = f"{'1' if ext['is_builtin'] else '0'}{'1' if ext['installed'] else '0'}{ext.get('updated', '2000-01-01T00:00')}"
|
||||
ext['sort_user'] = f"{'0' if ext['is_builtin'] else '1'}{'1' if ext['installed'] else '0'}{ext.get('name', '')}"
|
||||
ext['sort_enabled'] = f"{'0' if ext['enabled'] else '1'}{'1' if ext['is_builtin'] else '0'}{'1' if ext['installed'] else '0'}{ext.get('updated', '2000-01-01T00:00')}"
|
||||
ext['sort_update'] = f"{'1' if update_available else '0'}{'1' if ext['installed'] else '0'}{ext.get('updated', '2000-01-01T00:00')}"
|
||||
|
||||
Reference in New Issue
Block a user