From 5e29e7a488b3f48afc6c4a3cb8ed110976d0ebb8 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Wed, 6 Nov 2024 04:56:42 -0500 Subject: [PATCH] Remove scaled_fp8 key after reading it to silence warning. --- comfy/model_detection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/comfy/model_detection.py b/comfy/model_detection.py index 229fe499..b98820d8 100644 --- a/comfy/model_detection.py +++ b/comfy/model_detection.py @@ -321,8 +321,9 @@ def model_config_from_unet(state_dict, unet_key_prefix, use_base_if_no_match=Fal if model_config is None and use_base_if_no_match: model_config = comfy.supported_models_base.BASE(unet_config) - scaled_fp8_weight = state_dict.get("{}scaled_fp8".format(unet_key_prefix), None) - if scaled_fp8_weight is not None: + scaled_fp8_key = "{}scaled_fp8".format(unet_key_prefix) + if scaled_fp8_key in state_dict: + scaled_fp8_weight = state_dict.pop(scaled_fp8_key) model_config.scaled_fp8 = scaled_fp8_weight.dtype if model_config.scaled_fp8 == torch.float32: model_config.scaled_fp8 = torch.float8_e4m3fn