mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-12-18 02:23:06 +08:00
add debug log
This commit is contained in:
parent
f40e00cb35
commit
2b222962c3
@ -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))
|
||||
|
||||
|
||||
@ -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)))
|
||||
|
||||
2
nodes.py
2
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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user