[GH-ISSUE #2817] [Feature]: SDAPI usage for llama-swap (and stable-diffusion.cpp) #1430

Closed
opened 2026-10-21 05:33:44 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Stegorix on GitHub (Jun 23, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2817

What problem does this solve?

LLama-Swap rejects an image generation request with the SDAPI, when the request is missing the "model" tag. llama-swap needs the model information to select and start the correct model

Proposed solution

The addition of the model tag when using the sdapi (/sdapi/v1/txt2img)
(Addtion of "model: request.model" to body in image-generation.ts:2176)
As i do not use any other sdapi compatible solutions, i cannot check if this will cause problems in them.
So maybe implement the solution as a toggle option?

Alternatives considered

stable-diffusion.cpp seems to support injections into the openai api. But making an adjustment at this point would involve significantly more work. Even better would be be a native support of the stable-diffusion.cpp and llama-swap apis. But as I am not very fluent in javascript, i cannot really help implementing such a feature.

Additional context

Example:

  • Create a new connection
  • Select Image Generation
  • Set URL (http://x.x.x.x:xxx/)
  • Select SD Web UI
  • Enter Model ID (exposed in llama-swap)
  • Test image
    -> Result: AUTOMATIC1111 generation failed (404): {"error":"no model id could be identified","src":"llama-swap"}

After adding above solution the generation is working.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Stegorix on GitHub (Jun 23, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2817 ## What problem does this solve? LLama-Swap rejects an image generation request with the SDAPI, when the request is missing the "model" tag. llama-swap needs the model information to select and start the correct model ## Proposed solution The addition of the model tag when using the sdapi (/sdapi/v1/txt2img) (Addtion of "model: request.model" to body in image-generation.ts:2176) As i do not use any other sdapi compatible solutions, i cannot check if this will cause problems in them. So maybe implement the solution as a toggle option? ## Alternatives considered stable-diffusion.cpp seems to support injections into the openai api. But making an adjustment at this point would involve significantly more work. Even better would be be a native support of the stable-diffusion.cpp and llama-swap apis. But as I am not very fluent in javascript, i cannot really help implementing such a feature. ## Additional context Example: - Create a new connection - Select Image Generation - Set URL (http://x.x.x.x:xxx/) - Select SD Web UI - Enter Model ID (exposed in llama-swap) - Test image -> Result: AUTOMATIC1111 generation failed (404): {"error":"no model id could be identified","src":"llama-swap"} After adding above solution the generation is working. ## Template check - [ ] I DID NOT read this template and provide the requested details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1430
No description provided.