divide latents using latent scale
This commit is contained in:
parent
d4611e958c
commit
728f58f3e7
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue