diff options
author | ssysm <me@theeditorstudio.com> | 2022-10-10 03:20:39 +0000 |
---|---|---|
committer | ssysm <me@theeditorstudio.com> | 2022-10-10 03:20:39 +0000 |
commit | 6fdad291bd5a5edacedec73cf4d0e3852d00300e (patch) | |
tree | 5901473f27ea0410728150a1a6f2da373ea949b1 /modules/extras.py | |
parent | cc92dc1f8d73dd4d574c4c8ccab78b7fc61e440b (diff) | |
parent | 45fbd1c5fec887988ab555aac75a999d4f3aff40 (diff) | |
download | stable-diffusion-webui-gfx803-6fdad291bd5a5edacedec73cf4d0e3852d00300e.tar.gz stable-diffusion-webui-gfx803-6fdad291bd5a5edacedec73cf4d0e3852d00300e.tar.bz2 stable-diffusion-webui-gfx803-6fdad291bd5a5edacedec73cf4d0e3852d00300e.zip |
Merge branch 'master' of https://github.com/AUTOMATIC1111/stable-diffusion-webui into upstream-master
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,
|