mudler/LocalAI · warning

WARNING: LoRA file not found: %s\n

Error message

WARNING: LoRA file not found: %s\n

What it means

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.

Source

Thrown at backend/go/stablediffusion-ggml/cpp/gosd.cpp:261

                    final_path = std::filesystem::path(lora_dir) / raw_path;
                }
            }
        }

        // Try adding extensions if file doesn't exist
        if (!std::filesystem::exists(final_path)) {
            bool found = false;
            for (const auto& ext : valid_ext) {
                std::filesystem::path try_path = final_path;
                try_path += ext;
                if (std::filesystem::exists(try_path)) {
                    final_path = try_path;
                    found = true;
                    break;
                }
            }
            if (!found) {
                fprintf(stderr, "WARNING: LoRA file not found: %s\n", final_path.lexically_normal().string().c_str());
                tmp = m.suffix().str();
                cleaned_prompt = std::regex_replace(cleaned_prompt, re, "", std::regex_constants::format_first_only);
                continue;
            }
        }

        // Normalize path (matches upstream)
        const std::string key = final_path.lexically_normal().string();

        // Accumulate multiplier if same LoRA appears multiple times (matches upstream)
        if (is_high_noise) {
            high_noise_lora_map[key] += mul;
        } else {
            lora_map[key] += mul;
        }

        fprintf(stderr, "Parsed LoRA: path='%s', multiplier=%.2f, is_high_noise=%s\n",
                key.c_str(), mul, is_high_noise ? "true" : "false");

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Download the missing LoRA into lora_dir with exactly the referenced file name
  2. Fix the name in the tag to match an existing file (extension is optional; .safetensors/.gguf/.pt/.ckpt are probed)
  3. For LoRAs outside lora_dir, use an absolute path inside the tag

Example fix

// before
"a cat <lora:my_style:1>"  // /loras/my_style.safetensors missing

// after
cp ~/downloads/my_style-v2.safetensors /loras/my_style.safetensors
Defensive patterns

Strategy: validation

Validate before calling

// Go caller: verify each referenced LoRA resolves before generating
for _, m := range loraTag.FindAllStringSubmatch(prompt, -1) {
    name := strings.TrimPrefix(m[1], "|high_noise|")
    if strings.HasPrefix(name, "/") {
        if _, err := os.Stat(name); err != nil { return fmt.Errorf("lora %s not found", name) }
        continue
    }
    found := false
    for _, ext := range []string{"", ".safetensors", ".gguf", ".pt", ".ckpt"} {
        if _, err := os.Stat(filepath.Join(loraDir, name+ext)); err == nil { found = true; break }
    }
    if !found { return fmt.Errorf("lora %q not found in %s", name, loraDir) }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15). Data as JSON: /api/errors/2d37c1ca1cb708c1. Report an issue: GitHub.