Brings in the 73 upstream commits since b13a482 (2026-10-20 to 2026-11-05):
cancellation of running server jobs (#2190), recipe based model management
and idempotent model loading (#2176, #2188, #2217, #2221), ADetailer in the
server (#2164), generation metadata returned with the core results (#2206,
which changes generate_image and generate_video), integrated GPUs in the
automatic memory planning (#2228), discrete GPUs preferred in auto-fit
(#2259), Vulkan capacity checks retried after reclaiming memory (#2256),
the layer split fix across CUDA devices (#2262), RPC devices in
--list-devices (#2182), new models and many speed-ups (FLUX.3, Fibo 2.0,
MiniMax-H3, P-H3-Image, MOSS, Z-Image control-net, INT8 CUDA fusions),
Node 24 and ccache in the workflows, a CUTLASS submodule for the CUDA build,
and the ggml sync to 135ce1e.
Conflicts resolved by hand in 25 files, keeping both sides:
- include/stable-diffusion.h, src/stable-diffusion.cpp,
src/core/ggml_runner.cpp, src/pipeline/diffusion_engine.cpp,
src/pipeline/image.cpp: upstream's result API stays (generate_image and
generate_video fill a result out-parameter, free_sd_image_generation_result
releases it); the fork's classified errors, exception barrier and busy
check wrap it, so a failed call still records its reason and clears the
result. memory_guard, disable_backend_fallback and multi_gpu follow
upstream's last sd_ctx_params_t field. A stop on request is logged as
information, not as an error.
- src/core/backend_fit.cpp: integrated GPUs are enumerated as upstream now
does; which device becomes the main one is still decided by the fork's
rules (discrete before integrated, a card seen by both CUDA and Vulkan
counts once), which cover the case of #2259 as well.
- src/core/ggml_extend_backend.cpp, CMakeLists.txt: the NVIDIA driver is
still loaded at run time (sd::cuda_driver; the toolkit provides headers
only), so upstream's cuda_compiled_arch asks the compute capability
through it and not through <cuda.h>; the CUTLASS include of upstream
stays.
- src/model_manager.cpp: the CPU memory guard and upstream's capacity
rechecks (#2183, #2256) both apply.
- examples/server (runtime, main, async_jobs, routes_*): the context keeper
is still the only owner of the context, and ServerRuntime has no context
or mutex of its own. Upstream's model catalog (--model-dir, the
/sdcpp/v1/models routes, recipes) asks the keeper to load and unload
(ContextKeeper::load, unload, has_model), so a model loaded from the
catalog gets the same recovery ladder as the one given with -m, built from
the options of the new model. ADetailer runs with the context and the
options of the profile in use. The server still starts without a model.
- Cancellation: every job has a CancelToken that the keeper registers only
while the job generates. POST /sdcpp/v1/jobs/{id}/cancel answers at once
when called without ?wait=, as upstream does (the job can still be
generating, with cancel_requested true); with ?wait=N it waits for the end
of the job and answers 200, or 202 if it is still ending, which is what
the fork's guardian expects. cancel_requested is always in the job JSON.
- examples/common/common.{h,cpp}: upstream's --list-devices with RPC devices
and --taesd-preview-only next to the fork's --profile, --memory-guard,
--multi-gpu and --disable-backend-fallback.
- .github/workflows/build.yml: upstream's Node 24, ccache and CUDA header
triggers next to the fork's CPU Docker variant, lowercase image names,
combined CUDA and Vulkan Windows zip and Italian release notes.
examples/cli and examples/server CMakeLists: profile.cpp and recovery.cpp
are added to upstream's source lists.
- docs/backend.md, docs/build.md, examples/server/api.md: the sections of
both sides are kept. The paragraph on how a layer split assigns blocks is
the fork's, which is what layer_split_partition.cpp does (the first device
takes blocks until its free memory is used up), not upstream's
"proportional" wording.
The ggml submodule moves from dc99877 to 135ce1e, the frontend submodule to
fa93429 and the new thirdparty/cutlass submodule is added, all at upstream's
pins. A checkout needs git submodule update --init --recursive.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhZzDBkuuMp1jBf4WtEySC
3.8 KiB
Docker
The container images are built from this repository by the CI
(.github/workflows/build.yml) and published to the GitHub Container Registry
as ghcr.io/filve/diffusione-in-tempo-reale, so they always contain the code of
this fork. Every push to master updates these tags:
| Tag | Backend | Platform | Notes |
|---|---|---|---|
master-cpu |
CPU only | linux/amd64 |
no GPU needed |
master-cuda |
CUDA 12 | linux/amd64 |
NVIDIA GPUs; start it with --gpus all (needs the NVIDIA Container Toolkit) |
master-vulkan |
Vulkan | linux/amd64 |
AMD and Intel GPUs through Mesa; pass the GPU with --device /dev/dri |
master-musa |
MUSA | linux/amd64 |
Moore Threads GPUs |
master-sycl |
SYCL | linux/amd64 |
Intel GPUs |
master-cuda-spark |
CUDA 13 | linux/arm64 |
NVIDIA DGX Spark |
The examples below use the CPU image; swap the tag for the one that matches your hardware.
Run CLI
docker run --rm -v /path/to/models:/models -v /path/to/output/:/output ghcr.io/filve/diffusione-in-tempo-reale:master-cpu [args...]
# For example
# docker run --rm -v ./models:/models -v ./build:/output ghcr.io/filve/diffusione-in-tempo-reale:master-cpu -m /models/sd-v1-4.ckpt -p "a lovely cat" -v -o /output/output.png
Check that an NVIDIA GPU is visible to the container before generating:
docker run --rm --gpus all ghcr.io/filve/diffusione-in-tempo-reale:master-cuda --list-devices
Run server
docker run --rm --init -v /path/to/models:/models -v /path/to/output/:/output -p "1234:1234" --entrypoint "/sd-server" ghcr.io/filve/diffusione-in-tempo-reale:master-cpu [args...]
# For example
# docker run --rm --init -v ./models:/models -v ./build:/output -p "1234:1234" --entrypoint "/sd-server" ghcr.io/filve/diffusione-in-tempo-reale:master-cpu -m /models/sd-v1-4.ckpt -p "a lovely cat" -v -o /output/output.png
Building using Docker
Initialize the submodules from the repository root before building. Docker copies the local checkout, so its build context must include the submodule contents:
git submodule update --init --recursive
docker build -f docker/Dockerfile -t sd .
Building variants using Docker
CUDA (NVIDIA GPU):
docker build -f docker/Dockerfile.cuda -t sd-cuda .
To select GPU architectures, pass --build-arg "CUDA_ARCHITECTURES=89" (for
example, RTX 4090). Run the image on a host configured with NVIDIA Container
Toolkit, using docker run --rm --gpus all ... sd-cuda [args...].
Vulkan:
docker build -f docker/Dockerfile.vulkan -t sd .
ROCm (AMD GPU):
Defining one or multiple targets with --build-arg AMDGPU_TARGETS is strongly recommended.
Building the image will otherwise likely fail or build for a target that does not fit your
hardware.
# Build for one target
docker build -f docker/Dockerfile.rocm --build-arg "AMDGPU_TARGETS=gfx1100" -t sd .
# Build for multiple targets
docker build -f docker/Dockerfile.rocm --build-arg "AMDGPU_TARGETS=gfx1030;gfx1100" -t sd .
Run locally built image's CLI
docker run --rm -v /path/to/models:/models -v /path/to/output/:/output sd [args...]
# For example
# docker run --rm -v ./models:/models -v ./build:/output sd -m /models/sd-v1-4.ckpt -p "a lovely cat" -v -o /output/output.png
ROCm (AMD GPU)
The user that executes this command needs to be in the video group and have read and write
access to /dev/dri and /dev/kfd.
--device and --group-add allow the container access to the GPU.
docker run --rm --device=/dev/dri --device=/dev/kfd --group-add video \
-v /path/to/models:/models -v /path/to/output/:/output \
sd [args...]
# For example
# docker run --rm --device=/dev/dri --device=/dev/kfd --group-add video \
# -v ./models:/models -v ./build:/output \
# sd -m /models/sd-v1-4.ckpt -v -o /output/output.png \
# -p "a lovely cat"