From 7ac8dbabe3128ad0f68b65c34de21b1091b36a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E9=9B=AA=E5=B3=B0?= Date: Wed, 8 Jan 2025 13:54:55 +0800 Subject: [PATCH] fix tensor(640) error for gguf --- brushnet_nodes.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/brushnet_nodes.py b/brushnet_nodes.py index e8bc9f1..4e83b7f 100644 --- a/brushnet_nodes.py +++ b/brushnet_nodes.py @@ -937,9 +937,13 @@ def add_brushnet_patch(model, brushnet, torch_dtype, conditioning_latents, is_SDXL = isinstance(model.model.model_config, comfy.supported_models.SDXL) - fp8 = model.model.model_config.optimizations.get("fp8", model.model.model_config.scaled_fp8 is not None) - operations = comfy.ops.pick_operations(model.model.model_config.unet_config.get("dtype", None), model.model.manual_cast_dtype, - fp8_optimizations=fp8, scaled_fp8=model.model.model_config.scaled_fp8) + if model.model.model_config.custom_operations is None: + fp8 = model.model.model_config.optimizations.get("fp8", model.model.model_config.scaled_fp8 is not None) + operations = comfy.ops.pick_operations(model.model.model_config.unet_config.get("dtype", None), model.model.manual_cast_dtype, + fp8_optimizations=fp8, scaled_fp8=model.model.model_config.scaled_fp8) + else: + # such as gguf + operations = model.model.model_config.custom_operations if is_SDXL: input_blocks = [[0, operations.Conv2d],