22
22
#define STB_IMAGE_RESIZE_STATIC
23
23
#include " stb_image_resize.h"
24
24
25
- const char * rng_type_to_str[] = {
26
- " std_default" ,
27
- " cuda" ,
28
- };
29
-
30
- // Names of the sampler method, same order as enum sample_method in stable-diffusion.h
31
- const char * sample_method_str[] = {
32
- " euler_a" ,
33
- " euler" ,
34
- " heun" ,
35
- " dpm2" ,
36
- " dpm++2s_a" ,
37
- " dpm++2m" ,
38
- " dpm++2mv2" ,
39
- " ipndm" ,
40
- " ipndm_v" ,
41
- " lcm" ,
42
- };
43
-
44
- // Names of the sigma schedule overrides, same order as sample_schedule in stable-diffusion.h
45
- const char * schedule_str[] = {
46
- " default" ,
47
- " discrete" ,
48
- " karras" ,
49
- " exponential" ,
50
- " ays" ,
51
- " gits" ,
52
- };
53
-
54
25
const char * modes_str[] = {
55
26
" txt2img" ,
56
27
" img2img" ,
@@ -163,11 +134,11 @@ void print_params(SDParams params) {
163
134
printf (" clip_skip: %d\n " , params.clip_skip );
164
135
printf (" width: %d\n " , params.width );
165
136
printf (" height: %d\n " , params.height );
166
- printf (" sample_method: %s\n " , sample_method_str [params.sample_method ]);
167
- printf (" schedule: %s\n " , schedule_str [params.schedule ]);
137
+ printf (" sample_method: %s\n " , sample_methods_argument_str [params.sample_method ]);
138
+ printf (" schedule: %s\n " , schedulers_argument_str [params.schedule ]);
168
139
printf (" sample_steps: %d\n " , params.sample_steps );
169
140
printf (" strength(img2img): %.2f\n " , params.strength );
170
- printf (" rng: %s\n " , rng_type_to_str [params.rng_type ]);
141
+ printf (" rng: %s\n " , rng_types_argument_str [params.rng_type ]);
171
142
printf (" seed: %ld\n " , params.seed );
172
143
printf (" batch_count: %d\n " , params.batch_count );
173
144
printf (" vae_tiling: %s\n " , params.vae_tiling ? " true" : " false" );
@@ -514,7 +485,7 @@ void parse_args(int argc, const char** argv, SDParams& params) {
514
485
const char * schedule_selected = argv[i];
515
486
int schedule_found = -1 ;
516
487
for (int d = 0 ; d < N_SCHEDULES; d++) {
517
- if (!strcmp (schedule_selected, schedule_str [d])) {
488
+ if (!strcmp (schedule_selected, schedulers_argument_str [d])) {
518
489
schedule_found = d;
519
490
}
520
491
}
@@ -537,7 +508,7 @@ void parse_args(int argc, const char** argv, SDParams& params) {
537
508
const char * sample_method_selected = argv[i];
538
509
int sample_method_found = -1 ;
539
510
for (int m = 0 ; m < N_SAMPLE_METHODS; m++) {
540
- if (!strcmp (sample_method_selected, sample_method_str [m])) {
511
+ if (!strcmp (sample_method_selected, sample_methods_argument_str [m])) {
541
512
sample_method_found = m;
542
513
}
543
514
}
@@ -712,8 +683,8 @@ std::string get_image_params(SDParams params, int64_t seed) {
712
683
parameter_string += " Seed: " + std::to_string (seed) + " , " ;
713
684
parameter_string += " Size: " + std::to_string (params.width ) + " x" + std::to_string (params.height ) + " , " ;
714
685
parameter_string += " Model: " + sd_basename (params.model_path ) + " , " ;
715
- parameter_string += " RNG: " + std::string (rng_type_to_str [params.rng_type ]) + " , " ;
716
- parameter_string += " Sampler: " + std::string (sample_method_str [params.sample_method ]);
686
+ parameter_string += " RNG: " + std::string (rng_types_argument_str [params.rng_type ]) + " , " ;
687
+ parameter_string += " Sampler: " + std::string (sample_methods_argument_str [params.sample_method ]);
717
688
if (params.schedule == KARRAS) {
718
689
parameter_string += " karras" ;
719
690
}
0 commit comments