{"record":{"id":"2d37c1ca1cb708c1","repo":"mudler/LocalAI","slug":"warning-lora-file-not-found-s-n","errorCode":null,"errorMessage":"WARNING: LoRA file not found: %s\\n","messagePattern":"WARNING: LoRA file not found: (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"backend/go/stablediffusion-ggml/cpp/gosd.cpp","lineNumber":261,"sourceCode":"                    final_path = std::filesystem::path(lora_dir) / raw_path;\n                }\n            }\n        }\n\n        // Try adding extensions if file doesn't exist\n        if (!std::filesystem::exists(final_path)) {\n            bool found = false;\n            for (const auto& ext : valid_ext) {\n                std::filesystem::path try_path = final_path;\n                try_path += ext;\n                if (std::filesystem::exists(try_path)) {\n                    final_path = try_path;\n                    found = true;\n                    break;\n                }\n            }\n            if (!found) {\n                fprintf(stderr, \"WARNING: LoRA file not found: %s\\n\", final_path.lexically_normal().string().c_str());\n                tmp = m.suffix().str();\n                cleaned_prompt = std::regex_replace(cleaned_prompt, re, \"\", std::regex_constants::format_first_only);\n                continue;\n            }\n        }\n\n        // Normalize path (matches upstream)\n        const std::string key = final_path.lexically_normal().string();\n\n        // Accumulate multiplier if same LoRA appears multiple times (matches upstream)\n        if (is_high_noise) {\n            high_noise_lora_map[key] += mul;\n        } else {\n            lora_map[key] += mul;\n        }\n\n        fprintf(stderr, \"Parsed LoRA: path='%s', multiplier=%.2f, is_high_noise=%s\\n\",\n                key.c_str(), mul, is_high_noise ? \"true\" : \"false\");","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/stablediffusion-ggml/cpp/gosd.cpp#L243-L279","documentation":"Warning from the LoRA prompt parser: a <lora:name:mul> tag resolved to a path that does not exist, even after trying the standard extensions (.pt/.safetensors/.gguf/.ckpt depending on context). The tag is stripped from the prompt and generation continues without that LoRA.","triggerScenarios":"Tag references a LoRA file name that is not present in the configured lora_dir (with or without an explicit extension), or an absolute path in the tag that does not exist on this machine; the '|high_noise|' prefix variant hits the same lookup.","commonSituations":"Sharing prompts that reference LoRAs the user never downloaded; renamed LoRA files; LoRAs stored outside lora_dir referenced by bare name instead of absolute path.","solutions":["Download the missing LoRA into lora_dir with exactly the referenced file name","Fix the name in the tag to match an existing file (extension is optional; .safetensors/.gguf/.pt/.ckpt are probed)","For LoRAs outside lora_dir, use an absolute path inside the tag"],"exampleFix":"// before\n\"a cat <lora:my_style:1>\"  // /loras/my_style.safetensors missing\n\n// after\ncp ~/downloads/my_style-v2.safetensors /loras/my_style.safetensors","handlingStrategy":"validation","validationCode":"// Go caller: verify each referenced LoRA resolves before generating\nfor _, m := range loraTag.FindAllStringSubmatch(prompt, -1) {\n    name := strings.TrimPrefix(m[1], \"|high_noise|\")\n    if strings.HasPrefix(name, \"/\") {\n        if _, err := os.Stat(name); err != nil { return fmt.Errorf(\"lora %s not found\", name) }\n        continue\n    }\n    found := false\n    for _, ext := range []string{\"\", \".safetensors\", \".gguf\", \".pt\", \".ckpt\"} {\n        if _, err := os.Stat(filepath.Join(loraDir, name+ext)); err == nil { found = true; break }\n    }\n    if !found { return fmt.Errorf(\"lora %q not found in %s\", name, loraDir) }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mirror the tag syntax (name[:multiplier], |high_noise| prefix) in your validator so pre-checks match backend resolution","Keep LoRA file names stable and documented next to the prompts that use them"],"tags":["stablediffusion","lora","prompt-parsing","filesystem"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}