diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-12-16 07:05:10 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-12-16 07:05:10 +0000 |
commit | e9c6325fc635302e2b4b8295345833cb8b15f7fb (patch) | |
tree | b501070bcf1ae667b1555e682598973818c945e0 /scripts/postprocessing_upscale.py | |
parent | 29f04149b60bcf6e8e2b41a161d6cc7e8981710f (diff) | |
parent | 7504f14503d6ce5a014f1c558ea4f4d57675e1e9 (diff) | |
download | stable-diffusion-webui-gfx803-e9c6325fc635302e2b4b8295345833cb8b15f7fb.tar.gz stable-diffusion-webui-gfx803-e9c6325fc635302e2b4b8295345833cb8b15f7fb.tar.bz2 stable-diffusion-webui-gfx803-e9c6325fc635302e2b4b8295345833cb8b15f7fb.zip |
Merge branch 'dev' into torch210
Diffstat (limited to 'scripts/postprocessing_upscale.py')
-rw-r--r-- | scripts/postprocessing_upscale.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/postprocessing_upscale.py b/scripts/postprocessing_upscale.py index eb42a29e..ed709688 100644 --- a/scripts/postprocessing_upscale.py +++ b/scripts/postprocessing_upscale.py @@ -81,6 +81,14 @@ class ScriptPostprocessingUpscale(scripts_postprocessing.ScriptPostprocessing): return image
+ def process_firstpass(self, pp: scripts_postprocessing.PostprocessedImage, upscale_mode=1, upscale_by=2.0, upscale_to_width=None, upscale_to_height=None, upscale_crop=False, upscaler_1_name=None, upscaler_2_name=None, upscaler_2_visibility=0.0):
+ if upscale_mode == 1:
+ pp.shared.target_width = upscale_to_width
+ pp.shared.target_height = upscale_to_height
+ else:
+ pp.shared.target_width = int(pp.image.width * upscale_by)
+ pp.shared.target_height = int(pp.image.height * upscale_by)
+
def process(self, pp: scripts_postprocessing.PostprocessedImage, upscale_mode=1, upscale_by=2.0, upscale_to_width=None, upscale_to_height=None, upscale_crop=False, upscaler_1_name=None, upscaler_2_name=None, upscaler_2_visibility=0.0):
if upscaler_1_name == "None":
upscaler_1_name = None
@@ -126,6 +134,10 @@ class ScriptPostprocessingUpscaleSimple(ScriptPostprocessingUpscale): "upscaler_name": upscaler_name,
}
+ def process_firstpass(self, pp: scripts_postprocessing.PostprocessedImage, upscale_by=2.0, upscaler_name=None):
+ pp.shared.target_width = int(pp.image.width * upscale_by)
+ pp.shared.target_height = int(pp.image.height * upscale_by)
+
def process(self, pp: scripts_postprocessing.PostprocessedImage, upscale_by=2.0, upscaler_name=None):
if upscaler_name is None or upscaler_name == "None":
return
|