stable-diffusion.cpp/examples
Claude 071a12b378
feat: add --profile to choose a resource footprint
--profile max|balanced|lite|auto sets, in one option, what a small
machine needs: balanced turns the memory guard on at 90; lite also
puts the text encoder on the CPU, tiles the VAE, runs CFG unbatched
and lowers the guard to 85. An option given on the command line always
wins over the profile, including --memory-guard 0. A profile does not
touch --params-backend or --backend, so --auto-fit keeps deciding
where the weights live, and it never changes the size or the steps of
an image.

auto compares the size of the model files plus a working-memory
reserve with the free memory of the discrete GPU with the most, or
with the available RAM without one, and logs the figures it used. It
leaves the defaults alone when the sizes or the memory are unknown.

parse_options() now records which options were given, through
option_was_given(). The levels below lite (weights streamed from disk,
everything on the CPU) cannot be chosen from the command line; they
are the steps a server takes when a request runs out of memory.

The thresholds of auto are heuristics and have not been tuned on a real
model or a GPU. Checked with the synthetic SD 1.5 model on the CPU: the
three profiles give the same image, and with 3.3 GiB held by another
process auto picks balanced.

Claude-Session: https://claude.ai/code/session_01EhZzDBkuuMp1jBf4WtEySC
2026-10-11 07:19:14 +02:00
..
cli feat: add --profile to choose a resource footprint 2026-10-11 07:19:14 +02:00
common feat: add --profile to choose a resource footprint 2026-10-11 07:19:14 +02:00
server feat: add --profile to choose a resource footprint 2026-10-11 07:19:14 +02:00
CMakeLists.txt feat: add Mage-Flow support (#1808) 2026-07-23 01:23:25 +08:00