From 728f58f3e7bec8b3482b09efd50c35c0dc19dab0 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sat, 2 Dec 2023 22:09:11 -0600 Subject: [PATCH] divide latents using latent scale --- api/onnx_web/diffusers/pipelines/panorama.py | 6 +++--- api/onnx_web/diffusers/pipelines/panorama_xl.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/onnx_web/diffusers/pipelines/panorama.py b/api/onnx_web/diffusers/pipelines/panorama.py index 3a410580..dbdaf622 100644 --- a/api/onnx_web/diffusers/pipelines/panorama.py +++ b/api/onnx_web/diffusers/pipelines/panorama.py @@ -563,8 +563,8 @@ class OnnxStableDiffusionPanoramaPipeline(DiffusionPipeline): # panorama additions views, resize = self.get_views(height, width, self.window, self.stride) - count = np.zeros_like((latents[0], latents[1], *resize)) - value = np.zeros_like((latents[0], latents[1], *resize)) + count = np.zeros_like((latents.shape[0], latents.shape[1], *resize)) + value = np.zeros_like((latents.shape[0], latents.shape[1], *resize)) latents = expand_latents( latents, @@ -725,7 +725,7 @@ class OnnxStableDiffusionPanoramaPipeline(DiffusionPipeline): callback(i, t, latents) # remove extra margins - latents = latents[:, :, 0:height, 0:width] + latents = latents[:, :, 0:(height // 8), 0:(width // 8)] latents = np.clip(latents, -4, +4) latents = 1 / 0.18215 * latents diff --git a/api/onnx_web/diffusers/pipelines/panorama_xl.py b/api/onnx_web/diffusers/pipelines/panorama_xl.py index b702a820..67e8e8a4 100644 --- a/api/onnx_web/diffusers/pipelines/panorama_xl.py +++ b/api/onnx_web/diffusers/pipelines/panorama_xl.py @@ -387,8 +387,8 @@ class StableDiffusionXLPanoramaPipelineMixin(StableDiffusionXLImg2ImgPipelineMix # 8. Panorama additions views, resize = self.get_views(height, width, self.window, self.stride) - count = np.zeros_like((latents[0], latents[1], *resize)) - value = np.zeros_like((latents[0], latents[1], *resize)) + count = np.zeros((latents.shape[0], latents.shape[1], *resize)) + value = np.zeros((latents.shape[0], latents.shape[1], *resize)) # adjust latents latents = expand_latents( @@ -573,7 +573,7 @@ class StableDiffusionXLPanoramaPipelineMixin(StableDiffusionXLImg2ImgPipelineMix callback(i, t, latents) # remove extra margins - latents = latents[:, :, 0:height, 0:width] + latents = latents[:, :, 0:(height // 8), 0:(width // 8)] if output_type == "latent": image = latents