From b3fb40adb864eaea57a00df5feabbcd915bc0872 Mon Sep 17 00:00:00 2001 From: drhead <1313496+drhead@users.noreply.github.com> Date: Sun, 25 May 2025 11:19:49 -0400 Subject: [PATCH] clamp needed to change to match --- latent_preview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latent_preview.py b/latent_preview.py index e59da1165..0bec54d33 100644 --- a/latent_preview.py +++ b/latent_preview.py @@ -22,9 +22,9 @@ def preview_to_image(preview_image: torch.Tensor): # but we don't care about it blocking because the main stream is fine preview_image = preview_image.cpu() + preview_image.clamp_(-1.0, 1.0) preview_image.add_(1.0) preview_image.mul_(127.5) - preview_image.clamp_(0, 1) # change scale from -1..1 to 0..1 and clamp preview_image.round_() # default behavior when casting is truncate which is wrong for image processing return Image.fromarray(preview_image.to(dtype=torch.uint8).numpy())