From 8c7cbf6ea3c990a84bb16b079808afeecd3f1e63 Mon Sep 17 00:00:00 2001 From: atmaranto <35581227+atmaranto@users.noreply.github.com> Date: Sun, 10 Mar 2024 05:51:38 -0500 Subject: [PATCH] Only randomize seed if it's a set value --- comfyui_to_python.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comfyui_to_python.py b/comfyui_to_python.py index d8a5c37..a0f9597 100644 --- a/comfyui_to_python.py +++ b/comfyui_to_python.py @@ -280,7 +280,8 @@ class CodeGenerator: Returns: str: Formatted argument as a string. """ - if key == 'noise_seed' or key == 'seed': + # Randomize the seed if it's a set value + if isinstance(value, int) and (key == 'noise_seed' or key == 'seed'): return f'{key}=random.randint(1, 2**64)' elif isinstance(value, str): return f'{key}={repr(value)}'