alternative to `load_checkpoint_guess_config` that accepts a loaded state dict (#4249)
* make alternative fn * add back ckpt path as 2nd argument?
This commit is contained in:
parent
75b9b55b22
commit
925fff26fd
|
@ -500,13 +500,14 @@ def load_checkpoint(config_path=None, ckpt_path=None, output_vae=True, output_cl
|
|||
|
||||
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)
|
||||
sd_keys = sd.keys()
|
||||
return load_state_dict_guess_config(sd, ckpt_path, output_vae, output_clip, output_clipvision, embedding_directory, output_model)
|
||||
|
||||
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):
|
||||
clip = None
|
||||
clipvision = None
|
||||
vae = None
|
||||
model = None
|
||||
model_patcher = None
|
||||
clip_target = None
|
||||
|
||||
diffusion_model_prefix = model_detection.unet_prefix_from_state_dict(sd)
|
||||
parameters = comfy.utils.calculate_parameters(sd, diffusion_model_prefix)
|
||||
|
|
Loading…
Reference in New Issue