{"record":{"id":"c8924c6bb422dfc5","repo":"mudler/LocalAI","slug":"invalid-lora-multiplier-s-skipping-n","errorCode":null,"errorMessage":"Invalid LoRA multiplier '%s', skipping\\n","messagePattern":"Invalid LoRA multiplier '(.+?)', skipping\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"backend/go/stablediffusion-ggml/cpp/gosd.cpp","lineNumber":208,"sourceCode":"    static const std::regex re(R\"(<lora:([^:>]+):([^>]+)>)\");\n    static const std::vector<std::string> valid_ext = {\".pt\", \".safetensors\", \".gguf\"};\n    std::smatch m;\n\n    std::string tmp = prompt;\n\n    fprintf(stderr, \"Parsing LoRAs from prompt: %s\\n\", prompt.c_str());\n\n    while (std::regex_search(tmp, m, re)) {\n        std::string raw_path = m[1].str();\n        const std::string raw_mul = m[2].str();\n\n        float mul = 0.f;\n        try {\n            mul = std::stof(raw_mul);\n        } catch (...) {\n            tmp = m.suffix().str();\n            cleaned_prompt = std::regex_replace(cleaned_prompt, re, \"\", std::regex_constants::format_first_only);\n            fprintf(stderr, \"Invalid LoRA multiplier '%s', skipping\\n\", raw_mul.c_str());\n            continue;\n        }\n\n        bool is_high_noise = false;\n        static const std::string prefix = \"|high_noise|\";\n        if (raw_path.rfind(prefix, 0) == 0) {\n            raw_path.erase(0, prefix.size());\n            is_high_noise = true;\n        }\n\n        std::filesystem::path final_path;\n        if (is_absolute_path(raw_path)) {\n            final_path = raw_path;\n        } else {\n            // Try name-based lookup first\n            auto it = discovered_lora_map.find(raw_path);\n            if (it != discovered_lora_map.end()) {\n                final_path = it->second;","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/stablediffusion-ggml/cpp/gosd.cpp#L190-L226","documentation":"Warning from the LoRA prompt parser: a <lora:name:multiplier> tag has a multiplier that std::stof cannot parse (non-numeric like 'strong' or '1,0'). The tag is removed from the prompt and skipped; all other tags continue to be processed. Note std::stof accepts partial prefixes, so '1.0abc' parses as 1.0 while 'abc' fails.","triggerScenarios":"Prompts containing tags like <lora:style:high> or <lora:style:> variants where the second capture group is not a valid float start; locale issues where the comma is the decimal separator can also produce '1,0' which fails.","commonSituations":"Hand-edited or LLM-generated prompts with malformed multipliers; locales that write decimals with commas; copy-paste from web UIs that use different tag syntax.","solutions":["Use a plain decimal multiplier in the tag, e.g. <lora:style:0.8>","Check for comma decimal separators and replace with a dot","Scan the prompt programmatically for <lora:...> tags and validate the multiplier before submitting"],"exampleFix":"// before\n\"a cat <lora:pixar:strong>\" // multiplier skipped\n\n// after\n\"a cat <lora:pixar:0.8>\"","handlingStrategy":"validation","validationCode":"// Go caller: validate multipliers before submitting the prompt\nvar loraTag = regexp.MustCompile(`<lora:([^:>]+):([^>]+)>`)\nfor _, m := range loraTag.FindAllStringSubmatch(prompt, -1) {\n    if _, err := strconv.ParseFloat(m[2], 32); err != nil {\n        return fmt.Errorf(\"invalid LoRA multiplier %q in tag %s\", m[2], m[0])\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use plain dot-decimal multipliers like <lora:name:0.8>","Validate prompt tags server-side so bad multipliers are rejected loudly, not stripped silently"],"tags":["stablediffusion","lora","prompt-parsing","validation"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}