Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions invokeai/app/invocations/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class Config(InvocationConfig):

@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(
Expand Down
2 changes: 1 addition & 1 deletion invokeai/app/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion invokeai/frontend/web/src/app/constants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const NUMPY_RAND_MIN = 0;
export const NUMPY_RAND_MAX = 2147483647;
export const NUMPY_RAND_MAX = 4294967295;