From 6761ebd2a7d764849936010fc4baee689e5905f3 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sun, 28 Dec 2025 02:01:20 -0800 Subject: [PATCH 1/9] Remove sending `force` argument `git_fetch()` un-sets the `have_info_from_repo` flag so it's not needed --- modules/ui_extensions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py index da3ae39d0..d1fd68e76 100644 --- a/modules/ui_extensions.py +++ b/modules/ui_extensions.py @@ -106,7 +106,7 @@ def check_updates(_id_task, disable_list, search_text, sort_column): ext.check_updates() if ext.can_update: ext.git_fetch() - ext.read_info(True) + ext.read_info() commit_date = ext.commit_date or 1577836800 shared.log.info(f'Extensions updated: {ext.name} {ext.commit_hash[:8]} {extensions.format_dt(extensions.ts2utc(commit_date))}') else: @@ -227,7 +227,7 @@ def update_extension(extension_path, search_text, sort_column): ext.check_updates() if ext.can_update: ext.git_fetch() - ext.read_info(True) + ext.read_info() commit_date = ext.commit_date or 1577836800 shared.log.info(f'Extensions updated: {ext.name} {ext.commit_hash[:8]} {extensions.format_dt(extensions.ts2utc(commit_date))}') else: From 691ace354313d5eadb55131355022126b7aaf611 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sun, 28 Dec 2025 02:25:43 -0800 Subject: [PATCH 2/9] Add warning messages --- modules/json_helpers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/json_helpers.py b/modules/json_helpers.py index e06c835f4..3c2facda0 100644 --- a/modules/json_helpers.py +++ b/modules/json_helpers.py @@ -59,11 +59,13 @@ def readfile(filename: str, silent: bool = False, lock: bool = False, *, as_type except Exception: locking_available = False if isinstance(data, list) and as_type == "dict": + log.warning(f"Read: Expected dictionary from '{filename}' but got list") data0 = data[0] if isinstance(data0, dict): return data0 return {} if isinstance(data, dict) and as_type == "list": + log.warning(f"Read: Expected list from '{filename}' but got dictionary") return [data] return data From 70081e0d7475b149bb9044f07d17bfa2f2a4a4b3 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sun, 28 Dec 2025 02:38:17 -0800 Subject: [PATCH 3/9] Fix default value --- modules/json_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/json_helpers.py b/modules/json_helpers.py index 3c2facda0..5cb495437 100644 --- a/modules/json_helpers.py +++ b/modules/json_helpers.py @@ -19,7 +19,7 @@ def readfile(filename: str, silent: bool = False, lock: bool = False, *, as_type def readfile(filename: str, silent: bool = False, lock: bool = False) -> dict | list: ... def readfile(filename: str, silent: bool = False, lock: bool = False, *, as_type="") -> dict | list: global locking_available # pylint: disable=global-statement - data = {} + data = {} if as_type == "dict" else [] lock_file = None locked = False if lock and locking_available: From 66f55a7d7c10e2c31c868b9b2a95790732d6a18c Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sun, 28 Dec 2025 02:59:51 -0800 Subject: [PATCH 4/9] Better data handling --- modules/json_helpers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/json_helpers.py b/modules/json_helpers.py index 5cb495437..600f5fc8c 100644 --- a/modules/json_helpers.py +++ b/modules/json_helpers.py @@ -59,13 +59,15 @@ def readfile(filename: str, silent: bool = False, lock: bool = False, *, as_type except Exception: locking_available = False if isinstance(data, list) and as_type == "dict": - log.warning(f"Read: Expected dictionary from '{filename}' but got list") + if not data: + return {} data0 = data[0] if isinstance(data0, dict): return data0 return {} if isinstance(data, dict) and as_type == "list": - log.warning(f"Read: Expected list from '{filename}' but got dictionary") + if not data: + return [] return [data] return data From 89fd729d74069a3ea1aa51352e3c5c8191b6588d Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sun, 28 Dec 2025 03:02:39 -0800 Subject: [PATCH 5/9] Restore accidental deletion --- modules/json_helpers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/json_helpers.py b/modules/json_helpers.py index 600f5fc8c..16fe0a55a 100644 --- a/modules/json_helpers.py +++ b/modules/json_helpers.py @@ -59,6 +59,7 @@ def readfile(filename: str, silent: bool = False, lock: bool = False, *, as_type except Exception: locking_available = False if isinstance(data, list) and as_type == "dict": + log.warning(f"Read: Expected dictionary from '{filename}' but got list") if not data: return {} data0 = data[0] @@ -66,6 +67,7 @@ def readfile(filename: str, silent: bool = False, lock: bool = False, *, as_type return data0 return {} if isinstance(data, dict) and as_type == "list": + log.warning(f"Read: Expected list from '{filename}' but got dictionary") if not data: return [] return [data] From 7c01fd71de3d0368ecf316d40443a65924e79aa6 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sun, 28 Dec 2025 03:10:22 -0800 Subject: [PATCH 6/9] Don't warn about file if not reading from a file Leave that up to the other log messages --- modules/json_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/json_helpers.py b/modules/json_helpers.py index 16fe0a55a..2615d1a03 100644 --- a/modules/json_helpers.py +++ b/modules/json_helpers.py @@ -59,17 +59,17 @@ def readfile(filename: str, silent: bool = False, lock: bool = False, *, as_type except Exception: locking_available = False if isinstance(data, list) and as_type == "dict": - log.warning(f"Read: Expected dictionary from '{filename}' but got list") if not data: return {} + log.warning(f"Read: Expected dictionary from '{filename}' but got list") data0 = data[0] if isinstance(data0, dict): return data0 return {} if isinstance(data, dict) and as_type == "list": - log.warning(f"Read: Expected list from '{filename}' but got dictionary") if not data: return [] + log.warning(f"Read: Expected list from '{filename}' but got dictionary") return [data] return data From 39e9bbed1ba4c103b16d4189d13e97a5eaee6a56 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sun, 28 Dec 2025 03:14:44 -0800 Subject: [PATCH 7/9] Update message Bad data message will be handled by a different update to `readfile` --- modules/ui_extensions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py index d1fd68e76..871aaec57 100644 --- a/modules/ui_extensions.py +++ b/modules/ui_extensions.py @@ -39,7 +39,7 @@ def list_extensions(): fn = os.path.join(paths.script_path, "html", "extensions.json") extensions_list = shared.readfile(fn, silent=True, as_type="list") if len(extensions_list) == 0: - shared.log.info(f'Extension list is empty or invalid. Try refreshing or verifying downloaded data. file="{fn}"') + shared.log.info("Extension List: No information found. Refresh required.") found = [] for ext in extensions.extensions: ext.read_info() From be954a981269aaa89deab34573ed4410cf59948a Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sun, 28 Dec 2025 03:21:28 -0800 Subject: [PATCH 8/9] Use helper function --- modules/ui_extensions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py index 871aaec57..a6c5ca3ec 100644 --- a/modules/ui_extensions.py +++ b/modules/ui_extensions.py @@ -328,7 +328,7 @@ def create_html(search_text, sort_column): debug(f'Extension not from github: name={ext["name"]} url={ext["url"]}') except Exception as e: debug(f'Extension get updated error: name={ext["name"]} url={ext["url"]} {e}') - local_ver_date = datetime.fromtimestamp(ext['commit_date'], timezone.utc) # TZ-aware + local_ver_date = extensions.ts2utc(ext['commit_date']) # TZ-aware update_available = (installed is not None) and (not ext['is_builtin']) and (ext['remote'] is not None) and (updated > local_ver_date) # TZ-aware if update_available: debug(f'Extension update available: name={ext["name"]} updated={extensions.format_dt(updated)} commit={extensions.format_dt(local_ver_date)}') # TZ-aware From 5e934a12a238d8c13bf16db457ea53152996bb5b Mon Sep 17 00:00:00 2001 From: Disty0 Date: Sun, 28 Dec 2025 20:08:56 +0300 Subject: [PATCH 9/9] sdnq cleanup unused args --- modules/sdnq/common.py | 2 +- modules/sdnq/packed_float.py | 2 +- modules/sdnq/quantizer.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/sdnq/common.py b/modules/sdnq/common.py index f0174d619..31544b671 100644 --- a/modules/sdnq/common.py +++ b/modules/sdnq/common.py @@ -5,7 +5,7 @@ import torch from modules import shared, devices -sdnq_version = "0.1.3" +sdnq_version = "0.1.4" dtype_dict = { ### Integers diff --git a/modules/sdnq/packed_float.py b/modules/sdnq/packed_float.py index cc456043c..dcdc0491a 100644 --- a/modules/sdnq/packed_float.py +++ b/modules/sdnq/packed_float.py @@ -32,7 +32,7 @@ def pack_float(x: torch.FloatTensor, weights_dtype: str) -> torch.Tensor: x = x.to(dtype=torch.float32).view(torch.int32) x = torch.where( - torch.greater( + torch.gt( torch.bitwise_and(x, -(1 << (mantissa_difference-4)) & ~(-mantissa_mask)), (1 << (mantissa_difference-1)), ), diff --git a/modules/sdnq/quantizer.py b/modules/sdnq/quantizer.py index f0a7d2426..99cf7840a 100644 --- a/modules/sdnq/quantizer.py +++ b/modules/sdnq/quantizer.py @@ -391,7 +391,7 @@ def sdnq_quantize_layer_weight(weight, layer_class_name=None, weights_dtype="int @devices.inference_context() -def sdnq_quantize_layer_weight_dynamic(weight, layer_class_name=None, weights_dtype="int2", quantized_matmul_dtype=None, torch_dtype=None, group_size=0, svd_rank=32, svd_steps=8, dynamic_loss_threshold=1e-2, use_svd=False, use_quantized_matmul=False, use_dynamic_quantization=False, use_stochastic_rounding=False, dequantize_fp32=False, svd_up=None, svd_down=None, param_name=None): # pylint: disable=unused-argument +def sdnq_quantize_layer_weight_dynamic(weight, layer_class_name=None, weights_dtype="int2", quantized_matmul_dtype=None, torch_dtype=None, group_size=0, svd_rank=32, svd_steps=8, dynamic_loss_threshold=1e-2, use_svd=False, use_quantized_matmul=False, use_dynamic_quantization=False, use_stochastic_rounding=False, dequantize_fp32=False, param_name=None): # pylint: disable=unused-argument if torch_dtype is None: torch_dtype = weight.dtype weights_dtype_order_to_use = weights_dtype_order_fp32 if torch_dtype in {torch.float32, torch.float64} else weights_dtype_order @@ -431,7 +431,7 @@ def sdnq_quantize_layer_weight_dynamic(weight, layer_class_name=None, weights_dt param_name=param_name, ) - if not svd_is_transposed and sdnq_dequantizer.use_quantized_matmul: + if use_svd and not svd_is_transposed and sdnq_dequantizer.use_quantized_matmul: svd_up = svd_up.t_() svd_down = svd_down.t_() svd_is_transposed = True