From 68b72951ad23e7bfa65178c2085bffe79dbfdaef Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 7 Mar 2024 13:33:24 -0500 Subject: [PATCH] enforce width/height div 8 early --- modules/processing.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/processing.py b/modules/processing.py index f50501f06..23d2bb5c9 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -163,6 +163,11 @@ def process_images(p: StableDiffusionProcessing) -> Processed: sd_models.apply_token_merging(p.sd_model, p.get_token_merging_ratio()) sd_hijack_freeu.apply_freeu(p, shared.backend == shared.Backend.ORIGINAL) + if p.width is not None: + p.width = 8 * int(p.width / 8) + if p.height is not None: + p.height = 8 * int(p.height / 8) + script_callbacks.before_process_callback(p) if shared.cmd_opts.profile: