Skip to content

fix: sd-server uses lora_model_dir correctly#1328

Closed
mostlygeek wants to merge 4 commits intoleejet:masterfrom
mostlygeek:master
Closed

fix: sd-server uses lora_model_dir correctly#1328
mostlygeek wants to merge 4 commits intoleejet:masterfrom
mostlygeek:master

Conversation

@mostlygeek
Copy link
Copy Markdown

@mostlygeek mostlygeek commented Mar 7, 2026

Pass ctx_params.lora_model_dir instead of "" for /v1/images/generations and /v1/images/edits handlers. The empty string caused extract_and_remove_lora() to return immediately.

Tested this locally and the DEBUG output now correctly has the lora

SDGenerationParams {
  loras: "{
    "/mnt/nvme/models/sd.cpp/flux/realism_lora_comfy_converted.safetensors": "1"
  }",
  high_noise_loras: "{
  }"
}

Whereas current master the loras would be an empty object.

Pass ctx_params.lora_model_dir instead of "" for /v1/images/generations and
/v1/images/edits handlers. The empty string caused
extract_and_remove_lora() to return immediately.
@candrews
Copy link
Copy Markdown

This is a subset of #1156 but without the path sensitization.

claude and others added 2 commits March 15, 2026 04:37
Reject absolute paths in user-supplied lora references and validate
that resolved relative paths stay within lora_model_dir using
fs::canonical(). This prevents path traversal attacks like
<lora:../../etc/passwd:1> or <lora:/etc/shadow:1> from reading
arbitrary files on the host.

https://claude.ai/code/session_01RnNL2d3tAHW4pNuBDu3wi8
@leejet
Copy link
Copy Markdown
Owner

leejet commented Mar 15, 2026

Closing this PR since it duplicates #1156 .

@leejet leejet closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants