11using OnnxStack . StableDiffusion . Enums ;
22using System . Collections . Generic ;
33using System . ComponentModel . DataAnnotations ;
4+ using System . Text . Json . Serialization ;
45
56namespace OnnxStack . StableDiffusion . Config
67{
@@ -36,6 +37,7 @@ public record SchedulerOptions
3637 /// If value is set to 0 a random seed is used.
3738 /// </value>
3839 [ Range ( 0 , int . MaxValue ) ]
40+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
3941 public int Seed { get ; set ; }
4042
4143 /// <summary>
@@ -45,6 +47,7 @@ public record SchedulerOptions
4547 /// The number of steps to run inference for. The more steps the longer it will take to run the inference loop but the image quality should improve.
4648 /// </value>
4749 [ Range ( 5 , 200 ) ]
50+
4851 public int InferenceSteps { get ; set ; } = 30 ;
4952
5053 /// <summary>
@@ -62,34 +65,76 @@ public record SchedulerOptions
6265 public float Strength { get ; set ; } = 0.6f ;
6366
6467 [ Range ( 0 , int . MaxValue ) ]
68+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
6569 public int TrainTimesteps { get ; set ; } = 1000 ;
70+
71+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
6672 public float BetaStart { get ; set ; } = 0.00085f ;
73+
74+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
6775 public float BetaEnd { get ; set ; } = 0.012f ;
76+
77+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
6878 public IEnumerable < float > TrainedBetas { get ; set ; }
79+
80+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
6981 public TimestepSpacingType TimestepSpacing { get ; set ; } = TimestepSpacingType . Linspace ;
82+
83+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
7084 public BetaScheduleType BetaSchedule { get ; set ; } = BetaScheduleType . ScaledLinear ;
85+
86+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
7187 public int StepsOffset { get ; set ; } = 0 ;
88+
89+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
7290 public bool UseKarrasSigmas { get ; set ; } = false ;
91+
92+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
7393 public VarianceType VarianceType { get ; set ; } = VarianceType . FixedSmall ;
94+
95+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
7496 public float SampleMaxValue { get ; set ; } = 1.0f ;
97+
98+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
7599 public bool Thresholding { get ; set ; } = false ;
100+
101+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
76102 public bool ClipSample { get ; set ; } = false ;
103+
104+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
77105 public float ClipSampleRange { get ; set ; } = 1f ;
106+
107+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
78108 public PredictionType PredictionType { get ; set ; } = PredictionType . Epsilon ;
109+
110+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
79111 public AlphaTransformType AlphaTransformType { get ; set ; } = AlphaTransformType . Cosine ;
112+
113+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
80114 public float MaximumBeta { get ; set ; } = 0.999f ;
115+
116+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
81117 public List < int > Timesteps { get ; set ; }
82118
119+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
83120 public int OriginalInferenceSteps { get ; set ; } = 50 ;
84121
122+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
85123 public float AestheticScore { get ; set ; } = 6f ;
124+
125+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
86126 public float AestheticNegativeScore { get ; set ; } = 2.5f ;
87127
128+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
88129 public float ConditioningScale { get ; set ; } = 0.7f ;
89130
131+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
90132 public int InferenceSteps2 { get ; set ; } = 10 ;
133+
134+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
91135 public float GuidanceScale2 { get ; set ; } = 0 ;
92136
137+ [ JsonIgnore ]
93138 public bool IsKarrasScheduler
94139 {
95140 get
0 commit comments