diff --git a/.github/workflows/backends.yml b/.github/workflows/backends.yml index cbe8f10..e265828 100644 --- a/.github/workflows/backends.yml +++ b/.github/workflows/backends.yml @@ -111,65 +111,6 @@ jobs: name: windows-cuda12 path: .\build\bin\Release\stable-diffusion.dll - windows-cuda11: - 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 11.8 - id: cuda-11 - run: | - mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.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-11.8.89-archive.zip" - 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" - 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" - curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-11.8.1.74-archive.zip" - 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" - 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\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\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 - 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" -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler" - cmake --build . --config Release - - - name: Upload artifact - id: upload_artifact - uses: actions/upload-artifact@v4.6.1 - with: - name: windows-cuda11 - path: .\build\bin\Release\stable-diffusion.dll - windows-sycl: runs-on: windows-latest @@ -370,42 +311,7 @@ jobs: 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 @@ -526,13 +432,11 @@ jobs: needs: - windows-cpu - windows-cuda12 -# - windows-cuda11 # - windows-sycl - windows-hip - windows-vulkan - linux-cpu - linux-cuda12 - - linux-cuda11 - linux-sycl - linux-hip - osx-cpu @@ -559,13 +463,10 @@ jobs: id: pack run: | nuget pack ./Backends/StableDiffusion.NET.Backend.Cpu.nuspec -version ${{ github.event.inputs.version }} - nuget pack ./Backends/StableDiffusion.NET.Backend.Cuda11.Windows.nuspec -version ${{ github.event.inputs.version }} nuget pack ./Backends/StableDiffusion.NET.Backend.Cuda12.Windows.nuspec -version ${{ github.event.inputs.version }} - nuget pack ./Backends/StableDiffusion.NET.Backend.Cuda11.Linux.nuspec -version ${{ github.event.inputs.version }} nuget pack ./Backends/StableDiffusion.NET.Backend.Cuda12.Linux.nuspec -version ${{ github.event.inputs.version }} nuget pack ./Backends/StableDiffusion.NET.Backend.Cuda.nuspec -version ${{ github.event.inputs.version }} nuget pack ./Backends/StableDiffusion.NET.Backend.Rocm.nuspec -version ${{ github.event.inputs.version }} - nuget pack ./Backends/StableDiffusion.NET.Backend.Sycl.nuspec -version ${{ github.event.inputs.version }} nuget pack ./Backends/StableDiffusion.NET.Backend.Vulkan.nuspec -version ${{ github.event.inputs.version }} - name: Upload artifacts @@ -577,4 +478,4 @@ jobs: - name: Nuget Push id: nuget_push - run: dotnet nuget push **\*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push **\*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json \ No newline at end of file diff --git a/Backends/StableDiffusion.NET.Backend.Cuda.nuspec b/Backends/StableDiffusion.NET.Backend.Cuda.nuspec index 08c3c63..a467d88 100644 --- a/Backends/StableDiffusion.NET.Backend.Cuda.nuspec +++ b/Backends/StableDiffusion.NET.Backend.Cuda.nuspec @@ -9,15 +9,13 @@ MIT sd_net_cuda.png https://github.com/DarthAffe/StableDiffusion.NET - CUDA-Backend (11 and 12) for StableDiffusion.NET. + CUDA-Backend (12) for StableDiffusion.NET. Copyright © Darth Affe 2024 readme.md - - diff --git a/Backends/StableDiffusion.NET.Backend.Cuda11.Linux.nuspec b/Backends/StableDiffusion.NET.Backend.Cuda11.Linux.nuspec deleted file mode 100644 index af81315..0000000 --- a/Backends/StableDiffusion.NET.Backend.Cuda11.Linux.nuspec +++ /dev/null @@ -1,28 +0,0 @@ - - - - StableDiffusion.NET.Backend.Cuda11.Linux - $version$ - StableDiffusion.NET.Backend.Cuda11.Linux - Darth Affe & stable-diffusion.cpp Authors - false - MIT - sd_net_cuda.png - https://github.com/DarthAffe/StableDiffusion.NET - CUDA 11 Linux Backend for StableDiffusion.NET. - - Copyright © Darth Affe 2024 - readme.md - - - - - - - - - - - - - diff --git a/Backends/StableDiffusion.NET.Backend.Cuda11.Windows.nuspec b/Backends/StableDiffusion.NET.Backend.Cuda11.Windows.nuspec deleted file mode 100644 index 1421635..0000000 --- a/Backends/StableDiffusion.NET.Backend.Cuda11.Windows.nuspec +++ /dev/null @@ -1,28 +0,0 @@ - - - - StableDiffusion.NET.Backend.Cuda11.Windows - $version$ - StableDiffusion.NET.Backend.Cuda11.Windows - Darth Affe & stable-diffusion.cpp Authors - false - MIT - sd_net_cuda.png - https://github.com/DarthAffe/StableDiffusion.NET - CUDA 11 Windows Backend for StableDiffusion.NET. - - Copyright © Darth Affe 2024 - readme.md - - - - - - - - - - - - - diff --git a/Examples/ImageCreationUI/ActionCommand.cs b/Examples/ImageCreationUI/ActionCommand.cs deleted file mode 100644 index 2b87fdb..0000000 --- a/Examples/ImageCreationUI/ActionCommand.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Windows.Input; - -namespace ImageCreationUI; - -public class ActionCommand(Action command, Func? canExecute = null) : ICommand -{ - #region Events - - public event EventHandler? CanExecuteChanged; - - #endregion - - #region Methods - - public bool CanExecute(object? parameter) => canExecute?.Invoke() ?? true; - - public void Execute(object? parameter) => command.Invoke(); - - public void RaiseCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty); - - #endregion -} - -public class ActionCommand(Action command, Func? canExecute = null) : ICommand - where T : class -{ - #region Events - - public event EventHandler? CanExecuteChanged; - - #endregion - - #region Methods - - public bool CanExecute(object? parameter) => canExecute?.Invoke((T)parameter!) ?? true; - - public void Execute(object? parameter) => command.Invoke((T)parameter!); - - public void RaiseCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty); - - #endregion -} \ No newline at end of file diff --git a/Examples/ImageCreationUI/App.xaml b/Examples/ImageCreationUI/App.xaml deleted file mode 100644 index 84ead37..0000000 --- a/Examples/ImageCreationUI/App.xaml +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/Examples/ImageCreationUI/App.xaml.cs b/Examples/ImageCreationUI/App.xaml.cs deleted file mode 100644 index 4095cd8..0000000 --- a/Examples/ImageCreationUI/App.xaml.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System.Windows; - -namespace ImageCreationUI; - -public partial class App : Application; diff --git a/Examples/ImageCreationUI/Converter/ImageToImageSourceConverter.cs b/Examples/ImageCreationUI/Converter/ImageToImageSourceConverter.cs deleted file mode 100644 index c3d8cb6..0000000 --- a/Examples/ImageCreationUI/Converter/ImageToImageSourceConverter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Drawing; -using System.Globalization; -using System.IO; -using System.Windows.Data; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using HPPH; -using HPPH.System.Drawing; - -namespace ImageCreationUI.Converter; - -[ValueConversion(typeof(IImage), typeof(ImageSource))] -public class ImageToImageSourceConverter : IValueConverter -{ - public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) - { - using Bitmap? bitmap = (value as IImage)?.ToBitmap(); - if (bitmap == null) return null; - - using MemoryStream ms = new(); - bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); - ms.Position = 0; - - BitmapImage bitmapImage = new(); - bitmapImage.BeginInit(); - bitmapImage.StreamSource = ms; - bitmapImage.CacheOption = BitmapCacheOption.OnLoad; - bitmapImage.EndInit(); - - return bitmapImage; - } - - public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotSupportedException(); -} \ No newline at end of file diff --git a/Examples/ImageCreationUI/ImageCreationUI.csproj b/Examples/ImageCreationUI/ImageCreationUI.csproj deleted file mode 100644 index d1afed9..0000000 --- a/Examples/ImageCreationUI/ImageCreationUI.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - WinExe - net9.0-windows - enable - enable - true - true - - - - - - - - - - - - - - diff --git a/Examples/ImageCreationUI/ImageCreationUI.csproj.DotSettings b/Examples/ImageCreationUI/ImageCreationUI.csproj.DotSettings deleted file mode 100644 index 17962b1..0000000 --- a/Examples/ImageCreationUI/ImageCreationUI.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file diff --git a/Examples/ImageCreationUI/MainWindow.xaml b/Examples/ImageCreationUI/MainWindow.xaml deleted file mode 100644 index a549ca1..0000000 --- a/Examples/ImageCreationUI/MainWindow.xaml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -