diff --git a/invokeai/app/invocations/collections.py b/invokeai/app/invocations/collections.py index 2814a9c3ca..702eb99831 100644 --- a/invokeai/app/invocations/collections.py +++ b/invokeai/app/invocations/collections.py @@ -38,14 +38,16 @@ class RangeInvocation(BaseInvocation): version="1.0.0", ) class RangeOfSizeInvocation(BaseInvocation): - """Creates a range from start to start + size with step""" + """Creates a range from start to start + (size * step) incremented by step""" start: int = InputField(default=0, description="The start of the range") - size: int = InputField(default=1, description="The number of values") + size: int = InputField(default=1, gt=0, description="The number of values") step: int = InputField(default=1, description="The step of the range") def invoke(self, context: InvocationContext) -> IntegerCollectionOutput: - return IntegerCollectionOutput(collection=list(range(self.start, self.start + self.size, self.step))) + return IntegerCollectionOutput( + collection=list(range(self.start, self.start + (self.step * self.size), self.step)) + ) @invocation(