From 7ada86032a892f72a6db633a82d0c77d3d631586 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sat, 25 Oct 2025 13:22:22 -0400 Subject: [PATCH] add krea, cleanup, lint Signed-off-by: Vladimir Mandic --- CHANGELOG.md | 10 +++++++--- TODO.md | 6 ------ html/reference.json | 30 ++++++++++++++++++++---------- modules/sd_models.py | 2 +- pipelines/generic.py | 9 ++++----- 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f6ef3205..72cf151c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,13 @@ - **Models** - [Tencent HunyuanImage 2.1](https://huggingface.co/tencent/HunyuanImage-2.1) in *full*, *distilled* and *refiner* variants HunyuanImage-2.1 is a large (51GB) T2I model capable of natively generating 2K images and uses Qwen2.5 + T5 text-encoders and 32x VAE - - networks reference section is now split into actual **Reference** *Base* models plus: - - **Distilled**: distilled variants of base models, for example *Turbo or Lightning* + - **Reference** networks section is now split into actual *Base* models plus: + - **Distilled**: distilled variants of base models + examples: *Turbo, Lightning, Lite, SRPO, Distill, Pruning, etc.* - **Quantized**: pre-quantized variants of the base models using SDNQ-SVD quantization for optimal quality and smallest possible resource usage - - **Community**: community highlights, for example, *Illustrious, Pony, NoobAI* + examples: *FLUX.1-Dev/Krea/Kontext, Qwen-Image/Edit/2509, Chroma1-HD, WAN-2.2-A44B, etc.* + - **Community**: community highlights + examples: *Tempest, Juggernaut, Illustrious, Pony, NoobAI, etc.* - **Features** - **offline mode**: enable in *settings -> hugginface* enables fully offline mode where previously downloaded models can be used as-is @@ -25,6 +28,7 @@ - enhance `--optional` flag to pre-install optional packages - add `[lora]` to recognized filename patterns - add **Apple DepthPro** controlnet processor, thanks @nolbert82 + - when using **shared-t5** *(default)*, it will load standard or pre-quant depending on model - **Fixes** - startup error with `--profile` enabled if using `--skip` - restore orig init image for each batch sequence diff --git a/TODO.md b/TODO.md index 7554361a6..226f295a3 100644 --- a/TODO.md +++ b/TODO.md @@ -2,12 +2,6 @@ Main ToDo list can be found at [GitHub projects](https://github.com/users/vladmandic/projects) -## Blockers - -- Load pre-quantized T5: -- Wan-2.2-5B VAE tiling: -- Wan-2.2-14V VACE single-stage: - ## Future Candidates - [Kanvas](https://github.com/vladmandic/kanvas) diff --git a/html/reference.json b/html/reference.json index 437e7461c..fc14806f5 100644 --- a/html/reference.json +++ b/html/reference.json @@ -909,17 +909,27 @@ "FLUX.1-Dev sdnq-svd-uint4": { "path": "Disty0/FLUX.1-dev-SDNQ-uint4-svd-r32", "preview": "Disty0--FLUX.1-dev-SDNQ-uint4-svd-r32.jpg", - "desc": "4 bit (UINT4 with SVD rank 32) quantization of black-forest-labs/FLUX.1-dev using SDNQ.", + "desc": "Quantization of black-forest-labs/FLUX.1-dev using SDNQ: sdnq-svd 4-bit uint with svd rank 32", "skip": true, "tags": "quantized", - "size": 13.53, + "size": 12.60, + "date": "2025 October", + "extras": "" + }, + "FLUX.1-Dev Krea sdnq-svd-uint4": { + "path": "Disty0/FLUX.1-Krea-dev-SDNQ-uint4-svd-r32", + "preview": "Disty0--FLUX.1-dev-SDNQ-uint4-svd-r32.jpg", + "desc": "Quantization of black-forest-labs/FLUX.1-Krea-dev using SDNQ: sdnq-svd 4-bit uint with svd rank 32", + "skip": true, + "tags": "quantized", + "size": 12.60, "date": "2025 October", "extras": "" }, "Chroma1-HD sdnq-svd-uint4": { "path": "Disty0/Chroma1-HD-SDNQ-uint4-svd-r32", "preview": "Disty0--Chroma1-HD-SDNQ-uint4-svd-r32.jpg", - "desc": "quantization of lodestones/Chroma1-HD using SDNQ: sdnq-svd 4-bit uint with svd rank 32", + "desc": "Quantization of lodestones/Chroma1-HD using SDNQ: sdnq-svd 4-bit uint with svd rank 32", "skip": true, "tags": "quantized", "size": 11.89, @@ -929,7 +939,7 @@ "Wan-AI Wan2.2 A14B T2I sdnq-svd-uint4": { "path": "Disty0/Wan2.2-T2V-A14B-SDNQ-uint4-svd-r32", "preview": "Wan-AI--Wan2.2-T2V-A14B-Diffusers.jpg", - "desc": "quantization of Wan-AI/Wan2.2-T2V-A14B-Diffusers using SDNQ: sdnq-svd 4-bit uint with svd rank 32", + "desc": "Quantization of black-forest-labs/FLUX.1-dev using SDNQ: sdnq-svd 4-bit uint with svd rank 32", "skip": true, "tags": "quantized", "date": "2025 October", @@ -939,7 +949,7 @@ "Wan-AI Wan2.2 A14B I2I sdnq-svd-uint4": { "path": "Disty0/Wan2.2-I2V-A14B-SDNQ-uint4-svd-r32", "preview": "Wan-AI--Wan2.2-T2V-A14B-Diffusers.jpg", - "desc": "quantization of Wan-AI/Wan2.2-I2V-A14B-Diffusers using SDNQ: sdnq-svd 4-bit uint with svd rank 32", + "desc": "Quantization of Laxhar/noobai-XL-1.1 using SDNQ: sdnq-svd 4-bit uint with svd rank 128", "skip": true, "tags": "quantized", "date": "2025 October", @@ -949,7 +959,7 @@ "Qwen-Image sdnq-svd-uint4": { "path": "Disty0/Qwen-Image-SDNQ-uint4-svd-r32", "preview": "Qwen--Qwen-Image.jpg", - "desc": "quantization of Qwen/Qwen-Image using SDNQ: sdnq-svd 4-bit uint with svd rank 32", + "desc": "Quantization of Qwen/Qwen-Image using SDNQ: sdnq-svd 4-bit uint with svd rank 32", "skip": true, "tags": "quantized", "date": "2025 October", @@ -959,7 +969,7 @@ "Qwen-Image-Edit sdnq-svd-uint4": { "path": "Disty0/Qwen-Image-Edit-SDNQ-uint4-svd-r32", "preview": "Qwen--Qwen-Image-Edit.jpg", - "desc": "quantization of Qwen/Qwen-Image-Edit using SDNQ: sdnq-svd 4-bit uint with svd rank 32", + "desc": "Quantization of Qwen/Qwen-Image-Edit using SDNQ: sdnq-svd 4-bit uint with svd rank 32", "skip": true, "tags": "quantized", "date": "2025 October", @@ -969,7 +979,7 @@ "Qwen-Image-Edit-2509 sdnq-svd-uint4": { "path": "Disty0/Qwen-Image-Edit-2509-SDNQ-uint4-svd-r32", "preview": "Qwen--Qwen-Image-Edit-2509.jpg", - "desc": "quantization of Qwen/Qwen-Image-Edit-2509 using SDNQ: sdnq-svd 4-bit uint with svd rank 32", + "desc": "Quantization of Qwen/Qwen-Image-Edit-2509 using SDNQ: sdnq-svd 4-bit uint with svd rank 32", "skip": true, "tags": "quantized", "date": "2025 October", @@ -980,7 +990,7 @@ "NoobAI-XL v1.1 epsilon sdnq-svd-uint4": { "path": "Disty0/NoobAI-XL-v1.1-SDNQ-uint4-svd-r128", "preview": "Disty0--NoobAI-XL-v1.1-SDNQ-uint4-svd-r128.jpg", - "desc": "quantization of Laxhar/noobai-XL-1.1 using SDNQ: sdnq-svd 4-bit uint with svd rank 128", + "desc": "Quantization of Laxhar/noobai-XL-1.1 using SDNQ: sdnq-svd 4-bit uint with svd rank 128", "skip": true, "tags": "quantized", "size": 3.37, @@ -990,7 +1000,7 @@ "NoobAI-XL v1.0 v-pred sdnq-svd-uint4": { "path": "Disty0/NoobAI-XL-Vpred-v1.0-SDNQ-uint4-svd-r128", "preview": "Disty0--NoobAI-XL-Vpred-v1.0-SDNQ-uint4-svd-r128.jpg", - "desc": "quantization of Laxhar/noobai-XL-Vpred-1.0 using SDNQ: sdnq-svd 4-bit uint with svd rank 128", + "desc": "Quantization of Laxhar/noobai-XL-Vpred-1.0 using SDNQ: sdnq-svd 4-bit uint with svd rank 128", "skip": true, "tags": "quantized", "size": 3.37, diff --git a/modules/sd_models.py b/modules/sd_models.py index 534c3af58..4782fb288 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -1149,7 +1149,7 @@ def add_noise_pred_to_diffusers_callback(pipe): return pipe if pipe.__class__.__name__.startswith("StableCascade") and ("predicted_image_embedding" not in pipe._callback_tensor_inputs): # pylint: disable=protected-access pipe.prior_pipe._callback_tensor_inputs.append("predicted_image_embedding") # pylint: disable=protected-access - elif "noise_pred" not in pipe._callback_tensor_inputs: + elif "noise_pred" not in pipe._callback_tensor_inputs: # pylint: disable=protected-access if pipe.__class__.__name__.startswith("StableDiffusion"): pipe._callback_tensor_inputs.append("noise_pred") # pylint: disable=protected-access elif hasattr(pipe, "scheduler") and "flow" in pipe.scheduler.__class__.__name__.lower(): diff --git a/pipelines/generic.py b/pipelines/generic.py index 384e7f25b..430ee34bc 100644 --- a/pipelines/generic.py +++ b/pipelines/generic.py @@ -13,7 +13,7 @@ def load_transformer(repo_id, cls_name, load_config={}, subfolder="transformer", jobid = shared.state.begin('Load DiT') try: if 'sdnq-' in repo_id.lower(): - from modules import sdnq # register to diffusers and transformers + 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 @@ -86,7 +86,7 @@ def load_text_encoder(repo_id, cls_name, load_config={}, subfolder="text_encoder jobid = shared.state.begin('Load TE') try: if 'sdnq-' in repo_id.lower(): - from modules import sdnq # register to diffusers and transformers + 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) dtype = dtype or devices.dtype @@ -140,9 +140,8 @@ def load_text_encoder(repo_id, cls_name, load_config={}, subfolder="text_encoder load_args['subfolder'] = 'text_encoder_2' else: repo_id = 'Disty0/t5-xxl' - if 'sdnq-' not in repo_id.lower(): - with open(os.path.join('configs', 'flux', 'text_encoder_2', 'config.json'), encoding='utf8') as f: - load_args['config'] = transformers.T5Config(**json.load(f)) + with open(os.path.join('configs', 'flux', 'text_encoder_2', 'config.json'), encoding='utf8') as f: + load_args['config'] = transformers.T5Config(**json.load(f)) shared.log.debug(f'Load model: text_encoder="{repo_id}" cls={cls_name.__name__} quant="{quant_type}" shared={shared.opts.te_shared_t5} args={load_args}') if dtype is not None: load_args['torch_dtype'] = dtype