Skip to content

Commit 58225a0

Browse files
committed
Merge branch 'master' into nitrofusion
2 parents af58c4a + 0ebe6fe commit 58225a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+769995
-2496
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163
- build: "avx512"
164164
defines: "-DGGML_NATIVE=OFF -DGGML_AVX512=ON -DGGML_AVX=ON -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON"
165165
- build: "cuda12"
166-
defines: "-DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_ARCHITECTURES=90;89;80;75"
166+
defines: "-DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_ARCHITECTURES=90;89;86;80;75"
167167
# - build: "rocm5.5"
168168
# defines: '-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS="gfx1100;gfx1102;gfx1030" -DSD_BUILD_SHARED_LIBS=ON'
169169
- build: 'vulkan'

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
build*/
2+
cmake-build-*/
23
test/
34
.vscode/
5+
.idea/
46
.cache/
57
*.swp
6-
.vscode/
78
*.bat
89
*.bin
910
*.exe
1011
*.gguf
1112
output*.png
1213
models*
13-
*.log
14+
*.log

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "ggml"]
22
path = ggml
3-
url = https://github.com/ggerganov/ggml.git
3+
url = https://github.com/ggml-org/ggml.git

CMakeLists.txt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ option(SD_SYCL "sd: sycl backend" OFF)
3333
option(SD_MUSA "sd: musa backend" OFF)
3434
option(SD_FAST_SOFTMAX "sd: x1.5 faster softmax, indeterministic (sometimes, same seed don't generate same image), cuda only" OFF)
3535
option(SD_BUILD_SHARED_LIBS "sd: build shared libs" OFF)
36+
option(SD_USE_SYSTEM_GGML "sd: use system-installed GGML library" OFF)
3637
#option(SD_BUILD_SERVER "sd: build server example" ON)
3738

3839
if(SD_CUDA)
@@ -118,23 +119,37 @@ endif()
118119

119120
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
120121

121-
# see https://github.com/ggerganov/ggml/pull/682
122-
add_definitions(-DGGML_MAX_NAME=128)
122+
if (NOT SD_USE_SYSTEM_GGML)
123+
# see https://github.com/ggerganov/ggml/pull/682
124+
add_definitions(-DGGML_MAX_NAME=128)
125+
endif()
123126

124127
# deps
125128
# Only add ggml if it hasn't been added yet
126129
if (NOT TARGET ggml)
127-
add_subdirectory(ggml)
130+
if (SD_USE_SYSTEM_GGML)
131+
find_package(ggml REQUIRED)
132+
if (NOT ggml_FOUND)
133+
message(FATAL_ERROR "System-installed GGML library not found.")
134+
endif()
135+
add_library(ggml ALIAS ggml::ggml)
136+
else()
137+
add_subdirectory(ggml)
138+
endif()
128139
endif()
129140

130141
add_subdirectory(thirdparty)
131142

132143
target_link_libraries(${SD_LIB} PUBLIC ggml zip)
133144
target_include_directories(${SD_LIB} PUBLIC . thirdparty)
134-
target_compile_features(${SD_LIB} PUBLIC cxx_std_11)
145+
target_compile_features(${SD_LIB} PUBLIC c_std_11 cxx_std_17)
135146

136147

137148
if (SD_BUILD_EXAMPLES)
138149
add_subdirectory(examples)
139150
endif()
140151

152+
set(SD_PUBLIC_HEADERS stable-diffusion.h)
153+
set_target_properties(${SD_LIB} PROPERTIES PUBLIC_HEADER "${SD_PUBLIC_HEADERS}")
154+
155+
install(TARGETS ${SD_LIB} LIBRARY PUBLIC_HEADER)

Dockerfile.sycl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ARG SYCL_VERSION=2025.1.0-0
2+
3+
FROM intel/oneapi-basekit:${SYCL_VERSION}-devel-ubuntu24.04 AS build
4+
5+
RUN apt-get update && apt-get install -y cmake
6+
7+
WORKDIR /sd.cpp
8+
9+
COPY . .
10+
11+
RUN mkdir build && cd build && \
12+
cmake .. -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DSD_SYCL=ON -DCMAKE_BUILD_TYPE=Release && \
13+
cmake --build . --config Release -j$(nproc)
14+
15+
FROM intel/oneapi-basekit:${SYCL_VERSION}-devel-ubuntu24.04 AS runtime
16+
17+
COPY --from=build /sd.cpp/build/bin/sd /sd
18+
19+
ENTRYPOINT [ "/sd" ]

README.md

Lines changed: 76 additions & 37 deletions
Large diffs are not rendered by default.

assets/wan/Wan2.1_1.3B_t2v.mp4

238 KB
Binary file not shown.
158 KB
Binary file not shown.
297 KB
Binary file not shown.
287 KB
Binary file not shown.

0 commit comments

Comments
 (0)