@@ -88,28 +88,27 @@ const char* sample_method_str[] = {
8888const char * schedule_str[] = {
8989 " default" ,
9090 " discrete" ,
91- " karras"
92- };
91+ " karras" };
9392
9493struct Option {
95- int n_threads = -1 ;
94+ int n_threads = -1 ;
9695 std::string mode = TXT2IMG;
9796 std::string model_path;
9897 std::string lora_model_dir;
9998 std::string output_path = " output.png" ;
10099 std::string init_img;
101100 std::string prompt;
102101 std::string negative_prompt;
103- float cfg_scale = 7 .0f ;
104- int w = 512 ;
105- int h = 512 ;
102+ float cfg_scale = 7 .0f ;
103+ int w = 512 ;
104+ int h = 512 ;
106105 SampleMethod sample_method = EULER_A;
107- Schedule schedule = DEFAULT;
108- int sample_steps = 20 ;
109- float strength = 0 .75f ;
110- RNGType rng_type = CUDA_RNG;
111- int64_t seed = 42 ;
112- bool verbose = false ;
106+ Schedule schedule = DEFAULT;
107+ int sample_steps = 20 ;
108+ float strength = 0 .75f ;
109+ RNGType rng_type = CUDA_RNG;
110+ int64_t seed = 42 ;
111+ bool verbose = false ;
113112
114113 void print () {
115114 printf (" Option: \n " );
@@ -129,7 +128,7 @@ struct Option {
129128 printf (" sample_steps: %d\n " , sample_steps);
130129 printf (" strength: %.2f\n " , strength);
131130 printf (" rng: %s\n " , rng_type_to_str[rng_type]);
132- printf (" seed: %lld \n " , seed);
131+ printf (" seed: %ld \n " , seed);
133132 }
134133};
135134
@@ -266,7 +265,7 @@ void parse_args(int argc, const char* argv[], Option* opt) {
266265 break ;
267266 }
268267 const char * schedule_selected = argv[i];
269- int schedule_found = -1 ;
268+ int schedule_found = -1 ;
270269 for (int d = 0 ; d < N_SCHEDULES; d++) {
271270 if (!strcmp (schedule_selected, schedule_str[d])) {
272271 schedule_found = d;
@@ -289,7 +288,7 @@ void parse_args(int argc, const char* argv[], Option* opt) {
289288 break ;
290289 }
291290 const char * sample_method_selected = argv[i];
292- int sample_method_found = -1 ;
291+ int sample_method_found = -1 ;
293292 for (int m = 0 ; m < N_SAMPLE_METHODS; m++) {
294293 if (!strcmp (sample_method_selected, sample_method_str[m])) {
295294 sample_method_found = m;
@@ -405,6 +404,7 @@ int main(int argc, const char* argv[]) {
405404 vae_decode_only = false ;
406405
407406 int c = 0 ;
407+
408408 unsigned char * img_data = stbi_load (opt.init_img .c_str (), &opt.w , &opt.h , &c, 3 );
409409 if (img_data == NULL ) {
410410 fprintf (stderr, " load image from '%s' failed\n " , opt.init_img .c_str ());
0 commit comments