Skip to content

Commit cdff081

Browse files
Fix hypertile.
1 parent efb704c commit cdff081

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

comfy_extras/nodes_hypertile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ def random_divisor(value: int, min_value: int, /, max_options: int = 1) -> int:
1313

1414
ns = [value // i for i in divisors[:max_options]] # has at least 1 element
1515

16-
idx = randint(low=0, high=len(ns) - 1, size=(1,)).item()
16+
if len(ns) - 1 > 0:
17+
idx = randint(low=0, high=len(ns) - 1, size=(1,)).item()
18+
else:
19+
idx = 0
1720

1821
return ns[idx]
1922

0 commit comments

Comments
 (0)