aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/postprocessing_upscale.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2024-01-01 13:39:51 +0000
committerGitHub <noreply@github.com>2024-01-01 13:39:51 +0000
commitdfd64382211317cc46ad337c373492bfc420fa18 (patch)
tree3b1b2f5f3648da07430f54d1c155ce379a6fa3f7 /scripts/postprocessing_upscale.py
parent3d15e58b0a30f2ef1e731f9e429f4d3cf1c259c5 (diff)
parent0ce67cb61806cf43f4d726d4705a4f6fdc2540e6 (diff)
downloadstable-diffusion-webui-gfx803-dfd64382211317cc46ad337c373492bfc420fa18.tar.gz
stable-diffusion-webui-gfx803-dfd64382211317cc46ad337c373492bfc420fa18.tar.bz2
stable-diffusion-webui-gfx803-dfd64382211317cc46ad337c373492bfc420fa18.zip
Merge branch 'dev' into feat/interrupted-end
Diffstat (limited to 'scripts/postprocessing_upscale.py')
-rw-r--r--scripts/postprocessing_upscale.py12
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