Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
845646b
feat(server): add ADetailer support to image generation (#2164)
losewayy Oct 21, 2026
939895f
feat: display remaining time (#2076)
vmobilis Oct 21, 2026
2e2ba3f
feat: add Fibo 2.0 Dev and Edit Turbo support (#2180)
leejet Oct 21, 2026
b15c8aa
fix: include RPC devices in --list-devices (#2182)
leejet Oct 21, 2026
a77d362
fix: recheck memory capacity when eviction candidates are unchanged (…
leejet Oct 21, 2026
a0c8508
feat: add --taesd-preview-only to shared context params (#2184)
noctrex Oct 22, 2026
ddd6b3a
fix: correct Linux sysfs path for physical core detection (#2186)
boriselec Oct 22, 2026
530fa39
fix: prevent z-image crash with reference images (#2185)
wbruna Oct 22, 2026
f18dbfc
feat(server): allow recipes to override backend/params_backend in con…
crystalsighting Oct 22, 2026
39bc9d0
fix: update ggml to avoid small BAR heaps on Vulkan (#2181)
leejet Oct 22, 2026
deaeed6
fix: MiniT2I - adjust image dimension to fixed 512x512 (#2189)
akleine Oct 22, 2026
e779d4f
feat(server): support cancellation of running generation jobs (#2190)
leejet Oct 22, 2026
fd21ecf
refactor: use one placeholder token per image in LLM inputs (#2191)
leejet Oct 22, 2026
baf45b4
fix: forward ref_image_args to the video pipeline (#2177)
philipsorst Oct 23, 2026
cd7f986
refactor: centralize model factories and defaults (#2198)
leejet Oct 23, 2026
40b1788
feat: allow grouped temporal decoding for Wan2.2 TI2V 5B (#2196)
losewayy Oct 23, 2026
e0ed724
chore: format code
leejet Oct 23, 2026
95ff762
fix: update ggml to fix SageAttention builds on older GPUs (#2199)
leejet Oct 23, 2026
50a64f0
fix: skip metadata alpha for LoRAs with baked_scale (#2202)
ArtyomITA Oct 24, 2026
4c870cc
fix: balance singleton tails in short Wan vae decode plans (#2197)
losewayy Oct 24, 2026
b29cad5
feat: add control-net z-image (#2187)
SolicTous Oct 24, 2026
a85db96
feat: return generation metadata with core results (#2206)
leejet Oct 24, 2026
ea209db
perf: cache CPU position embeddings across DiT runners (#2211)
leejet Oct 24, 2026
0886f11
fix: skip reference image VAE encoding when latents have no consumer …
wbruna Oct 24, 2026
d234ac6
feat: print sigma values before inference (#2205)
wbruna Oct 25, 2026
2a5f810
perf: reuse shared modulation slices for moss image (#2208)
mirek190 Oct 25, 2026
e6370bf
perf: avoid redundant MOSS QKV and value layout copies (#2209)
mirek190 Oct 25, 2026
bb6a0cc
feat: support FLUX.3 Diffusers LoRA tensor names (#2214)
leejet Oct 25, 2026
0f76bf5
feat(server): accept ref_videos, ref_audios, ref_video_audios in sdcp…
crystalsighting Oct 25, 2026
b29962d
sync: update frontend
leejet Oct 25, 2026
a5e48c6
chore: reduce large recipe defaults to 1024x1024 except PiD
leejet Oct 25, 2026
012c7f8
ci: trigger builds on recipe JSON changes
leejet Oct 25, 2026
e41fbcf
feat(server): add recipe constraints and update generation workspace …
leejet Oct 25, 2026
bb6b128
fix: avoid repeated seeks when skipping small GGUF metadata values (#…
leejet Oct 26, 2026
be48649
fix: enable segmented execution for FLUX.3 (#2224)
leejet Oct 26, 2026
2032526
fix: include integrated GPUs in automatic memory planning (#2228)
Project516 Oct 27, 2026
9bfc4d1
fix: honor the requested hires sampling step count (#2227)
Project516 Oct 27, 2026
209b28c
feat(server): add recipe model defaults and idempotent model loading …
crystalsighting Oct 27, 2026
d09cb4c
ci: update workflow actions for Node 24 (#2230)
Project516 Oct 27, 2026
6879155
ci: complete Node 24 migration for workflows and Docker builds
leejet Oct 27, 2026
8cbe905
refactor: use a distinct version id for Chroma (#2237)
wbruna Oct 28, 2026
77b72a2
perf: accelerate INT8 diffusion inference with CUDA fusions (#2235)
leejet Oct 28, 2026
8ee08e3
perf: use fused ggml_geglu_swapped for GEGLU (#2245)
daniandtheweb Oct 29, 2026
997478a
refactor: `make_hires_sigma_schedule()` simplification (#2244)
vmobilis Oct 29, 2026
e7b7ec6
fix: detect SDXL when the UNet is loaded standalone from diffusers te…
Whq02 Oct 29, 2026
37bc88b
perf: optimize H3 inference and segmented weight prefetch (#2240)
leejet Oct 29, 2026
e239e4b
refactor: replace manual gated activations with native ggml GLU (#2250)
leejet Oct 29, 2026
0a06712
perf: optimize Vulkan kernels, graph fusion, and workspace reuse (#2251)
leejet Oct 31, 2026
c6dfa9d
perf(vulkan): update ggml for H3 inference optimizations (#2252)
leejet Oct 31, 2026
45a63ac
refactor: move model-specific operators and fusions into backend exte…
leejet Nov 1, 2026
5356982
fix: chunk MiniMax-H3 MLP to respect backend buffer limits (#2257)
leejet Nov 1, 2026
df0fa26
fix: update CUTLASS license paths in Docker and Windows CUDA packaging
leejet Nov 1, 2026
fe2682b
fix: retry Vulkan capacity checks after memory reclamation (#2256)
leejet Nov 1, 2026
62c5443
fix: include missing cassert headers in SageAttention CUDA code
leejet Nov 1, 2026
5d33b1b
ci: trigger builds on CUDA header changes
leejet Nov 1, 2026
133087d
fix: prefer discrete GPUs in auto-fit device selection (#2259)
leejet Nov 1, 2026
290148d
feat: add custom modulate operator and ConvRot fusion (#2258)
leejet Nov 1, 2026
1350cf5
ci: cache CUDA compilation for Windows and Docker builds
leejet Nov 2, 2026
250ea6e
fix: layer split across cuda (#2262)
cumal Nov 2, 2026
b4d6b83
fix: support integer LoRA scalar conversion to FP32 (#2263)
leejet Nov 2, 2026
3be2378
ci: use ccache to fix Windows CUDA command parsing failures
leejet Nov 2, 2026
f8ea2e1
perf: use native SiTU for MOSS with composite fallback (#2210)
mirek190 Nov 3, 2026
6225bf8
perf: view qkv slices for moss instead of slice+reshape (#2232)
pwilkin Nov 3, 2026
d308544
perf: fuse Z-Image GPU operations and optimize BF16 GEMM (#2265)
leejet Nov 3, 2026
984eb06
perf(cuda): fuse MOSS modulation and direct RoPE F16 output (#2269)
leejet Nov 3, 2026
3e92bf9
feat: add P-H3-Image generation and editing support (#2272)
leejet Nov 4, 2026
d135894
feat: MiniMax-H3 latent hires second pass (#2249)
farawayso Nov 4, 2026
58bb3c1
perf(vulkan): accelerate MOSS normalization and SiTU staging (#2273)
leejet Nov 4, 2026
64fb9d4
Merge upstream master-1050-58bb3c1 into the fork
danielhanchen Nov 6, 2026
d4ed8d3
Port the carried ggml patches onto leejet/ggml 135ce1e0 (master-1050 …
danielhanchen Nov 6, 2026
7c062d2
Prebuilt: fetch the CUTLASS headers the CUDA build now needs
danielhanchen Nov 6, 2026
6f12cd9
Prebuilt: build macOS arm64 on macos-15
danielhanchen Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
build*/
docs/
test/
tests/

.cache/
*.swp
models/
models/
7 changes: 6 additions & 1 deletion .github/workflows/unsloth-sd-prebuilt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ jobs:
# (we build with SD_SERVER_BUILD_FRONTEND / SD_WEBP / SD_WEBM off), so fetch only
# ggml to keep the source tarball small and the build self-contained.
git submodule update --init --recursive --depth 1 ggml
# The CUDA build includes cmake/cutlass.cmake, which fails without the CUTLASS headers
# (INT8 GEMM and CuTe attention kernels). Only include/ is compiled against, so keep that
# and the license and drop the rest of the checkout from the source tarball.
git submodule update --init --depth 1 thirdparty/cutlass
find thirdparty/cutlass -mindepth 1 -maxdepth 1 ! -name include ! -name LICENSE.txt ! -name .git -exec rm -rf {} +
# ggml changes we carry on top of the pinned submodule commit (the submodule points at
# leejet/ggml, which we do not push to). A patch that no longer applies fails the build.
for p in scripts/unsloth/ggml-patches/*.patch; do
Expand Down Expand Up @@ -264,7 +269,7 @@ jobs:
matrix:
include:
- label: Darwin-macOS-arm64
runner: macos-14
runner: macos-15
arch: arm64
# Static: apple_m1 variant drops FP16_VA (~40% slower). BLAS explicit: sd.cpp routes big matmuls to it.
defines: "-DSD_METAL=ON -DGGML_METAL_EMBED_LIBRARY=ON -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Apple -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ build*/
cmake-build-*/
test/
tests/
logs/
.vscode/
.idea/
.cache/
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "thirdparty/libwebm"]
path = thirdparty/libwebm
url = https://github.com/webmproject/libwebm.git
[submodule "thirdparty/cutlass"]
path = thirdparty/cutlass
url = https://github.com/NVIDIA/cutlass.git
42 changes: 42 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ file(GLOB SD_LIB_SOURCES CONFIGURE_DEPENDS
"src/core/*.h"
"src/core/*.cpp"
"src/core/*.hpp"
"src/core/cpu/*.h"
"src/core/cpu/*.cpp"
"src/core/probe/*.h"
"src/core/probe/*.cpp"
"src/extensions/*.h"
Expand Down Expand Up @@ -343,6 +345,46 @@ if (SD_CUDA)
# Keep the driver stub on downstream link lines when no driver is installed.
target_link_libraries(${SD_LIB} PUBLIC CUDA::cuda_driver)
set_property(SOURCE src/core/ggml_extend_backend.cpp APPEND PROPERTY COMPILE_DEFINITIONS SD_USE_CUDA)
if (NOT SD_USE_UPSTREAM_GGML)
include(cmake/cutlass.cmake)
enable_language(CUDA)
set_target_properties(${SD_LIB} PROPERTIES CUDA_STANDARD 17 CUDA_STANDARD_REQUIRED ON)
if (SD_CUDA_CUTLASS_PATH)
target_sources(${SD_LIB} PRIVATE src/core/cuda/cute_attention.cu src/core/cuda/i8_projection.cu src/core/cuda/i8_gated_residual.cu src/core/cuda/i8_gemm.cu src/core/cuda/bf16_gemm.cu)
set_source_files_properties(src/core/cuda/cute_attention.cu src/core/cuda/i8_projection.cu src/core/cuda/i8_gated_residual.cu src/core/cuda/i8_gemm.cu src/core/cuda/bf16_gemm.cu PROPERTIES
INCLUDE_DIRECTORIES "${SD_CUDA_CUTLASS_PATH}/include"
COMPILE_OPTIONS "--use_fast_math;--extended-lambda;--expt-relaxed-constexpr")
if (MSVC)
set_property(SOURCE src/core/cuda/cute_attention.cu src/core/cuda/i8_projection.cu src/core/cuda/i8_gated_residual.cu src/core/cuda/i8_gemm.cu src/core/cuda/bf16_gemm.cu APPEND PROPERTY COMPILE_OPTIONS -Xcompiler=/Zc:preprocessor,/Zc:__cplusplus)
endif()
if (GGML_CUDA_FORCE_CUBLAS)
set_property(SOURCE src/core/cuda/i8_projection.cu src/core/cuda/i8_gated_residual.cu src/core/cuda/i8_gemm.cu src/core/cuda/bf16_gemm.cu APPEND PROPERTY COMPILE_DEFINITIONS SD_CUDA_FORCE_CUBLAS)
endif()
endif()
endif()
endif()
set(SD_BACKEND_REGISTRATIONS)
if (NOT SD_USE_UPSTREAM_GGML AND (SD_CUDA OR SD_HIPBLAS OR SD_MUSA))
if(SD_HIPBLAS)
include(cmake/hip.cmake)
endif()
add_subdirectory(src/core/cuda)
foreach(VENDOR CUDA HIP MUSA)
if(SD_${VENDOR} OR (VENDOR STREQUAL "HIP" AND SD_HIPBLAS))
string(TOLOWER "${VENDOR}" NAMESPACE)
list(APPEND SD_BACKEND_REGISTRATIONS "sd_${NAMESPACE}::register_extensions")
endif()
endforeach()
endif()
if (SD_VULKAN AND NOT SD_USE_UPSTREAM_GGML)
add_subdirectory(src/core/vulkan)
list(APPEND SD_BACKEND_REGISTRATIONS sd_ggml_register_vulkan_rope sd_ggml_register_vulkan_i8 sd_ggml_register_vulkan_modulate sd_ggml_register_vulkan_rms_affine)
endif()
if(SD_BACKEND_REGISTRATIONS)
string(REPLACE ";" ",\n " SD_BACKEND_REGISTRATIONS "${SD_BACKEND_REGISTRATIONS}")
configure_file(cmake/backend_extensions.h.in generated/sd_backend_extensions.h @ONLY)
set_property(SOURCE src/core/ggml_extensions.cpp APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/generated")
set_property(SOURCE src/core/ggml_extensions.cpp APPEND PROPERTY COMPILE_DEFINITIONS SD_BACKEND_EXTENSIONS)
endif()
if (SD_HIPBLAS)
find_package(hip REQUIRED CONFIG HINTS "$ENV{ROCM_PATH}" /opt/rocm)
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ API and command-line option may change frequently.***
- [FLUX.2-dev/FLUX.2-klein](./docs/flux2.md)
- [FLUX.3 Image Klein / Klein Base](./docs/flux3.md)
- [MOSS-Image-Base / MOSS-Image-SFT](./docs/moss_image.md)
- [Fibo 2.0 Dev](./docs/fibo2.md)
- [Lens](./docs/lens.md)
- [Chroma](./docs/chroma.md)
- [Chroma1-Radiance](./docs/chroma_radiance.md)
Expand All @@ -58,6 +59,7 @@ API and command-line option may change frequently.***
- [Z-Image](./docs/z_image.md)
- [Z-Image L2P](./docs/z_image_l2p.md)
- [MiniT2I](./docs/minit2i.md)
- [P-H3-Image](./docs/p_h3_image.md)
- [SenseNova U1.5](./docs/sensenova_u1.md)
- [Ovis-Image](./docs/ovis_image.md)
- [Anima](./docs/anima.md)
Expand All @@ -79,6 +81,7 @@ API and command-line option may change frequently.***
- [Boogu Image Edit](./docs/boogu_image.md)
- [Mage-Flow-Edit](./docs/mage_flow.md#image-editing)
- [LLaDA-Image Edit](./docs/llada_image.md#image-editing)
- [Fibo 2.0 Dev / Edit Turbo](./docs/fibo2.md#editing-and-turbo)
- Video Models
- [Wan2.1/Wan2.2](./docs/wan.md)
- [MiniMax-H3](./docs/minimax_h3.md)
Expand Down
Binary file added assets/fibo2/dev_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/fibo2/t2i.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions cmake/backend_extensions.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef __SD_BACKEND_EXTENSIONS_H__
#define __SD_BACKEND_EXTENSIONS_H__

#include "core/cuda/registration.h"

void sd_ggml_register_vulkan_rope(ggml_backend_dev_t device);
void sd_ggml_register_vulkan_i8(ggml_backend_dev_t device);
void sd_ggml_register_vulkan_rms_affine(ggml_backend_dev_t device);
void sd_ggml_register_vulkan_modulate(ggml_backend_dev_t device);

static void (*const sd_backend_extensions[])(ggml_backend_dev_t) = {
@SD_BACKEND_REGISTRATIONS@
};

#endif
20 changes: 20 additions & 0 deletions cmake/cutlass.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
set(sd_cutlass_default "${PROJECT_SOURCE_DIR}/thirdparty/cutlass")
if(NOT DEFINED SD_CUDA_CUTLASS_PATH AND DEFINED GGML_CUDA_CUTLASS_PATH)
get_filename_component(sd_old_cutlass_default "${SD_GGML_SOURCE_DIR}/src/ggml-cuda/vendors/cutlass" ABSOLUTE)
if(NOT GGML_CUDA_CUTLASS_PATH STREQUAL sd_old_cutlass_default)
set(sd_cutlass_default "${GGML_CUDA_CUTLASS_PATH}")
endif()
message(STATUS "Migrating GGML_CUDA_CUTLASS_PATH to SD_CUDA_CUTLASS_PATH")
endif()
set(SD_CUDA_CUTLASS_PATH "${sd_cutlass_default}" CACHE PATH "sd: CUTLASS source directory for INT8 GEMM and CuTe attention, empty to disable")
unset(GGML_CUDA_CUTLASS_PATH CACHE)
if(SD_CUDA_CUTLASS_PATH)
if(NOT EXISTS "${SD_CUDA_CUTLASS_PATH}/include/cutlass/gemm/kernel/default_gemm_universal_with_visitor.h" OR
NOT EXISTS "${SD_CUDA_CUTLASS_PATH}/include/cute/tensor.hpp")
message(FATAL_ERROR
"CUTLASS headers not found at ${SD_CUDA_CUTLASS_PATH}. "
"Run git submodule update --init --recursive from the sd.cpp repository root, "
"set SD_CUDA_CUTLASS_PATH to a CUTLASS source tree (tested with 3.9.2), "
"or set SD_CUDA_CUTLASS_PATH to an empty string to disable CUTLASS.")
endif()
endif()
3 changes: 3 additions & 0 deletions cmake/embed_spirv.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
file(READ "${INPUT}" SPIRV HEX)
string(REGEX REPLACE "(..)(..)(..)(..)" "0x\\4\\3\\2\\1," SPIRV_WORDS "${SPIRV}")
file(WRITE "${OUTPUT}" "#include <cstdint>\nnamespace sd_vulkan_shaders {\nstatic const uint32_t ${NAME}[] = {${SPIRV_WORDS}};\n}\n")
31 changes: 20 additions & 11 deletions cmake/ggml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,29 @@ if(NOT TARGET ggml)
add_library(ggml ALIAS ggml::ggml)
endif()

get_target_property(sd_ggml_imported ggml IMPORTED)
if(sd_ggml_imported)
set(sd_ggml_private_include "${SD_GGML_SOURCE_DIR}/src")
else()
get_target_property(sd_ggml_private_include ggml SOURCE_DIR)
endif()
if(NOT EXISTS "${sd_ggml_private_include}/ggml-impl.h")
message(FATAL_ERROR "Set SD_GGML_SOURCE_DIR to the source tree matching the selected ggml library (ggml-impl.h is required).")
if(SD_USE_UPSTREAM_GGML)
get_target_property(sd_ggml_imported ggml IMPORTED)
if(sd_ggml_imported)
set(sd_ggml_private_include "${SD_GGML_SOURCE_DIR}/src")
else()
get_target_property(sd_ggml_private_include ggml SOURCE_DIR)
endif()
if(NOT EXISTS "${sd_ggml_private_include}/ggml-impl.h")
message(FATAL_ERROR "Set SD_GGML_SOURCE_DIR to the source tree matching the selected ggml library (ggml-impl.h is required).")
endif()
target_include_directories(${SD_LIB} PRIVATE "${sd_ggml_private_include}")
set_property(TARGET ${SD_LIB} PROPERTY SD_GGML_PRIVATE_INCLUDE_DIR "${sd_ggml_private_include}")
endif()
target_include_directories(${SD_LIB} PRIVATE "${sd_ggml_private_include}")
set_property(TARGET ${SD_LIB} PROPERTY SD_GGML_PRIVATE_INCLUDE_DIR "${sd_ggml_private_include}")

# The fused DiT ops come from scripts/unsloth/ggml-patches/0004; an unpatched ggml keeps the unfused H3 graph.
set(sd_ggml_header "${sd_ggml_private_include}/../include/ggml.h")
# Upstream only resolves the private include dir for SD_USE_UPSTREAM_GGML now, so find ggml.h here.
get_target_property(sd_ggml_ops_imported ggml IMPORTED)
if(sd_ggml_ops_imported)
set(sd_ggml_header "${SD_GGML_SOURCE_DIR}/include/ggml.h")
else()
get_target_property(sd_ggml_ops_src ggml SOURCE_DIR)
set(sd_ggml_header "${sd_ggml_ops_src}/../include/ggml.h")
endif()
if(EXISTS "${sd_ggml_header}")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${sd_ggml_header}")
file(STRINGS "${sd_ggml_header}" sd_ggml_h3_fused_ops REGEX "ggml_rope_pe_permute\\(")
Expand Down
12 changes: 12 additions & 0 deletions cmake/hip.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if(NOT WIN32 AND NOT CMAKE_CXX_COMPILER MATCHES "hipcc")
if(NOT CMAKE_HIP_ARCHITECTURES)
if(GPU_TARGETS)
set(CMAKE_HIP_ARCHITECTURES ${GPU_TARGETS})
elseif(AMDGPU_TARGETS)
set(CMAKE_HIP_ARCHITECTURES ${AMDGPU_TARGETS})
endif()
endif()
# HIP objects are linked by the parent target, so initialize its link rules here.
enable_language(HIP)
set_property(TARGET ${SD_LIB} PROPERTY HIP_ARCHITECTURES "${CMAKE_HIP_ARCHITECTURES}")
endif()
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends build-essential
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key -o /tmp/nodesource-repo.gpg.key && \
gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg /tmp/nodesource-repo.gpg.key && \
rm /tmp/nodesource-repo.gpg.key && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install -y --no-install-recommends nodejs && \
npm install -g pnpm@10.15.1 && \
Expand Down
24 changes: 19 additions & 5 deletions docker/Dockerfile.cuda
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# syntax=docker/dockerfile:1

ARG CUDA_VERSION=12.6.3
ARG UBUNTU_VERSION=24.04

FROM nvidia/cuda:${CUDA_VERSION}-cudnn-devel-ubuntu${UBUNTU_VERSION} AS build
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} AS build

# sd-server embeds the web UI at build time, so the build image needs Node/pnpm.
RUN apt-get update && apt-get install -y --no-install-recommends build-essential git ccache cmake ca-certificates curl gnupg && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key -o /tmp/nodesource-repo.gpg.key && \
gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg /tmp/nodesource-repo.gpg.key && \
rm /tmp/nodesource-repo.gpg.key && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install -y --no-install-recommends nodejs && \
npm install -g pnpm@10.15.1 && \
Expand All @@ -25,8 +27,15 @@ ARG CUDA_ARCHITECTURES=""
ARG GGML_CUDA_FA_ALL_QUANTS=""
ARG GGML_CUDA_ENABLE_DYNAMIC_CPU_BACKENDS=ON

ENV CCACHE_DIR=/root/.cache/ccache \
CCACHE_MAXSIZE=2G \
CCACHE_COMPILERCHECK=content

RUN set -- \
-DSD_CUDA=ON; \
-DSD_CUDA=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache; \
if [ "${GGML_CUDA_ENABLE_DYNAMIC_CPU_BACKENDS}" = "ON" ]; then \
set -- "$@" \
-DSD_BUILD_SHARED_LIBS=ON \
Expand All @@ -44,15 +53,20 @@ RUN set -- \
set -- "$@" "-DGGML_CUDA_FA_ALL_QUANTS=${GGML_CUDA_FA_ALL_QUANTS}"; \
fi; \
cmake . -B ./build "$@"
RUN cmake --build ./build --config Release -j$(nproc)
RUN --mount=type=cache,target=/root/.cache/ccache \
ccache --zero-stats && \
cmake --build ./build --config Release -j$(nproc) && \
ccache --cleanup && \
ccache --show-stats

FROM nvidia/cuda:${CUDA_VERSION}-cudnn-runtime-ubuntu${UBUNTU_VERSION} AS runtime
FROM nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION} AS runtime

RUN apt-get update && \
apt-get install --yes --no-install-recommends libgomp1 && \
apt-get clean

COPY --from=build /sd.cpp/build/bin /sd.cpp/bin
COPY --from=build /sd.cpp/thirdparty/cutlass/LICENSE.txt /sd.cpp/bin/cutlass.txt
RUN printf '#!/bin/sh\nexec /sd.cpp/bin/sd-cli "$@"\n' > /sd-cli && \
printf '#!/bin/sh\nexec /sd.cpp/bin/sd-server "$@"\n' > /sd-server && \
chmod +x /sd-cli /sd-server
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.musa
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends ccache cmake gi
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key -o /tmp/nodesource-repo.gpg.key && \
gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg /tmp/nodesource-repo.gpg.key && \
rm /tmp/nodesource-repo.gpg.key && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install -y --no-install-recommends nodejs && \
npm install -g pnpm@10.15.1 && \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key -o /tmp/nodesource-repo.gpg.key && \
gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg /tmp/nodesource-repo.gpg.key && \
rm /tmp/nodesource-repo.gpg.key && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
apt-get update && apt-get install -y --no-install-recommends nodejs && \
npm install -g pnpm@10.15.1 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.sycl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends cmake ca-certif
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key -o /tmp/nodesource-repo.gpg.key && \
gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg /tmp/nodesource-repo.gpg.key && \
rm /tmp/nodesource-repo.gpg.key && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install -y --no-install-recommends nodejs && \
npm install -g pnpm@10.15.1 && \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.vulkan
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends build-essential
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key -o /tmp/nodesource-repo.gpg.key && \
gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg /tmp/nodesource-repo.gpg.key && \
rm /tmp/nodesource-repo.gpg.key && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install -y --no-install-recommends nodejs && \
npm install -g pnpm@10.15.1 && \
Expand Down
Loading
Loading