11using OnnxStack . StableDiffusion . Enums ;
22using System . Collections . Generic ;
3+ using System . ComponentModel . DataAnnotations ;
34
45namespace OnnxStack . StableDiffusion . Config
56{
@@ -11,6 +12,7 @@ public class SchedulerOptions
1112 /// <value>
1213 /// The height of the image. Default is 512 and must be divisible by 64.
1314 /// </value>
15+ [ Range ( 0 , 4096 ) ]
1416 public int Height { get ; set ; } = 512 ;
1517
1618 /// <summary>
@@ -19,6 +21,7 @@ public class SchedulerOptions
1921 /// <value>
2022 /// The width of the image. Default is 512 and must be divisible by 64.
2123 /// </value>
24+ [ Range ( 0 , 4096 ) ]
2225 public int Width { get ; set ; } = 512 ;
2326
2427 /// <summary>
@@ -27,6 +30,7 @@ public class SchedulerOptions
2730 /// <value>
2831 /// If value is set to 0 a random seed is used.
2932 /// </value>
33+ [ Range ( 0 , int . MaxValue ) ]
3034 public int Seed { get ; set ; }
3135
3236 /// <summary>
@@ -35,6 +39,7 @@ public class SchedulerOptions
3539 /// <value>
3640 /// 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.
3741 /// </value>
42+ [ Range ( 5 , 200 ) ]
3843 public int InferenceSteps { get ; set ; } = 15 ;
3944
4045 /// <summary>
@@ -43,18 +48,21 @@ public class SchedulerOptions
4348 /// <value>
4449 /// The scale for the classifier-free guidance. The higher the number the more it will try to look like the prompt but the image quality may suffer.
4550 /// </value>
51+ [ Range ( 0f , 40f ) ]
4652 public float GuidanceScale { get ; set ; } = 7.5f ;
4753
4854 /// <summary>
4955 /// Gets or sets the strength use for Image 2 Image
50- /// </summary>
56+ [ Range ( 0f , 1f ) ]
5157 public float Strength { get ; set ; } = 0.6f ;
5258
5359 /// <summary>
5460 /// Gets or sets the initial noise level for Image 2 Image
5561 /// </summary>
62+ [ Range ( - 1f , 1f ) ]
5663 public float InitialNoiseLevel { get ; set ; } = 0f ;
5764
65+ [ Range ( 0 , int . MaxValue ) ]
5866 public int TrainTimesteps { get ; set ; } = 1000 ;
5967 public float BetaStart { get ; set ; } = 0.00085f ;
6068 public float BetaEnd { get ; set ; } = 0.012f ;
0 commit comments