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,)