{"record":{"id":"47a1539149070b43","repo":"mudler/LocalAI","slug":"invalid-wtype-s-using-default-n","errorCode":null,"errorMessage":"Invalid wtype: %s, using default\\n","messagePattern":"Invalid wtype: (.+?), using default\\\\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"backend/go/stablediffusion-ggml/cpp/gosd.cpp","lineNumber":577,"sourceCode":"                fprintf(stderr, \"Invalid prediction: %s, using default\\n\", optval);\n            }\n        }\n        if (!strcmp(optname, \"lora_apply_mode\")) {\n            lora_apply_mode_t parsed = str_to_lora_apply_mode(optval);\n            if (parsed != LORA_APPLY_MODE_COUNT) {\n                lora_apply_mode = parsed;\n                fprintf(stderr, \"Found lora_apply_mode: %s\\n\", optval);\n            } else {\n                fprintf(stderr, \"Invalid lora_apply_mode: %s, using default\\n\", optval);\n            }\n        }\n        if (!strcmp(optname, \"wtype\")) {\n            sd_type_t parsed = str_to_sd_type(optval);\n            if (parsed != SD_TYPE_COUNT) {\n                wtype = parsed;\n                fprintf(stderr, \"Found wtype: %s\\n\", optval);\n            } else {\n                fprintf(stderr, \"Invalid wtype: %s, using default\\n\", optval);\n            }\n        }\n    }\n\n    fprintf(stderr, \"parsed options\\n\");\n\n    // Build embeddings vector from directory if provided\n    build_embedding_vec(embedding_dir);\n\n    fprintf (stderr, \"Creating context\\n\");\n    sd_ctx_params_init(&ctx_params);\n    ctx_params.model_path = model;\n    ctx_params.clip_l_path = clip_l_path;\n    ctx_params.clip_g_path = clip_g_path;\n    ctx_params.clip_vision_path = clip_vision_path;\n    ctx_params.t5xxl_path = t5xxl_path;\n    ctx_params.llm_path = llm_path;\n    ctx_params.llm_vision_path = llm_vision_path;","sourceCodeStart":559,"sourceCodeEnd":595,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/stablediffusion-ggml/cpp/gosd.cpp#L559-L595","documentation":"Warning from the option parser: 'wtype=<value>' (weight quantization type, e.g. f16/q8_0/q4_0) is not recognized by str_to_sd_type(), so the model's own default weight type is used (ctx_params.wtype is only assigned when the parse succeeded). Load proceeds; the model may use a different precision than intended, affecting VRAM and quality.","triggerScenarios":"Passing a wtype string not supported by the vendored stable-diffusion.cpp (unsupported quant name, typo, wrong case).","commonSituations":"Trying to shrink a large model with a quant name that this build does not implement; copying ggml quant names from llama.cpp that sd.cpp spells differently.","solutions":["Use an exact sd_type name from the vendored str_to_sd_type (e.g. f16, q8_0, q4_0)","Omit wtype to accept the model default precision","Watch for the 'Found wtype:' confirmation line to verify it took effect"],"exampleFix":"# before\noptions: \"...,wtype=Q8\"  # not a valid sd type string\n\n# after\noptions: \"...,wtype=q8_0\"","handlingStrategy":"validation","validationCode":"// Go caller: whitelist weight types\nvalidWtype := map[string]bool{\"f32\": true, \"f16\": true, \"q8_0\": true, \"q4_0\": true} // match vendored names\nif o, ok := opts.Raw[\"wtype\"]; ok && !validWtype[o] {\n    return fmt.Errorf(\"invalid wtype %q\", o)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use sd.cpp weight-type spellings, not llama.cpp quant abbreviations","Verify quantization actually applied by checking the 'Found wtype:' line and memory usage"],"tags":["stablediffusion","options","quantization","config"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}