diff --git a/invokeai/app/invocations/noise.py b/invokeai/app/invocations/noise.py index 442557520a..fff0f29f14 100644 --- a/invokeai/app/invocations/noise.py +++ b/invokeai/app/invocations/noise.py @@ -119,8 +119,8 @@ class NoiseInvocation(BaseInvocation): @validator("seed", pre=True) def modulo_seed(cls, v): - """Returns the seed modulo SEED_MAX to ensure it is within the valid range.""" - return v % SEED_MAX + """Returns the seed modulo (SEED_MAX + 1) to ensure it is within the valid range.""" + return v % (SEED_MAX + 1) def invoke(self, context: InvocationContext) -> NoiseOutput: noise = get_noise( diff --git a/invokeai/app/util/misc.py b/invokeai/app/util/misc.py index 7c674674e2..be5b698258 100644 --- a/invokeai/app/util/misc.py +++ b/invokeai/app/util/misc.py @@ -14,7 +14,7 @@ def get_datetime_from_iso_timestamp(iso_timestamp: str) -> datetime.datetime: return datetime.datetime.fromisoformat(iso_timestamp) -SEED_MAX = np.iinfo(np.int32).max +SEED_MAX = np.iinfo(np.uint32).max def get_random_seed(): diff --git a/invokeai/frontend/web/src/app/constants.ts b/invokeai/frontend/web/src/app/constants.ts index 1194ea467b..b8fab16c1c 100644 --- a/invokeai/frontend/web/src/app/constants.ts +++ b/invokeai/frontend/web/src/app/constants.ts @@ -1,2 +1,2 @@ export const NUMPY_RAND_MIN = 0; -export const NUMPY_RAND_MAX = 2147483647; +export const NUMPY_RAND_MAX = 4294967295;