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

Commit 6fc6b61

Browse files
committed
Fix 1 step inference issue using Trailing
1 parent 2122641 commit 6fc6b61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

OnnxStack.StableDiffusion/Schedulers/SchedulerBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ protected virtual float[] GetTimesteps()
174174
}
175175
else if (Options.TimestepSpacing == TimestepSpacingType.Trailing)
176176
{
177-
var stepRatio = Options.TrainTimesteps / (Options.InferenceSteps - 1);
177+
var stepRatio = Options.TrainTimesteps / Math.Max(1, (Options.InferenceSteps - 1));
178178
return Enumerable.Range(0, Options.TrainTimesteps)
179179
.Where((number, index) => index % stepRatio == 0)
180180
.Select(x => (float)x)

0 commit comments

Comments
 (0)