From 2b222962c3f9168d2333a73ea2dd525880ec215c Mon Sep 17 00:00:00 2001 From: strint Date: Thu, 16 Oct 2025 21:42:02 +0800 Subject: [PATCH] add debug log --- comfy/model_base.py | 3 +++ comfy/sd.py | 2 ++ nodes.py | 2 ++ 3 files changed, 7 insertions(+) diff --git a/comfy/model_base.py b/comfy/model_base.py index 8274c7dea..7dead0167 100644 --- a/comfy/model_base.py +++ b/comfy/model_base.py @@ -297,8 +297,11 @@ class BaseModel(torch.nn.Module): if k.startswith(unet_prefix): to_load[k[len(unet_prefix):]] = sd.pop(k) + logging.info(f"load model weights start, keys {keys}") to_load = self.model_config.process_unet_state_dict(to_load) + logging.info(f"load model {self.model_config} weights process end, keys {keys}") m, u = self.diffusion_model.load_state_dict(to_load, strict=False) + logging.info(f"load model {self.model_config} weights end, keys {keys}") if len(m) > 0: logging.warning("unet missing: {}".format(m)) diff --git a/comfy/sd.py b/comfy/sd.py index 28bee248d..16d54f08b 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -1347,7 +1347,9 @@ def load_diffusion_model_state_dict(sd, model_options={}): def load_diffusion_model(unet_path, model_options={}): sd = comfy.utils.load_torch_file(unet_path) + logging.info(f"load model start, path {unet_path}") model = load_diffusion_model_state_dict(sd, model_options=model_options) + logging.info(f"load model end, path {unet_path}") if model is None: logging.error("ERROR UNSUPPORTED DIFFUSION MODEL {}".format(unet_path)) raise RuntimeError("ERROR: Could not detect model type of: {}\n{}".format(unet_path, model_detection_error_hint(unet_path, sd))) diff --git a/nodes.py b/nodes.py index 7cfa8ca14..25ccc9e42 100644 --- a/nodes.py +++ b/nodes.py @@ -922,7 +922,9 @@ class UNETLoader: model_options["dtype"] = torch.float8_e5m2 unet_path = folder_paths.get_full_path_or_raise("diffusion_models", unet_name) + logging.info(f"load unet node start, path {unet_path}") model = comfy.sd.load_diffusion_model(unet_path, model_options=model_options) + logging.info(f"load unet node end, path {unet_path}") return (model,) class CLIPLoader: