Skip to content

add support for cache modes to accelerate image generation#2021

Draft
wbruna wants to merge 10 commits intoLostRuins:concedo_experimentalfrom
wbruna:kcpp_sd_cache
Draft

add support for cache modes to accelerate image generation#2021
wbruna wants to merge 10 commits intoLostRuins:concedo_experimentalfrom
wbruna:kcpp_sd_cache

Conversation

@wbruna
Copy link

@wbruna wbruna commented Mar 7, 2026

Makes --cache-mode and --cache-option available through gendefaults.

This is on top of #1982 just because I'm testing both together; only the last commit matters for this PR. If you prefer, I can rebase it the other way around (there are a few annoying conflicts on sdtype_adapter.cpp).

I had to copy the key=value parser from examples/common/common.hpp because it's not really usable from there, but the code should be simple enough.

wbruna added 10 commits March 6, 2026 10:27
Also fix typo in the function name.
The `sdloramult` flag now accepts a list of multipliers, one for each
LoRA. If all multipliers are non-zero, LoRAs load as before, with no extra
VRAM usage or performance impact.

If any LoRA has a multiplier of 0, we switch to `at_runtime` mode, and these
LoRAs will be available to multiplier changes via the `lora` sdapi field and
show up in the `sdapi/v1/loras` endpoint. All LoRAs are still preloaded on
startup, and cached to avoid file reloads.

A single multiplier (1.0 by default) is applied to all LoRAs, to keep it
compatible with the previous behavior.
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.

1 participant