Update nodes.py

This commit is contained in:
kijai
2024-05-12 11:16:25 +03:00
parent 3083ddd6b9
commit 104e5fbe55
+5 -5
View File
@@ -239,14 +239,14 @@ left, right, bottom, top
ambient = (left + right + bottom + top) / 4.0
h, w, _ = ambient.shape
def safa_divide(a, b):
def safe_divide(a, b):
e = 1e-5
return ((a + e) / (b + e)) - 1.0
left = safa_divide(left, ambient)
right = safa_divide(right, ambient)
bottom = safa_divide(bottom, ambient)
top = safa_divide(top, ambient)
left = safe_divide(left, ambient)
right = safe_divide(right, ambient)
bottom = safe_divide(bottom, ambient)
top = safe_divide(top, ambient)
u = (right - left) * 0.5
v = (top - bottom) * 0.5