Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit eb09a0a

Browse files
committed
Fix step automation increment
1 parent 9417b17 commit eb09a0a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

OnnxStack.StableDiffusion/Helpers/BatchGenerator.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ public static List<SchedulerOptions> GenerateBatch(IModelOptions modelOptions, B
2626
}
2727
else if (batchOptions.BatchType == BatchOptionType.Step)
2828
{
29-
return Enumerable.Range(Math.Max(0, (int)batchOptions.ValueFrom), Math.Max(1, (int)batchOptions.ValueTo))
30-
.Select(x => schedulerOptions with { InferenceSteps = x })
29+
var totalIncrements = (int)Math.Max(1, (batchOptions.ValueTo - batchOptions.ValueFrom) / batchOptions.Increment);
30+
return Enumerable.Range(0, totalIncrements)
31+
.Select(x => schedulerOptions with { InferenceSteps = (int)(batchOptions.ValueFrom + (batchOptions.Increment * x)) })
3132
.ToList();
3233
}
3334
else if (batchOptions.BatchType == BatchOptionType.Guidance)

0 commit comments

Comments
 (0)