From bb71986ce72dbd43209e8de33036cb4718f69ce0 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Wed, 28 Aug 2024 20:02:29 +0200 Subject: [PATCH] Changed backend-priority to be changeable --- StableDiffusion.NET/Backends/CpuBackend.cs | 2 +- StableDiffusion.NET/Backends/CudaBackend.cs | 2 +- StableDiffusion.NET/Backends/IBackend.cs | 2 +- StableDiffusion.NET/Backends/RocmBackend.cs | 2 +- StableDiffusion.NET/Backends/SyclBackend.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/StableDiffusion.NET/Backends/CpuBackend.cs b/StableDiffusion.NET/Backends/CpuBackend.cs index ae8ed0e..4c1ff2e 100644 --- a/StableDiffusion.NET/Backends/CpuBackend.cs +++ b/StableDiffusion.NET/Backends/CpuBackend.cs @@ -13,7 +13,7 @@ public class CpuBackend : IBackend public bool IsEnabled { get; set; } = true; - public int Priority => 0; + public int Priority { get; set; } = 0; public bool IsAvailable => (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux) diff --git a/StableDiffusion.NET/Backends/CudaBackend.cs b/StableDiffusion.NET/Backends/CudaBackend.cs index c0e97c9..91aa1e3 100644 --- a/StableDiffusion.NET/Backends/CudaBackend.cs +++ b/StableDiffusion.NET/Backends/CudaBackend.cs @@ -22,7 +22,7 @@ public partial class CudaBackend : IBackend public bool IsEnabled { get; set; } = true; - public int Priority => 10; + public int Priority { get; set; } = 10; public bool IsAvailable => (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) diff --git a/StableDiffusion.NET/Backends/IBackend.cs b/StableDiffusion.NET/Backends/IBackend.cs index e881a9c..286d95e 100644 --- a/StableDiffusion.NET/Backends/IBackend.cs +++ b/StableDiffusion.NET/Backends/IBackend.cs @@ -6,7 +6,7 @@ namespace StableDiffusion.NET; public interface IBackend { bool IsEnabled { get; set; } - public int Priority { get; } + public int Priority { get; set; } bool IsAvailable { get; } string PathPart { get; } } \ No newline at end of file diff --git a/StableDiffusion.NET/Backends/RocmBackend.cs b/StableDiffusion.NET/Backends/RocmBackend.cs index 14035e0..cfbcf42 100644 --- a/StableDiffusion.NET/Backends/RocmBackend.cs +++ b/StableDiffusion.NET/Backends/RocmBackend.cs @@ -12,7 +12,7 @@ public partial class RocmBackend : IBackend public bool IsEnabled { get; set; } = true; - public int Priority => 10; + public int Priority { get; set; } = 10; public bool IsAvailable => ((RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && RocmVersion is 5) diff --git a/StableDiffusion.NET/Backends/SyclBackend.cs b/StableDiffusion.NET/Backends/SyclBackend.cs index 80e0b5b..d08a643 100644 --- a/StableDiffusion.NET/Backends/SyclBackend.cs +++ b/StableDiffusion.NET/Backends/SyclBackend.cs @@ -11,7 +11,7 @@ public class SyclBackend : IBackend //TODO DarthAffe 10.08.2024: tbh I'm not really sure how to detect a sycl-compatible system so for now it's disabled by default public bool IsEnabled { get; set; } = false; - public int Priority => 5; + public int Priority { get; set; } = 5; public bool IsAvailable => (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))