Skip to content

Commit

Permalink
Fix 1 step inference issue using Trailing
Browse files Browse the repository at this point in the history
  • Loading branch information
saddam213 committed Apr 23, 2024
1 parent 2122641 commit 6fc6b61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OnnxStack.StableDiffusion/Schedulers/SchedulerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected virtual float[] GetTimesteps()
}
else if (Options.TimestepSpacing == TimestepSpacingType.Trailing)
{
var stepRatio = Options.TrainTimesteps / (Options.InferenceSteps - 1);
var stepRatio = Options.TrainTimesteps / Math.Max(1, (Options.InferenceSteps - 1));
return Enumerable.Range(0, Options.TrainTimesteps)
.Where((number, index) => index % stepRatio == 0)
.Select(x => (float)x)
Expand Down

0 comments on commit 6fc6b61

Please sign in to comment.