From fb6f99e7d566b6e407b2140caecf01a1f682b920 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Fri, 22 Mar 2024 08:37:04 +0200 Subject: [PATCH] clip decoder output --- nodes_v2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodes_v2.py b/nodes_v2.py index add5b0b..6fe600c 100644 --- a/nodes_v2.py +++ b/nodes_v2.py @@ -224,8 +224,9 @@ class SUPIR_decode: if decoded_out.shape[2] != orig_H or decoded_out.shape[3] != orig_W: print("Restoring original dimensions: ", orig_W,"x",orig_H) decoded_out = F.interpolate(decoded_out, size=(orig_H, orig_W), mode="bicubic") - + decoded_out = decoded_out.cpu().to(torch.float32).permute(0, 2, 3, 1) + decoded_out = torch.clip(decoded_out, 0, 1) return (decoded_out,)