1
0
Fork 0

divide latents using latent scale

This commit is contained in:
Sean Sube 2023-12-02 22:09:11 -06:00
parent d4611e958c
commit 728f58f3e7
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 6 additions and 6 deletions

View File

@ -563,8 +563,8 @@ class OnnxStableDiffusionPanoramaPipeline(DiffusionPipeline):
# panorama additions # panorama additions
views, resize = self.get_views(height, width, self.window, self.stride) views, resize = self.get_views(height, width, self.window, self.stride)
count = np.zeros_like((latents[0], latents[1], *resize)) count = np.zeros_like((latents.shape[0], latents.shape[1], *resize))
value = np.zeros_like((latents[0], latents[1], *resize)) value = np.zeros_like((latents.shape[0], latents.shape[1], *resize))
latents = expand_latents( latents = expand_latents(
latents, latents,
@ -725,7 +725,7 @@ class OnnxStableDiffusionPanoramaPipeline(DiffusionPipeline):
callback(i, t, latents) callback(i, t, latents)
# remove extra margins # remove extra margins
latents = latents[:, :, 0:height, 0:width] latents = latents[:, :, 0:(height // 8), 0:(width // 8)]
latents = np.clip(latents, -4, +4) latents = np.clip(latents, -4, +4)
latents = 1 / 0.18215 * latents latents = 1 / 0.18215 * latents

View File

@ -387,8 +387,8 @@ class StableDiffusionXLPanoramaPipelineMixin(StableDiffusionXLImg2ImgPipelineMix
# 8. Panorama additions # 8. Panorama additions
views, resize = self.get_views(height, width, self.window, self.stride) views, resize = self.get_views(height, width, self.window, self.stride)
count = np.zeros_like((latents[0], latents[1], *resize)) count = np.zeros((latents.shape[0], latents.shape[1], *resize))
value = np.zeros_like((latents[0], latents[1], *resize)) value = np.zeros((latents.shape[0], latents.shape[1], *resize))
# adjust latents # adjust latents
latents = expand_latents( latents = expand_latents(
@ -573,7 +573,7 @@ class StableDiffusionXLPanoramaPipelineMixin(StableDiffusionXLImg2ImgPipelineMix
callback(i, t, latents) callback(i, t, latents)
# remove extra margins # remove extra margins
latents = latents[:, :, 0:height, 0:width] latents = latents[:, :, 0:(height // 8), 0:(width // 8)]
if output_type == "latent": if output_type == "latent":
image = latents image = latents