mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
Make SDNQ not depended on quantization_config.json and fix invalid quantization_config getting attached to the model on load
This commit is contained in:
@@ -559,11 +559,16 @@ def load_diffuser_file(model_type, pipeline, checkpoint_info, diffusers_load_con
|
||||
def load_sdnq_module(fn: str, module_name: str, load_method: str):
|
||||
from modules import sdnq
|
||||
t0 = time.time()
|
||||
quantization_config = None
|
||||
quantization_config_path = os.path.join(fn, module_name, 'quantization_config.json')
|
||||
if not os.path.exists(quantization_config_path):
|
||||
model_config_path = os.path.join(fn, module_name, 'config.json')
|
||||
if os.path.exists(quantization_config_path):
|
||||
quantization_config = shared.readfile(quantization_config_path, silent=True)
|
||||
elif os.path.exists(model_config_path):
|
||||
quantization_config = shared.readfile(model_config_path, silent=True).get("quantization_config", None)
|
||||
if quantization_config is None:
|
||||
return None, module_name, 0
|
||||
model_name = os.path.join(fn, module_name)
|
||||
quantization_config = shared.readfile(quantization_config_path, silent=True)
|
||||
try:
|
||||
module = sdnq.load_sdnq_model(
|
||||
model_path=model_name,
|
||||
|
||||
Reference in New Issue
Block a user