diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-11 08:14:36 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-11 08:14:36 +0000 |
commit | 5de806184f6687e46cf936b92055146dc6cf2994 (patch) | |
tree | d84c2daa8798c3d2f8e99e17234a40065491182d /modules/extras.py | |
parent | 12c4d5c6b5bf9dd50d0601c36af4f99b65316d58 (diff) | |
parent | 948533950c9db5069a874d925fadd50bac00fdb5 (diff) | |
download | stable-diffusion-webui-gfx803-5de806184f6687e46cf936b92055146dc6cf2994.tar.gz stable-diffusion-webui-gfx803-5de806184f6687e46cf936b92055146dc6cf2994.tar.bz2 stable-diffusion-webui-gfx803-5de806184f6687e46cf936b92055146dc6cf2994.zip |
Merge branch 'master' into hypernetwork-training
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,
|