Skip to content

Commit d1392d6

Browse files
committed
cli: ignore deprecated types
1 parent fdc466e commit d1392d6

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

examples/cli/main.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ void print_usage(int argc, const char* argv[]) {
196196
printf(" --normalize-input normalize PHOTOMAKER input id images\n");
197197
printf(" --upscale-model [ESRGAN_PATH] path to esrgan model. Upscale images after generate, just RealESRGAN_x4plus_anime_6B supported by now\n");
198198
printf(" --upscale-repeats Run the ESRGAN upscaler this many times (default 1)\n");
199-
printf(" --type [TYPE] weight type (f32, f16, q4_0, q4_1, q5_0, q5_1, q8_0, q2_k, q3_k, q4_k)\n");
199+
printf(" --type [TYPE] weight type (examples: f32, f16, q4_0, q4_1, q5_0, q5_1, q8_0, q2_k, q3_k, q4_k)\n");
200200
printf(" If not specified, the default is the type of the weight file\n");
201201
printf(" --lora-model-dir [DIR] lora model directory\n");
202202
printf(" -i, --init-img [IMAGE] path to the input image, required by img2img\n");
@@ -352,13 +352,15 @@ void parse_args(int argc, const char** argv, SDParams& params) {
352352
for (size_t i = 0; i < SD_TYPE_COUNT; i++) {
353353
auto trait = ggml_get_type_traits((ggml_type)i);
354354
std::string name(trait->type_name);
355-
if (i)
356-
valid_types += ", ";
357-
valid_types += name;
358-
if (type == name) {
359-
params.wtype = (enum sd_type_t)i;
360-
found = true;
361-
break;
355+
if (trait->type_size) {
356+
if (i)
357+
valid_types += ", ";
358+
valid_types += name;
359+
if (type == name) {
360+
params.wtype = (enum sd_type_t)i;
361+
found = true;
362+
break;
363+
}
362364
}
363365
}
364366
if (!found) {

0 commit comments

Comments
 (0)