fix(nodes): fix seed modulus operation

This was incorect and resulted in the max seed being one less than intended.
This commit is contained in:
psychedelicious 2023-07-24 16:44:32 +10:00
parent d5a75eb833
commit 66cdeba8a1

View File

@ -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(