mirror of
https://github.com/DarthAffe/StableDiffusion.NET.git
synced 2026-11-09 18:36:29 +00:00
Changed backend-priority to be changeable
This commit is contained in:
1 parent
7fbbb70f90
commit
bb71986ce7
5 files changed
+5
-5
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user