sdnq always-register

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-11-16 08:13:23 -05:00
parent cf9c97dc19
commit c50c987a33
7 changed files with 10 additions and 18 deletions
+5 -4
View File
@@ -1,15 +1,15 @@
# Change Log for SD.Next
## Update for 2025-11-14
## Update for 2025-11-16
### TBD
Merge commit: `f903a36d9`
### Highlights for 2025-11-14
### Highlights for 2025-11-16
New native [kanvas](https://vladmandic.github.io/sdnext-docs/Kanvas/) module for image manipulation that fully replaces img2img, inpaint and outpaint controls
And a first cloud model with **Google's Nano Banana**
And a first cloud model with **Google's Nano Banana** plus new **Photoroom PRX** model
![Screenshot](https://github.com/user-attachments/assets/54b25586-b611-4d70-a28f-ee3360944034)
@@ -35,7 +35,7 @@ And a first cloud model with **Google's Nano Banana**
- **auth**: strong-enforce auth check on all api endpoints
- **amdgpu**: prefer rocm-on-windows over zluda
- **Internal**
- torch: update to `torch==2.9.1` for cuda, ipex, openvino, rocm backends
- torch: update to `torch==2.9.1` for *cuda, ipex, openvino, rocm* backends
- attention: refactor attention handling
- scripts: remove obsolete video scripts
- lint: update global lint rules
@@ -45,6 +45,7 @@ And a first cloud model with **Google's Nano Banana**
- installer: reduce requirements
- installer: auto-restart on self-update
- server: set correct mime-types
- sdnq: unconditional register on startup
- **Fixes**
- hires: strength save/load in metadata, thanks @awsr
- imgi2img: fix initial scale tab, thanks @awsr
+1 -2
View File
@@ -455,7 +455,6 @@ def load_diffuser_folder(model_type, pipeline, checkpoint_info, diffusers_load_c
try: #0 - using detected model type and pipeline
if (model_type is not None) and (pipeline is not None):
if ('sdnq' in model_type.lower()) or ('sdnq' in checkpoint_info.path.lower()):
from modules import sdnq # pylint: disable=unused-import # register to diffusers and transformers
global allow_post_quant # pylint: disable=global-statement
allow_post_quant = False
sd_model = pipeline.from_pretrained(checkpoint_info.path, cache_dir=shared.opts.diffusers_dir, **diffusers_load_config)
@@ -572,7 +571,6 @@ 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')
@@ -585,6 +583,7 @@ def load_sdnq_module(fn: str, module_name: str, load_method: str):
return None, module_name, 0
model_name = os.path.join(fn, module_name)
try:
from modules import sdnq
module = sdnq.load_sdnq_model(
model_path=model_name,
quantization_config=quantization_config,
+3
View File
@@ -837,6 +837,9 @@ elif sys.platform == "win32" and (devices.backend == "zluda" or devices.backend
if devices.backend == "zluda":
from modules.zluda import initialize_zluda
initialize_zluda()
from modules import sdnq # pylint: disable=unused-import # register to diffusers and transformers
log.debug('Quantization: registered=SDNQ')
try:
log.info(f'Device: {print_dict(devices.get_gpu_info())}')
except Exception as ex:
-6
View File
@@ -60,9 +60,6 @@ def load_model(selected: models_def.Model):
selected.te_folder = 'text_encoder'
selected.te_revision = None
if 'sdnq-' in (selected.te or selected.repo).lower():
from modules import sdnq # pylint: disable=unused-import # register to diffusers and transformers
shared.log.debug(f'Video load: module=te repo="{selected.te or selected.repo}" folder="{selected.te_folder}" cls={selected.te_cls.__name__} quant={model_quant.get_quant_type(quant_args)}')
kwargs["text_encoder"] = selected.te_cls.from_pretrained(
pretrained_model_name_or_path=selected.te or selected.repo,
@@ -96,9 +93,6 @@ def load_model(selected: models_def.Model):
else:
shared.log.debug(f'Video load: module=transformer repo="{selected.dit or selected.repo}" module="{dit_folder}" folder="{dit_folder}" cls={selected.dit_cls.__name__} skip')
if 'sdnq-' in (selected.dit or selected.repo).lower():
from modules import sdnq # pylint: disable=unused-import # register to diffusers and transformers
if selected.dit_folder is None:
selected.dit_folder = ['transformer']
if isinstance(selected.dit_folder, list) or isinstance(selected.dit_folder, tuple):
-4
View File
@@ -18,8 +18,6 @@ def load_transformer(repo_id, cls_name, load_config=None, subfolder="transformer
modules_dtype_dict = {}
jobid = shared.state.begin('Load DiT')
try:
if 'sdnq-' in repo_id.lower():
from modules import sdnq # pylint: disable=unused-import # register to diffusers and transformers
load_args, quant_args = model_quant.get_dit_args(load_config, module='Model', device_map=True, allow_quant=allow_quant, modules_to_not_convert=modules_to_not_convert, modules_dtype_dict=modules_dtype_dict)
quant_type = model_quant.get_quant_type(quant_args)
dtype = dtype or devices.dtype
@@ -100,8 +98,6 @@ def load_text_encoder(repo_id, cls_name, load_config=None, subfolder="text_encod
modules_dtype_dict = {}
jobid = shared.state.begin('Load TE')
try:
if 'sdnq-' in repo_id.lower():
from modules import sdnq # pylint: disable=unused-import # register to diffusers and transformers
load_args, quant_args = model_quant.get_dit_args(load_config, module='TE', device_map=True, allow_quant=allow_quant, modules_to_not_convert=modules_to_not_convert, modules_dtype_dict=modules_dtype_dict)
quant_type = model_quant.get_quant_type(quant_args)
load_args.pop('torch_dtype', None)
-1
View File
@@ -50,7 +50,6 @@ def load_hyimage3(checkpoint_info, diffusers_load_config=None): # pylint: disabl
allow_quant = True
if 'sdnq-' in repo_id.lower():
from modules import sdnq # pylint: disable=unused-import # register to diffusers and transformers
sd_models.allow_post_quant = False # we already handled it
allow_quant = False
+1 -1
Submodule wiki updated: 21b5e921d8...ead7aebf85