Limit seed value to 64-bit signed integer max

Changed the maximum allowed seed value from 0xffffffffffffffff to 9223372036854775807 to ensure compatibility with 64-bit signed integer limits. Updated seed generation and increment logic accordingly.
This commit is contained in:
yeeyou
2025-10-28 15:36:34 +08:00
parent 05ef694cc3
commit 4cf74a2fc0
+3 -3
View File
@@ -50,7 +50,7 @@ class OpenAICompatibleLLM:
"seed": ("INT", {
"default": 42,
"min": 0,
"max": 0xffffffffffffffff,
"max": 9223372036854775807,
"step": 1
}),
"seed_control": (["random", "fixed", "increment", "decrement"], {
@@ -104,11 +104,11 @@ class OpenAICompatibleLLM:
# Handle seed control
if seed_control == "random":
import random
actual_seed = random.randint(0, 0xffffffffffffffff)
actual_seed = random.randint(0, 9223372036854775807)
elif seed_control == "fixed":
actual_seed = seed
elif seed_control == "increment":
actual_seed = self.last_seed + 1
actual_seed = min(9223372036854775807, self.last_seed + 1)
elif seed_control == "decrement":
actual_seed = max(0, self.last_seed - 1)
else: