calculate vae-scale-factor and use everywhere

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-08-09 11:31:13 -04:00
parent 2efadd2630
commit 338129b7c1
9 changed files with 68 additions and 35 deletions
+3 -2
View File
@@ -158,11 +158,12 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
shared.prompt_styles.apply_styles_to_extra(p)
shared.prompt_styles.extract_comments(p)
vae_scale_factor = sd_vae.get_vae_scale_factor()
if p.width is not None:
p.width = 8 * int(p.width / 8)
p.width = vae_scale_factor * int(p.width / vae_scale_factor)
if p.height is not None:
p.height = 8 * int(p.height / 8)
p.height = vae_scale_factor * int(p.height / vae_scale_factor)
script_callbacks.before_process_callback(p)
timer.process.record('pre')