Skip to content

Commit 8c7cbf6

Browse files
committed
Only randomize seed if it's a set value
1 parent 507e096 commit 8c7cbf6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

comfyui_to_python.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,8 @@ def format_arg(self, key: str, value: any) -> str:
280280
Returns:
281281
str: Formatted argument as a string.
282282
"""
283-
if key == 'noise_seed' or key == 'seed':
283+
# Randomize the seed if it's a set value
284+
if isinstance(value, int) and (key == 'noise_seed' or key == 'seed'):
284285
return f'{key}=random.randint(1, 2**64)'
285286
elif isinstance(value, str):
286287
return f'{key}={repr(value)}'

0 commit comments

Comments
 (0)