1
1
using OnnxStack . StableDiffusion . Enums ;
2
2
using System . Collections . Generic ;
3
+ using System . ComponentModel . DataAnnotations ;
3
4
4
5
namespace OnnxStack . StableDiffusion . Config
5
6
{
@@ -11,6 +12,7 @@ public class SchedulerOptions
11
12
/// <value>
12
13
/// The height of the image. Default is 512 and must be divisible by 64.
13
14
/// </value>
15
+ [ Range ( 0 , 4096 ) ]
14
16
public int Height { get ; set ; } = 512 ;
15
17
16
18
/// <summary>
@@ -19,6 +21,7 @@ public class SchedulerOptions
19
21
/// <value>
20
22
/// The width of the image. Default is 512 and must be divisible by 64.
21
23
/// </value>
24
+ [ Range ( 0 , 4096 ) ]
22
25
public int Width { get ; set ; } = 512 ;
23
26
24
27
/// <summary>
@@ -27,6 +30,7 @@ public class SchedulerOptions
27
30
/// <value>
28
31
/// If value is set to 0 a random seed is used.
29
32
/// </value>
33
+ [ Range ( 0 , int . MaxValue ) ]
30
34
public int Seed { get ; set ; }
31
35
32
36
/// <summary>
@@ -35,6 +39,7 @@ public class SchedulerOptions
35
39
/// <value>
36
40
/// 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.
37
41
/// </value>
42
+ [ Range ( 5 , 200 ) ]
38
43
public int InferenceSteps { get ; set ; } = 15 ;
39
44
40
45
/// <summary>
@@ -43,18 +48,21 @@ public class SchedulerOptions
43
48
/// <value>
44
49
/// 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.
45
50
/// </value>
51
+ [ Range ( 0f , 40f ) ]
46
52
public float GuidanceScale { get ; set ; } = 7.5f ;
47
53
48
54
/// <summary>
49
55
/// Gets or sets the strength use for Image 2 Image
50
- /// </summary>
56
+ [ Range ( 0f , 1f ) ]
51
57
public float Strength { get ; set ; } = 0.6f ;
52
58
53
59
/// <summary>
54
60
/// Gets or sets the initial noise level for Image 2 Image
55
61
/// </summary>
62
+ [ Range ( - 1f , 1f ) ]
56
63
public float InitialNoiseLevel { get ; set ; } = 0f ;
57
64
65
+ [ Range ( 0 , int . MaxValue ) ]
58
66
public int TrainTimesteps { get ; set ; } = 1000 ;
59
67
public float BetaStart { get ; set ; } = 0.00085f ;
60
68
public float BetaEnd { get ; set ; } = 0.012f ;
0 commit comments