mirror of
https://github.com/DarthAffe/StableDiffusion.NET.git
synced 2025-12-12 21:38:45 +00:00
Changed backend-priority to be changeable
This commit is contained in:
parent
7fbbb70f90
commit
bb71986ce7
@ -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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user