mirror of
https://github.com/DarthAffe/StableDiffusion.NET.git
synced 2025-12-13 05:48:40 +00:00
Compare commits
No commits in common. "f2476cce3563b20ec85f2cd09fd9f1f577af75ae" and "d42883540fc36646f6d6b94fed45efc32c006adb" have entirely different histories.
f2476cce35
...
d42883540f
369
.github/workflows/backends.yml
vendored
369
.github/workflows/backends.yml
vendored
@ -13,9 +13,12 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows-cpu:
|
windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
VULKAN_VERSION: 1.3.261.1
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
@ -27,16 +30,38 @@ jobs:
|
|||||||
defines: '-DGGML_NATIVE=OFF -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON'
|
defines: '-DGGML_NATIVE=OFF -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON'
|
||||||
- build: 'avx512'
|
- build: 'avx512'
|
||||||
defines: '-DGGML_NATIVE=OFF -DGGML_AVX512=ON -DSD_BUILD_SHARED_LIBS=ON'
|
defines: '-DGGML_NATIVE=OFF -DGGML_AVX512=ON -DSD_BUILD_SHARED_LIBS=ON'
|
||||||
|
- build: 'cuda12'
|
||||||
|
defines: '-DSD_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="61;89" -DSD_BUILD_SHARED_LIBS=ON'
|
||||||
|
- build: 'vulkan'
|
||||||
|
defines: "-DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.1.2
|
||||||
with:
|
with:
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
repository: 'leejet/stable-diffusion.cpp'
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
ref: '${{ github.event.inputs.commit }}'
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install cuda-toolkit
|
||||||
|
id: cuda-toolkit-12
|
||||||
|
if: ${{ matrix.build == 'cuda12' }}
|
||||||
|
uses: Jimver/cuda-toolkit@v0.2.19
|
||||||
|
with:
|
||||||
|
cuda: '12.6.2'
|
||||||
|
method: network
|
||||||
|
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
|
||||||
|
|
||||||
|
- name: Install Vulkan SDK
|
||||||
|
id: get_vulkan
|
||||||
|
if: ${{ matrix.build == 'vulkan' }}
|
||||||
|
run: |
|
||||||
|
curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/VulkanSDK-${env:VULKAN_VERSION}-Installer.exe"
|
||||||
|
& "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
|
||||||
|
Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
|
||||||
|
Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
id: cmake_build
|
id: cmake_build
|
||||||
run: |
|
run: |
|
||||||
@ -47,127 +72,54 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
id: upload_artifact
|
id: upload_artifact
|
||||||
uses: actions/upload-artifact@v4.6.1
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: windows-${{ matrix.build }}
|
name: windows-${{ matrix.build }}
|
||||||
path: .\build\bin\Release\stable-diffusion.dll
|
path: .\build\bin\Release\stable-diffusion.dll
|
||||||
|
|
||||||
windows-cuda12:
|
windows-2019:
|
||||||
runs-on: windows-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
id: checkout
|
|
||||||
uses: actions/checkout@v4.2.2
|
|
||||||
with:
|
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Install Cuda Toolkit 12.8
|
|
||||||
id: cuda-12
|
|
||||||
run: |
|
|
||||||
mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8"
|
|
||||||
choco install unzip -y
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-12.8.57-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-12.8.61-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-12.8.61-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-12.8.3.14-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-12.8.55-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_profiler_api/windows-x86_64/cuda_profiler_api-windows-x86_64-12.8.55-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-12.8.55-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-12.8.57-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-12.8.55-archive.zip"
|
|
||||||
unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8"
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\cuda_cudart-windows-x86_64-12.8.57-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\cuda_nvcc-windows-x86_64-12.8.61-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\cuda_nvrtc-windows-x86_64-12.8.61-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\libcublas-windows-x86_64-12.8.3.14-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\cuda_nvtx-windows-x86_64-12.8.55-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\cuda_profiler_api-windows-x86_64-12.8.55-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\visual_studio_integration-windows-x86_64-12.8.55-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\cuda_nvprof-windows-x86_64-12.8.57-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\cuda_cccl-windows-x86_64-12.8.55-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\visual_studio_integration\MSBuildExtensions\*" "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations" /E /I /H /Y
|
|
||||||
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
||||||
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
||||||
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
|
||||||
echo "CUDA_PATH_V12_8=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
id: cmake_build
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
cmake .. -DSD_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="61;75;86;89;100" -DSD_BUILD_SHARED_LIBS=ON
|
|
||||||
cmake --build . --config Release
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
id: upload_artifact
|
|
||||||
uses: actions/upload-artifact@v4.6.1
|
|
||||||
with:
|
|
||||||
name: windows-cuda12
|
|
||||||
path: .\build\bin\Release\stable-diffusion.dll
|
|
||||||
|
|
||||||
windows-cuda11:
|
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- build: 'cuda11'
|
||||||
|
defines: '-DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_ARCHITECTURES="61" -DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler"'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.1.2
|
||||||
with:
|
with:
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
repository: 'leejet/stable-diffusion.cpp'
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
ref: '${{ github.event.inputs.commit }}'
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install Cuda Toolkit 11.8
|
- name: Install cuda-toolkit
|
||||||
id: cuda-11
|
id: cuda-toolkit-11
|
||||||
run: |
|
if: ${{ matrix.build == 'cuda11' }}
|
||||||
mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8"
|
uses: Jimver/cuda-toolkit@v0.2.16
|
||||||
choco install unzip -y
|
with:
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-11.8.89-archive.zip"
|
cuda: '11.8.0'
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-11.8.89-archive.zip"
|
method: network
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-11.8.89-archive.zip"
|
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-11.8.1.74-archive.zip"
|
use-github-cache: false
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-11.8.86-archive.zip"
|
use-local-cache: false
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_profiler_api/windows-x86_64/cuda_profiler_api-windows-x86_64-11.8.86-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-11.8.86-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-11.8.87-archive.zip"
|
|
||||||
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-11.8.89-archive.zip"
|
|
||||||
unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8"
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\cuda_cudart-windows-x86_64-11.8.89-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\cuda_nvcc-windows-x86_64-11.8.89-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\cuda_nvrtc-windows-x86_64-11.8.89-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libcublas-windows-x86_64-11.8.1.74-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\cuda_nvtx-windows-x86_64-11.8.86-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\cuda_profiler_api-windows-x86_64-11.8.86-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\visual_studio_integration-windows-x86_64-11.8.86-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\cuda_nvprof-windows-x86_64-11.8.87-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\cuda_cccl-windows-x86_64-11.8.89-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" /E /I /H /Y
|
|
||||||
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\visual_studio_integration\MSBuildExtensions\*" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\BuildCustomizations" /E /I /H /Y
|
|
||||||
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
||||||
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
||||||
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
|
||||||
echo "CUDA_PATH_V11_8=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
id: cmake_build
|
id: cmake_build
|
||||||
shell: cmd
|
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
cmake .. ${{ matrix.defines }}
|
||||||
cmake .. -DSD_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="61;75;86;89" -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler"
|
|
||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
id: upload_artifact
|
id: upload_artifact
|
||||||
uses: actions/upload-artifact@v4.6.1
|
if: ${{ matrix.build != 'rocm5' }}
|
||||||
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: windows-cuda11
|
name: windows-${{ matrix.build }}
|
||||||
path: .\build\bin\Release\stable-diffusion.dll
|
path: .\build\bin\Release\stable-diffusion.dll
|
||||||
|
|
||||||
windows-sycl:
|
windows-sycl:
|
||||||
@ -185,7 +137,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.1.2
|
||||||
with:
|
with:
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
repository: 'leejet/stable-diffusion.cpp'
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
ref: '${{ github.event.inputs.commit }}'
|
||||||
@ -193,7 +145,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout Install Script
|
- name: Checkout Install Script
|
||||||
id: checkoutInstallScript
|
id: checkoutInstallScript
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.1.2
|
||||||
with:
|
with:
|
||||||
path: scripts
|
path: scripts
|
||||||
sparse-checkout: |
|
sparse-checkout: |
|
||||||
@ -211,7 +163,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
id: upload_artifact
|
id: upload_artifact
|
||||||
uses: actions/upload-artifact@v4.6.1
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: windows-sycl
|
name: windows-sycl
|
||||||
path: .\build\bin\stable-diffusion.dll
|
path: .\build\bin\stable-diffusion.dll
|
||||||
@ -236,7 +188,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.1.2
|
||||||
with:
|
with:
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
repository: 'leejet/stable-diffusion.cpp'
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
ref: '${{ github.event.inputs.commit }}'
|
||||||
@ -254,52 +206,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
id: upload_artifact
|
id: upload_artifact
|
||||||
uses: actions/upload-artifact@v4.6.1
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: windows-rocm6
|
name: windows-rocm6
|
||||||
path: .\build\bin\stable-diffusion.dll
|
path: .\build\bin\stable-diffusion.dll
|
||||||
|
|
||||||
windows-vulkan:
|
linux:
|
||||||
runs-on: windows-latest
|
|
||||||
|
|
||||||
env:
|
|
||||||
VULKAN_VERSION: 1.3.261.1
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
id: checkout
|
|
||||||
uses: actions/checkout@v4.2.2
|
|
||||||
with:
|
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Install Vulkan SDK
|
|
||||||
id: get_vulkan
|
|
||||||
run: |
|
|
||||||
curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/VulkanSDK-${env:VULKAN_VERSION}-Installer.exe"
|
|
||||||
& "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
|
|
||||||
Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
|
|
||||||
Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
id: cmake_build
|
|
||||||
run: |
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON
|
|
||||||
cmake --build . --config Release
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
id: upload_artifact
|
|
||||||
uses: actions/upload-artifact@v4.6.1
|
|
||||||
with:
|
|
||||||
name: windows-vulkan
|
|
||||||
path: .\build\bin\Release\stable-diffusion.dll
|
|
||||||
|
|
||||||
linux-cpu:
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
@ -311,115 +224,45 @@ jobs:
|
|||||||
defines: '-DGGML_NATIVE=OFF -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON'
|
defines: '-DGGML_NATIVE=OFF -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON'
|
||||||
- build: 'avx512'
|
- build: 'avx512'
|
||||||
defines: '-DGGML_NATIVE=OFF -DGGML_AVX512=ON -DSD_BUILD_SHARED_LIBS=ON'
|
defines: '-DGGML_NATIVE=OFF -DGGML_AVX512=ON -DSD_BUILD_SHARED_LIBS=ON'
|
||||||
|
- build: 'cuda11'
|
||||||
|
defines: '-DSD_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="61" -DSD_BUILD_SHARED_LIBS=ON'
|
||||||
|
- build: 'cuda12'
|
||||||
|
defines: '-DSD_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="61;89" -DSD_BUILD_SHARED_LIBS=ON'
|
||||||
|
- build: 'sycl'
|
||||||
|
defines: '-DSD_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DSD_BUILD_SHARED_LIBS=ON'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.1.2
|
||||||
with:
|
with:
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
repository: 'leejet/stable-diffusion.cpp'
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
ref: '${{ github.event.inputs.commit }}'
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Build
|
- name: Install cuda-toolkit
|
||||||
id: cmake_build
|
id: cuda-toolkit-11
|
||||||
run: |
|
if: ${{ matrix.build == 'cuda11' }}
|
||||||
mkdir build
|
uses: Jimver/cuda-toolkit@v0.2.14
|
||||||
cd build
|
|
||||||
cmake .. ${{ matrix.defines }}
|
|
||||||
cmake --build . --config Release
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
id: upload_artifact
|
|
||||||
uses: actions/upload-artifact@v4.6.1
|
|
||||||
with:
|
with:
|
||||||
name: linux-${{ matrix.build }}
|
cuda: '11.7.1'
|
||||||
path: ./build/bin/libstable-diffusion.so
|
method: network
|
||||||
|
use-github-cache: false
|
||||||
|
use-local-cache: false
|
||||||
|
|
||||||
linux-cuda12:
|
- name: Install cuda-toolkit
|
||||||
runs-on: ubuntu-latest
|
id: cuda-toolkit-12
|
||||||
container: nvidia/cuda:12.8.0-devel-ubuntu24.04
|
if: ${{ matrix.build == 'cuda12' }}
|
||||||
|
uses: Jimver/cuda-toolkit@v0.2.14
|
||||||
steps:
|
|
||||||
- name: Install dependencies
|
|
||||||
env:
|
|
||||||
DEBIAN_FRONTEND: noninteractive
|
|
||||||
run: |
|
|
||||||
apt update
|
|
||||||
apt install -y cmake build-essential ninja-build libgomp1 git
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
id: checkout
|
|
||||||
uses: actions/checkout@v4.2.2
|
|
||||||
with:
|
with:
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
cuda: '12.2.0'
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
method: network
|
||||||
submodules: recursive
|
use-github-cache: false
|
||||||
|
use-local-cache: false
|
||||||
- name: Build
|
|
||||||
id: cmake_build
|
|
||||||
run: |
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -DSD_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="61;75;86;89;100" -DSD_BUILD_SHARED_LIBS=ON
|
|
||||||
cmake --build . --config Release
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
id: upload_artifact
|
|
||||||
uses: actions/upload-artifact@v4.6.1
|
|
||||||
with:
|
|
||||||
name: linux-cuda12
|
|
||||||
path: ./build/bin/libstable-diffusion.so
|
|
||||||
|
|
||||||
linux-cuda11:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: nvidia/cuda:11.8.0-devel-ubuntu22.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Install dependencies
|
|
||||||
env:
|
|
||||||
DEBIAN_FRONTEND: noninteractive
|
|
||||||
run: |
|
|
||||||
apt update
|
|
||||||
apt install -y cmake build-essential ninja-build libgomp1 git
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
id: checkout
|
|
||||||
uses: actions/checkout@v4.2.2
|
|
||||||
with:
|
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
id: cmake_build
|
|
||||||
run: |
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -DSD_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="61;75;86;89" -DSD_BUILD_SHARED_LIBS=ON
|
|
||||||
cmake --build . --config Release
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
id: upload_artifact
|
|
||||||
uses: actions/upload-artifact@v4.6.1
|
|
||||||
with:
|
|
||||||
name: linux-cuda11
|
|
||||||
path: ./build/bin/libstable-diffusion.so
|
|
||||||
|
|
||||||
linux-sycl:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
id: checkout
|
|
||||||
uses: actions/checkout@v4.2.2
|
|
||||||
with:
|
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Install Sycl tools
|
- name: Install Sycl tools
|
||||||
id: installSyclCompiler
|
id: installSyclCompiler
|
||||||
|
if: ${{ matrix.build == 'sycl' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd /tmp
|
cd /tmp
|
||||||
@ -431,19 +274,29 @@ jobs:
|
|||||||
sudo apt install intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel
|
sudo apt install intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
id: cmake_build
|
id: cmake_build_sycl
|
||||||
|
if: ${{ matrix.build == 'sycl' }}
|
||||||
run: |
|
run: |
|
||||||
source /opt/intel/oneapi/setvars.sh
|
source /opt/intel/oneapi/setvars.sh
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -DSD_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DSD_BUILD_SHARED_LIBS=ON
|
cmake .. ${{ matrix.defines }}
|
||||||
|
cmake --build . --config Release
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
id: cmake_build
|
||||||
|
if: ${{ matrix.build != 'sycl' }}
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. ${{ matrix.defines }}
|
||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
id: upload_artifact
|
id: upload_artifact
|
||||||
uses: actions/upload-artifact@v4.6.1
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: linux-sycl
|
name: linux-${{ matrix.build }}
|
||||||
path: ./build/bin/libstable-diffusion.so
|
path: ./build/bin/libstable-diffusion.so
|
||||||
|
|
||||||
linux-hip:
|
linux-hip:
|
||||||
@ -460,7 +313,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Clone
|
- name: Clone
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
repository: 'leejet/stable-diffusion.cpp'
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
ref: '${{ github.event.inputs.commit }}'
|
||||||
@ -476,12 +329,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload artifact Rocm
|
- name: Upload artifact Rocm
|
||||||
id: upload_artifact_rocm
|
id: upload_artifact_rocm
|
||||||
uses: actions/upload-artifact@v4.6.1
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: linux-rocm6
|
name: linux-rocm6
|
||||||
path: ./build/bin/libstable-diffusion.so
|
path: ./build/bin/libstable-diffusion.so
|
||||||
|
|
||||||
osx-cpu:
|
osx:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
@ -499,7 +352,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.1.2
|
||||||
with:
|
with:
|
||||||
repository: 'leejet/stable-diffusion.cpp'
|
repository: 'leejet/stable-diffusion.cpp'
|
||||||
ref: '${{ github.event.inputs.commit }}'
|
ref: '${{ github.event.inputs.commit }}'
|
||||||
@ -515,36 +368,30 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
id: upload_artifact
|
id: upload_artifact
|
||||||
uses: actions/upload-artifact@v4.6.1
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: osx-${{ matrix.build }}
|
name: osx-${{ matrix.build }}
|
||||||
path: ./build/bin/libstable-diffusion.dylib
|
path: ./build/bin/libstable-diffusion.dylib
|
||||||
|
|
||||||
release:
|
release:
|
||||||
runs-on: windows-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
needs:
|
needs:
|
||||||
- windows-cpu
|
- windows
|
||||||
- windows-cuda12
|
|
||||||
- windows-cuda11
|
|
||||||
- windows-sycl
|
|
||||||
- windows-hip
|
- windows-hip
|
||||||
- windows-vulkan
|
- windows-sycl
|
||||||
- linux-cpu
|
- linux
|
||||||
- linux-cuda12
|
|
||||||
- linux-cuda11
|
|
||||||
- linux-sycl
|
|
||||||
- linux-hip
|
- linux-hip
|
||||||
- osx-cpu
|
- osx
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.1.2
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
id: download_artifacts
|
id: download_artifacts
|
||||||
uses: actions/download-artifact@v4.1.9
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: Backends
|
path: Backends
|
||||||
|
|
||||||
@ -553,7 +400,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup nuget
|
- name: Setup nuget
|
||||||
id: setup_nuget
|
id: setup_nuget
|
||||||
uses: NuGet/setup-nuget@v2.0.1
|
uses: NuGet/setup-nuget@v2.0.0
|
||||||
|
|
||||||
- name: Pack
|
- name: Pack
|
||||||
id: pack
|
id: pack
|
||||||
@ -570,7 +417,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
id: upload_artifacts
|
id: upload_artifacts
|
||||||
uses: actions/upload-artifact@v4.6.1
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: StableDiffusion.NET.Backend-Nugets
|
name: StableDiffusion.NET.Backend-Nugets
|
||||||
path: ./*.nupkg
|
path: ./*.nupkg
|
||||||
|
|||||||
@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="HPPH.System.Drawing" Version="1.0.0" />
|
<PackageReference Include="HPPH.System.Drawing" Version="1.0.0" />
|
||||||
<PackageReference Include="StableDiffusion.NET.Backend.Cpu" Version="3.4.1" />
|
<PackageReference Include="StableDiffusion.NET.Backend.Cpu" Version="3.3.1" />
|
||||||
<PackageReference Include="StableDiffusion.NET.Backend.Cuda" Version="3.4.1" />
|
<PackageReference Include="StableDiffusion.NET.Backend.Cuda" Version="3.3.1" />
|
||||||
<PackageReference Include="StableDiffusion.NET.Backend.Rocm" Version="3.4.1" />
|
<PackageReference Include="StableDiffusion.NET.Backend.Rocm" Version="3.3.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -34,14 +34,11 @@ public enum Quantization
|
|||||||
F64 = 28,
|
F64 = 28,
|
||||||
IQ1_M = 29,
|
IQ1_M = 29,
|
||||||
BF16 = 30,
|
BF16 = 30,
|
||||||
//Q4_0_4_4 = 31, support has been removed from gguf files
|
Q4_0_4_4 = 31,
|
||||||
//Q4_0_4_8 = 32,
|
Q4_0_4_8 = 32,
|
||||||
//Q4_0_8_8 = 33,
|
Q4_0_8_8 = 33,
|
||||||
TQ1_0 = 34,
|
TQ1_0 = 34,
|
||||||
TQ2_0 = 35,
|
TQ2_0 = 35,
|
||||||
// SD_TYPE_IQ4_NL_4_4 = 36,
|
|
||||||
// SD_TYPE_IQ4_NL_4_8 = 37,
|
|
||||||
// SD_TYPE_IQ4_NL_8_8 = 38,
|
|
||||||
|
|
||||||
Unspecified = 39
|
Unspecified
|
||||||
}
|
}
|
||||||
@ -11,7 +11,5 @@ public enum Sampler
|
|||||||
DPMPP2Mv2,
|
DPMPP2Mv2,
|
||||||
IPNDM,
|
IPNDM,
|
||||||
IPNDM_V,
|
IPNDM_V,
|
||||||
LCM,
|
LCM
|
||||||
DDIM_Trailing,
|
|
||||||
TCD
|
|
||||||
}
|
}
|
||||||
@ -113,7 +113,6 @@ public sealed unsafe class DiffusionModel : IDisposable
|
|||||||
parameter.ClipSkip,
|
parameter.ClipSkip,
|
||||||
parameter.CfgScale,
|
parameter.CfgScale,
|
||||||
parameter.Guidance,
|
parameter.Guidance,
|
||||||
parameter.Eta,
|
|
||||||
parameter.Width,
|
parameter.Width,
|
||||||
parameter.Height,
|
parameter.Height,
|
||||||
parameter.SampleMethod,
|
parameter.SampleMethod,
|
||||||
@ -149,7 +148,6 @@ public sealed unsafe class DiffusionModel : IDisposable
|
|||||||
parameter.ClipSkip,
|
parameter.ClipSkip,
|
||||||
parameter.CfgScale,
|
parameter.CfgScale,
|
||||||
parameter.Guidance,
|
parameter.Guidance,
|
||||||
parameter.Eta,
|
|
||||||
parameter.Width,
|
parameter.Width,
|
||||||
parameter.Height,
|
parameter.Height,
|
||||||
parameter.SampleMethod,
|
parameter.SampleMethod,
|
||||||
@ -177,7 +175,6 @@ public sealed unsafe class DiffusionModel : IDisposable
|
|||||||
parameter.ClipSkip,
|
parameter.ClipSkip,
|
||||||
parameter.CfgScale,
|
parameter.CfgScale,
|
||||||
parameter.Guidance,
|
parameter.Guidance,
|
||||||
parameter.Eta,
|
|
||||||
parameter.Width,
|
parameter.Width,
|
||||||
parameter.Height,
|
parameter.Height,
|
||||||
parameter.SampleMethod,
|
parameter.SampleMethod,
|
||||||
|
|||||||
@ -90,10 +90,5 @@ public sealed class DiffusionParameter
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public float Guidance { get; set; } = 3.5f;
|
public float Guidance { get; set; } = 3.5f;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// eta in DDIM, only for DDIM and TCD (default: 0)
|
|
||||||
/// </summary>
|
|
||||||
public float Eta { get; set; } = 0f;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@ -82,7 +82,6 @@ internal unsafe partial class Native
|
|||||||
int clip_skip,
|
int clip_skip,
|
||||||
float cfg_scale,
|
float cfg_scale,
|
||||||
float guidance,
|
float guidance,
|
||||||
float eta,
|
|
||||||
int width,
|
int width,
|
||||||
int height,
|
int height,
|
||||||
sample_method_t sample_method,
|
sample_method_t sample_method,
|
||||||
|
|||||||
48
build.bat
Normal file
48
build.bat
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
if not exist stable-diffusion.cpp (
|
||||||
|
git clone --recursive https://github.com/leejet/stable-diffusion.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
cd stable-diffusion.cpp
|
||||||
|
git fetch
|
||||||
|
git checkout 73c2176648898b3a223c581ed138e5593f8fded5
|
||||||
|
git submodule init
|
||||||
|
git submodule update
|
||||||
|
|
||||||
|
if not exist build (
|
||||||
|
mkdir build
|
||||||
|
)
|
||||||
|
|
||||||
|
cd build
|
||||||
|
|
||||||
|
Rem ----------------------------------------------------------------------------
|
||||||
|
rem Pick one of the builds below.
|
||||||
|
|
||||||
|
rem # cuda12 #
|
||||||
|
cmake .. -DSD_CUBLAS=ON -DSD_BUILD_SHARED_LIBS=ON -DSD_BUILD_EXAMPLES=OFF
|
||||||
|
|
||||||
|
rem # rocm5.5 #
|
||||||
|
rem cmake .. -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 -DSD_BUILD_EXAMPLES=OFF
|
||||||
|
|
||||||
|
rem # avx512 #
|
||||||
|
rem cmake .. -DGGML_AVX512=ON -DSD_BUILD_SHARED_LIBS=ON -DSD_BUILD_EXAMPLES=OFF
|
||||||
|
|
||||||
|
rem # avx2 #
|
||||||
|
rem cmake .. -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON -DSD_BUILD_EXAMPLES=OFF
|
||||||
|
|
||||||
|
rem # avx #
|
||||||
|
rem cmake .. -DGGML_AVX2=OFF -DSD_BUILD_SHARED_LIBS=ON -DSD_BUILD_EXAMPLES=OFF
|
||||||
|
|
||||||
|
rem # noavx #
|
||||||
|
rem cmake .. -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DSD_BUILD_SHARED_LIBS=ON -DSD_BUILD_EXAMPLES=OFF
|
||||||
|
|
||||||
|
Rem ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
cmake --build . --config Release
|
||||||
|
|
||||||
|
cd ..\..
|
||||||
|
|
||||||
|
dotnet publish -c Release -o bin
|
||||||
|
|
||||||
|
copy .\stable-diffusion.cpp\build\bin\Release\*.dll .\bin\
|
||||||
|
|
||||||
|
pause
|
||||||
Loading…
x
Reference in New Issue
Block a user