@@ -60,6 +60,7 @@ const char* modes_str[] = {
60
60
" edit" ,
61
61
" convert" ,
62
62
};
63
+ #define SD_ALL_MODES_STR " txt2img, img2img, edit, convert"
63
64
64
65
enum SDMode {
65
66
TXT2IMG,
@@ -199,7 +200,11 @@ 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 [MODE] run mode, one of:\n " );
204
+ printf (" txt2img: generate an image from a text prompt (default)\n " );
205
+ printf (" img2img: generate an image from a text prompt and an initial image (--init-img)\n " );
206
+ printf (" edit: modify an image (--ref-image) based on text instructions\n " );
207
+ printf (" convert: convert a model file to gguf format, optionally with quantization\n " );
203
208
printf (" -t, --threads N number of threads to use during computation (default: -1)\n " );
204
209
printf (" If threads <= 0, then threads will be set to the number of CPU physical cores\n " );
205
210
printf (" -m, --model [MODEL] path to full model\n " );
@@ -291,8 +296,8 @@ void parse_args(int argc, const char** argv, SDParams& params) {
291
296
}
292
297
if (mode_found == -1 ) {
293
298
fprintf (stderr,
294
- " error: invalid mode %s, must be one of [txt2img, img2img, img2vid, convert ]\n " ,
295
- mode_selected);
299
+ " error: invalid mode %s, must be one of [%s ]\n " ,
300
+ mode_selected, SD_ALL_MODES_STR );
296
301
exit (1 );
297
302
}
298
303
params.mode = (SDMode)mode_found;
@@ -1218,4 +1223,4 @@ int main(int argc, const char* argv[]) {
1218
1223
free (input_image_buffer);
1219
1224
1220
1225
return 0 ;
1221
- }
1226
+ }
0 commit comments