Update nodes.py

This commit is contained in:
kijai
2024-05-12 16:19:00 +03:00
parent c69909fb37
commit aad3ec9ed4
+1 -2
View File
@@ -271,12 +271,11 @@ left, right, bottom, top
#normal = F.normalize(normal * 2 - 1, dim=3) / 2 + 0.5 #normal = F.normalize(normal * 2 - 1, dim=3) / 2 + 0.5
normal = (normal - normal.min()) / ((normal.max() - normal.min())) normal = (normal - normal.min()) / ((normal.max() - normal.min()))
normal = torch.clamp(normal, 0, 1)
divided = np.stack([left, right, bottom, top]) divided = np.stack([left, right, bottom, top])
divided = torch.from_numpy(divided) divided = torch.from_numpy(divided)
divided = (divided - divided.min()) / ((divided.max() - divided.min())) divided = (divided - divided.min()) / ((divided.max() - divided.min()))
divided = torch.clamp(divided, 0, 1) divided = torch.max(divided, dim=3, keepdim=True)[0].repeat(1, 1, 1, 3)
return (normal, divided, ) return (normal, divided, )