diff options
author | DepFA <35278260+dfaker@users.noreply.github.com> | 2022-10-09 23:38:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-09 23:38:54 +0000 |
commit | 4117afff11c7b0a2162c73ea02be8cfa30d02640 (patch) | |
tree | af26f1b0c9eac8c024d2e51ec8fb5ca4a4d45ed3 /modules/extras.py | |
parent | e2c2925eb4d634b186de2c76798162ec56e2f869 (diff) | |
parent | 45fbd1c5fec887988ab555aac75a999d4f3aff40 (diff) | |
download | stable-diffusion-webui-gfx803-4117afff11c7b0a2162c73ea02be8cfa30d02640.tar.gz stable-diffusion-webui-gfx803-4117afff11c7b0a2162c73ea02be8cfa30d02640.tar.bz2 stable-diffusion-webui-gfx803-4117afff11c7b0a2162c73ea02be8cfa30d02640.zip |
Merge branch 'master' into embed-embeddings-in-images
Diffstat (limited to 'modules/extras.py')
-rw-r--r-- | modules/extras.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/extras.py b/modules/extras.py index 1d9e64e5..41e8612c 100644 --- a/modules/extras.py +++ b/modules/extras.py @@ -29,7 +29,7 @@ def run_extras(extras_mode, image, image_folder, gfpgan_visibility, codeformer_v if extras_mode == 1:
#convert file to pillow image
for img in image_folder:
- image = Image.fromarray(np.array(Image.open(img)))
+ image = Image.open(img)
imageArr.append(image)
imageNameArr.append(os.path.splitext(img.orig_name)[0])
else:
@@ -98,6 +98,10 @@ def run_extras(extras_mode, image, image_folder, gfpgan_visibility, codeformer_v no_prompt=True, grid=False, pnginfo_section_name="extras", existing_info=existing_pnginfo,
forced_filename=image_name if opts.use_original_name_batch else None)
+ if opts.enable_pnginfo:
+ image.info = existing_pnginfo
+ image.info["extras"] = info
+
outputs.append(image)
devices.torch_gc()
@@ -169,9 +173,9 @@ def run_modelmerger(primary_model_name, secondary_model_name, interp_method, int print(f"Loading {secondary_model_info.filename}...")
secondary_model = torch.load(secondary_model_info.filename, map_location='cpu')
-
- theta_0 = primary_model['state_dict']
- theta_1 = secondary_model['state_dict']
+
+ theta_0 = sd_models.get_state_dict_from_checkpoint(primary_model)
+ theta_1 = sd_models.get_state_dict_from_checkpoint(secondary_model)
theta_funcs = {
"Weighted Sum": weighted_sum,
|