improve type inference

This commit is contained in:
hnmr293
2023-04-03 23:49:59 +09:00
parent 97c5eda4ff
commit 3cd4350814
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -51,7 +51,10 @@ class Dict2Model:
setattr(utils, 'load_torch_file', load_torch_file_hook)
try:
return sd.load_checkpoint(config_path, None, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
model, clip, vae = sd.load_checkpoint(config_path, None, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
assert clip is not None
assert vae is not None
return (model, clip, vae)
finally:
setattr(sd, 'load_torch_file', load_torch_file_org)
+1 -1
View File
@@ -11,7 +11,7 @@ def merge(
half: str,
ignore_keys_only_in_B: bool = False,
):
result = dict()
result: Dict[str,torch.Tensor] = dict()
for key in tqdm.tqdm(model_A.keys()):
if key not in model_B:
print(f' key {key} is found in model_A but not model_B')