Skip to content

Commit

Permalink
Fix step automation increment
Browse files Browse the repository at this point in the history
  • Loading branch information
saddam213 committed Nov 16, 2023
1 parent 9417b17 commit eb09a0a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions OnnxStack.StableDiffusion/Helpers/BatchGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ public static List<SchedulerOptions> GenerateBatch(IModelOptions modelOptions, B
}
else if (batchOptions.BatchType == BatchOptionType.Step)
{
return Enumerable.Range(Math.Max(0, (int)batchOptions.ValueFrom), Math.Max(1, (int)batchOptions.ValueTo))
.Select(x => schedulerOptions with { InferenceSteps = x })
var totalIncrements = (int)Math.Max(1, (batchOptions.ValueTo - batchOptions.ValueFrom) / batchOptions.Increment);
return Enumerable.Range(0, totalIncrements)
.Select(x => schedulerOptions with { InferenceSteps = (int)(batchOptions.ValueFrom + (batchOptions.Increment * x)) })
.ToList();
}
else if (batchOptions.BatchType == BatchOptionType.Guidance)
Expand Down

0 comments on commit eb09a0a

Please sign in to comment.