Alex Dills fa9a28c6f3 Fix stable-diffusion.cpp model routing and URL path handling (#5427)
* fix: include model field in sd.cpp SDAPI requests and preserve URL path

The sd.cpp integration overwrites the URL pathname when constructing
requests, which breaks proxy servers like llama-swap that use path-based
routing (e.g. /upstream/model-name). Additionally, the model field was
never included in SDAPI requests, which is required by llama-swap to
route requests to the correct backend.

Changes:
- Server: Append to URL pathname instead of overwriting (same pattern as #5178)
- Server: Pass model field through to sd-server payload
- Client: Add model name text input for sd.cpp source settings
- Client: Send model name in generate request payload

* fix: fetch models from server and populate standard Model dropdown

Instead of a separate text input for the model name, fetch the model
list from the sd.cpp server's /v1/models endpoint and populate the
standard Model dropdown. This provides a seamless experience where
users just pick a model from the dropdown like any other source.

Works with both standalone sd-server and proxy servers like llama-swap
that expose multiple models via the OpenAI-compatible models endpoint.

* fix: don't send clip_skip=1 to sd.cpp, it produces blank images

sd-server generates blank white images when clip_skip is set to 1.
Since clip_skip=1 means 'use all CLIP layers' (the default behavior),
only send the parameter when it's > 1.

* Fix eslint

* Replace string appends with urlJoin

* fix: convert URL strings to URL objects in sdcpp routes

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-09 23:12:21 +03:00
2025-07-22 23:34:41 +03:00
2024-01-10 21:41:12 +02:00
2026-03-15 23:35:22 +02:00
2026-03-15 23:35:22 +02:00
2024-02-12 15:56:14 +02:00
2025-07-19 21:02:16 +03:00
2023-07-20 20:32:15 +03:00
2023-07-20 20:32:15 +03:00
2025-07-27 14:13:53 +03:00
2025-07-17 13:49:15 +00:00
2023-11-25 23:45:33 +02:00
2023-07-20 20:32:15 +03:00
2023-08-30 17:03:54 +03:00
2025-07-21 00:24:49 +03:00
S
Description
No description provided
Readme 117 MiB
Languages
JavaScript 88.5%
HTML 8.2%
CSS 2.8%
Less 0.3%