From 8493db648158a71eb9582b6bffca73365c113907 Mon Sep 17 00:00:00 2001 From: City <125218114+city96@users.noreply.github.com> Date: Thu, 18 Dec 2025 09:03:26 +0100 Subject: [PATCH] Limit this fix to BF16 --- loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader.py b/loader.py index 096ce9f..1948027 100644 --- a/loader.py +++ b/loader.py @@ -120,7 +120,7 @@ def gguf_sd_loader(path, handle_prefix="model.diffusion_model.", return_arch=Fal state_dict[sd_key] = GGMLTensor(torch_tensor, tensor_type=tensor.tensor_type, tensor_shape=shape) # 1D tensors shouldn't be quantized, this is a fix for BF16 - if len(shape) <= 1 and is_quantized(state_dict[sd_key]): + if len(shape) <= 1 and tensor.tensor_type == gguf.GGMLQuantizationType.BF16: state_dict[sd_key] = dequantize_tensor(state_dict[sd_key], dtype=torch.float32) # keep track of loaded tensor types