@@ -60,6 +60,7 @@ const char* modes_str[] = {
60
60
" edit" ,
61
61
" convert" ,
62
62
};
63
+ #define SD_ALL_MODES_STR " txt2img, img2img, img2vid, edit, convert"
63
64
64
65
enum SDMode {
65
66
TXT2IMG,
@@ -199,7 +200,8 @@ void print_usage(int argc, const char* argv[]) {
199
200
printf (" \n " );
200
201
printf (" arguments:\n " );
201
202
printf (" -h, --help show this help message and exit\n " );
202
- printf (" -M, --mode [MODEL] run mode (txt2img or img2img or convert, default: txt2img)\n " );
203
+ printf (" -M, --mode {%s}\n " , SD_ALL_MODES_STR);
204
+ printf (" run mode (default: txt2img)\n " );
203
205
printf (" -t, --threads N number of threads to use during computation (default: -1)\n " );
204
206
printf (" If threads <= 0, then threads will be set to the number of CPU physical cores\n " );
205
207
printf (" -m, --model [MODEL] path to full model\n " );
@@ -291,8 +293,8 @@ void parse_args(int argc, const char** argv, SDParams& params) {
291
293
}
292
294
if (mode_found == -1 ) {
293
295
fprintf (stderr,
294
- " error: invalid mode %s, must be one of [txt2img, img2img, img2vid, convert ]\n " ,
295
- mode_selected);
296
+ " error: invalid mode %s, must be one of [%s ]\n " ,
297
+ mode_selected, SD_ALL_MODES_STR );
296
298
exit (1 );
297
299
}
298
300
params.mode = (SDMode)mode_found;
0 commit comments