Skip to content

Commit

Permalink
Remove the ckpt_path from load_state_dict_guess_config.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Aug 11, 2024
1 parent 925fff2 commit 0d82a79
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions comfy/sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,12 @@ class ModelSamplingAdvanced(comfy.model_sampling.ModelSamplingDiscrete, comfy.mo

def load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, output_clipvision=False, embedding_directory=None, output_model=True):
sd = comfy.utils.load_torch_file(ckpt_path)
return load_state_dict_guess_config(sd, ckpt_path, output_vae, output_clip, output_clipvision, embedding_directory, output_model)
out = load_state_dict_guess_config(sd, output_vae, output_clip, output_clipvision, embedding_directory, output_model)
if out is None:
raise RuntimeError("ERROR: Could not detect model type of: {}".format(ckpt_path))
return out

def load_state_dict_guess_config(sd, ckpt_path="<memory>", output_vae=True, output_clip=True, output_clipvision=False, embedding_directory=None, output_model=True):
def load_state_dict_guess_config(sd, output_vae=True, output_clip=True, output_clipvision=False, embedding_directory=None, output_model=True):
clip = None
clipvision = None
vae = None
Expand All @@ -516,7 +519,7 @@ def load_state_dict_guess_config(sd, ckpt_path="<memory>", output_vae=True, outp

model_config = model_detection.model_config_from_unet(sd, diffusion_model_prefix)
if model_config is None:
raise RuntimeError("ERROR: Could not detect model type of: {}".format(ckpt_path))
return None

unet_weight_dtype = list(model_config.supported_inference_dtypes)
if weight_dtype is not None:
Expand Down

0 comments on commit 0d82a79

Please sign in to comment.