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

Commit 8a3bb0d

Browse files
committed
Add advanced scheduler settings
1 parent 58df719 commit 8a3bb0d

File tree

3 files changed

+236
-69
lines changed

3 files changed

+236
-69
lines changed

OnnxStack.WebUI/Hubs/StableDiffusionHub.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,28 @@ private async Task<TextToImageResult> GenerateTextToImageResult(TextToImageOptio
9595

9696
var schedulerOptions = new SchedulerOptions
9797
{
98+
Seed = options.Seed,
9899
Width = options.Width,
99100
Height = options.Height,
100-
Seed = options.Seed,
101101
InferenceSteps = options.InferenceSteps,
102102
GuidanceScale = options.GuidanceScale,
103-
Strength = options.Strength,
104-
InitialNoiseLevel = options.InitialNoiseLevel
103+
AlphaTransformType = options.AlphaTransformType,
104+
BetaEnd = options.BetaEnd,
105+
BetaSchedule = options.BetaSchedule,
106+
BetaStart = options.BetaStart,
107+
ClipSample = options.ClipSample,
108+
ClipSampleRange = options.ClipSampleRange,
109+
MaximumBeta = options.MaximumBeta,
110+
PredictionType = options.PredictionType,
111+
StepsOffset = options.StepsOffset,
112+
TimestepSpacing = options.TimestepSpacing,
113+
Thresholding = options.Thresholding,
114+
TrainTimesteps = options.TrainTimesteps,
115+
UseKarrasSigmas = options.UseKarrasSigmas,
116+
VarianceType = options.VarianceType
105117
};
106118

107-
119+
108120
var fileInfo = CreateFileInfo(promptOptions, schedulerOptions);
109121
if (!await SaveOptionsFile(fileInfo, options))
110122
return null;

OnnxStack.WebUI/Models/TextToImageOptions.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,20 @@ public class TextToImageOptions
2828
[Range(0f, 40f)]
2929
public float GuidanceScale { get; set; } = 7.5f;
3030

31-
[Range(0f, 1f)]
32-
public float Strength { get; set; } = 0.6f;
3331

34-
[Range(-1f, 1f)]
35-
public float InitialNoiseLevel { get; set; } = 0f;
32+
public TimestepSpacingType TimestepSpacing { get; set; } = TimestepSpacingType.Linspace;
33+
public VarianceType VarianceType { get; set; } = VarianceType.FixedSmall;
34+
public PredictionType PredictionType { get; set; } = PredictionType.Epsilon;
35+
public AlphaTransformType AlphaTransformType { get; set; } = AlphaTransformType.Cosine;
36+
public BetaScheduleType BetaSchedule { get; set; } = BetaScheduleType.ScaledLinear;
37+
public float BetaStart { get; set; } = 0.00085f;
38+
public float BetaEnd { get; set; } = 0.012f;
39+
public float MaximumBeta { get; set; } = 0.999f;
40+
public int TrainTimesteps { get; set; } = 1000;
41+
public int StepsOffset { get; set; } = 0;
42+
public bool UseKarrasSigmas { get; set; } = false;
43+
public bool Thresholding { get; set; } = false;
44+
public bool ClipSample { get; set; } = false;
45+
public float ClipSampleRange { get; set; } = 1f;
3646
}
3747
}

0 commit comments

Comments
 (0)