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

Commit ce10893

Browse files
committed
Remove pipeline restriction from Schedulers
1 parent db3e26b commit ce10893

File tree

4 files changed

+6
-29
lines changed

4 files changed

+6
-29
lines changed

OnnxStack.StableDiffusion/Common/IScheduler.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Microsoft.ML.OnnxRuntime.Tensors;
2-
using OnnxStack.StableDiffusion.Enums;
32
using OnnxStack.StableDiffusion.Schedulers;
43
using System;
54
using System.Collections.Generic;
@@ -8,11 +7,6 @@ namespace OnnxStack.StableDiffusion.Common
87
{
98
public interface IScheduler : IDisposable
109
{
11-
/// <summary>
12-
/// Gets the compatible pipeline
13-
/// </summary>
14-
DiffuserPipelineType PipelineType { get; }
15-
1610
/// <summary>
1711
/// Gets the initial noise sigma.
1812
/// </summary>

OnnxStack.StableDiffusion/Extensions.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
using Microsoft.ML.OnnxRuntime;
2-
using NumSharp;
32
using OnnxStack.StableDiffusion.Config;
43
using OnnxStack.StableDiffusion.Enums;
54

65
using System;
76
using System.Linq;
8-
using System.Numerics;
9-
using System.Threading.Tasks;
107

118
namespace OnnxStack.StableDiffusion
129
{
@@ -102,20 +99,19 @@ public static SchedulerType[] GetSchedulerTypes(this DiffuserPipelineType pipeli
10299
{
103100
return pipelineType switch
104101
{
105-
DiffuserPipelineType.StableDiffusion => new[]
102+
DiffuserPipelineType.LatentConsistency => new[]
103+
{
104+
SchedulerType.LCM
105+
},
106+
_ => new[]
106107
{
107108
SchedulerType.LMS,
108109
SchedulerType.Euler,
109110
SchedulerType.EulerAncestral,
110111
SchedulerType.DDPM,
111112
SchedulerType.DDIM,
112113
SchedulerType.KDPM2
113-
},
114-
DiffuserPipelineType.LatentConsistency => new[]
115-
{
116-
SchedulerType.LCM
117-
},
118-
_ => default
114+
}
119115
};
120116
}
121117

OnnxStack.StableDiffusion/Schedulers/LatentConsistency/LCMScheduler.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
using Microsoft.ML.OnnxRuntime.Tensors;
2-
using NumSharp;
32
using OnnxStack.Core;
43
using OnnxStack.StableDiffusion.Config;
54
using OnnxStack.StableDiffusion.Enums;
65
using OnnxStack.StableDiffusion.Helpers;
76
using System;
87
using System.Collections.Generic;
98
using System.Linq;
10-
using System.Net;
119

1210
namespace OnnxStack.StableDiffusion.Schedulers.LatentConsistency
1311
{
@@ -30,12 +28,6 @@ public LCMScheduler() : this(new SchedulerOptions()) { }
3028
public LCMScheduler(SchedulerOptions options) : base(options) { }
3129

3230

33-
/// <summary>
34-
/// Gets the compatible pipeline.
35-
/// </summary>
36-
public override DiffuserPipelineType PipelineType => DiffuserPipelineType.LatentConsistency;
37-
38-
3931
/// <summary>
4032
/// Initializes this instance.
4133
/// </summary>

OnnxStack.StableDiffusion/Schedulers/SchedulerBase.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ public SchedulerBase(SchedulerOptions schedulerOptions)
5050
/// </summary>
5151
public IReadOnlyList<int> Timesteps => _timesteps;
5252

53-
/// <summary>
54-
/// Gets the compatible pipeline.
55-
/// </summary>
56-
public virtual DiffuserPipelineType PipelineType => DiffuserPipelineType.StableDiffusion;
57-
5853
/// <summary>
5954
/// Scales the input.
6055
/// </summary>

0 commit comments

Comments
 (0)