stable-diffusion.cpp/scripts
Claude c2f6e845b1
Merge leejet/stable-diffusion.cpp 532d2c1 into fork-pull (sync 3/4)
Third of four steps towards upstream 3b12781: the opaque C API with
options, tensors and results (#2365).

The fork's additions move to the new API:
- multi_gpu, memory_guard and disable_backend_fallback are context
  options (sd::ContextConfig, registered in src/api/options.cpp) that
  sd-cli and sd-server set through SDContextParams::to_context_opt().
- Our classified error code is renamed sd_get_last_error_code(), since
  upstream's sd_get_last_error() now returns the diagnostic text.
  sd_ctx_create, sd_generate_image and sd_generate_video record it again
  (src/api/api.cpp); the device, system-memory and error-code functions
  stay in the public header.
- ContextKeeper creates contexts with sd_ctx_create() from the settings
  of each profile; its create_context hook takes SDContextParams. Every
  attempt builds fresh image or video options and forces VAE tiling with
  the vae_tiling.enabled key; ADetailer follows the keeper's context.
- Settings that became std::optional are read with the library defaults
  (profiles, keeper, conditioning-cache check); the obsolete seed
  workaround in sd-server is gone, since an unset seed is now random.
- test/profile_test, server_recovery_test and api_robustness use the new
  API; the scripted contexts are real sd_ctx_t objects, as sd_ctx_free()
  deletes them.

Verified with a CPU build: the library, sd-cli and sd-server build; all
eight unit-test programs pass, server_recovery_test also eight times in
a row and under ASan and TSan; sd-server answers /sdcpp/v1/health,
/sdcpp/v1/resources and refuses img_gen with model_not_loaded; sd-cli
reports a missing model as model_file. docs/integrazione_progetti.md
still shows the old API in its C examples; the docs follow after the
last step.

Claude-Session: https://claude.ai/code/session_01EhZzDBkuuMp1jBf4WtEySC
2026-11-24 13:01:39 +01:00
..
diagnostica_termica feat(scripts): add thermal diagnostics with an Italian guide 2026-10-14 23:35:52 +02:00
build-engine.ps1 test try CPU/GPU 2026-10-08 22:47:40 +02:00
build-engine.sh test try CPU/GPU 2026-10-08 22:47:40 +02:00
build-windows-gpu.ps1 test try CPU/GPU 2026-10-08 22:47:40 +02:00
ci-cuda-cache.sh ci: cache CUDA compilation for Windows and Docker builds 2026-11-02 23:51:33 +08:00
convert_fp8_scale_to_bf16.py chore: move utility scripts under scripts (#1746) 2026-07-05 18:48:18 +08:00
convert_qwen3_vl.py chore: move utility scripts under scripts (#1746) 2026-07-05 18:48:18 +08:00
convert_sefi.py chore: move utility scripts under scripts (#1746) 2026-07-05 18:48:18 +08:00
convert_yolov8_to_safetensors.py feat: add ADetailer support (#1785) 2026-07-14 23:59:11 +08:00
face_detect.py chore: move utility scripts under scripts (#1746) 2026-07-05 18:48:18 +08:00
format-code.ps1 refactor(api): adopt opaque options, tensors, and results (#2365) 2026-11-15 18:33:53 +08:00
format-code.sh refactor(api): adopt opaque options, tensors, and results (#2365) 2026-11-15 18:33:53 +08:00
merge_safetensors.py chore: format code 2026-08-19 23:06:07 +08:00
package_portable.sh docs: require Visual C++ Redistributable 14.44 or newer on Windows 2026-10-12 15:54:33 +02:00
package_windows_cuda_vulkan.sh docs: point the packaged README and the test help texts to --flash-attn 2026-10-18 19:52:37 +02:00
pulid_extract_id.py chore: move utility scripts under scripts (#1746) 2026-07-05 18:48:18 +08:00
remove_utf8_bom.py chore: move utility scripts under scripts (#1746) 2026-07-05 18:48:18 +08:00