From 404c66896baf69c8d6b3f053d34f2525bf46b092 Mon Sep 17 00:00:00 2001 From: spacepxl Date: Fri, 15 Mar 2024 20:26:53 -0400 Subject: [PATCH] changed intrinsic lora postprocessing: depth uses max instead of desaturate, normals use normalize instead of clamp --- nodes.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nodes.py b/nodes.py index 3cf0697..de38dba 100644 --- a/nodes.py +++ b/nodes.py @@ -3650,10 +3650,9 @@ class Intrinsic_lora_sampling: imax = image_out.max() imin = image_out.min() image_out = (image_out-imin)/(imax-imin) - image_out = 0.299 * image_out[..., 0] + 0.587 * image_out[..., 1] + 0.114 * image_out[..., 2] - image_out = image_out.unsqueeze(-1).repeat(1, 1, 1, 3) + image_out = torch.max(image_out, dim=3, keepdim=True)[0].repeat(1, 1, 1, 3) elif task == 'surface normals': - image_out = image_out.clamp(-1.,1.) + image_out = F.normalize(image_out * 2 - 1, dim=3) / 2 + 0.5 image_out = 1.0 - image_out else: image_out = image_out.clamp(-1.,1.)