first modification

This commit is contained in:
sylym
2023-03-28 00:34:18 +08:00
parent 686791ef70
commit 8a005a02ee
3 changed files with 67 additions and 130 deletions
+4 -3
View File
@@ -102,12 +102,13 @@ def load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, e
model = instantiate_from_config(model_config)
model = load_model_weights(model, sd, verbose=False, load_state_dict_to=load_state_dict_to)
model.model.diffusion_model = convert_unet_checkpoint(sd, OmegaConf.create({"model": model_config}))
with torch.inference_mode(mode=False):
model.model.diffusion_model = convert_unet_checkpoint(sd, OmegaConf.create({"model": model_config}))
if model_management.xformers_enabled():
model.model.diffusion_model.enable_xformers_memory_efficient_attention()
if fp16:
model = model.half()
#if fp16:
# model = model.half()
return (ModelPatcher(model), clip, vae)