Browse Source

Merge pull request #382 from LykosAI/main

Release v2.7.7
dependabot/nuget/DeviceId.Linux-and-DeviceId-6.4.0
JT 11 months ago committed by GitHub
parent
commit
0782fb4b30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      CHANGELOG.md
  2. 14
      StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj
  3. 57
      StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CivitAiBrowserViewModel.cs
  4. 14
      StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectDataDirectoryViewModel.cs
  5. 28
      StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs
  6. 43
      StabilityMatrix.Avalonia/ViewModels/Inference/InferenceTextToImageViewModel.cs
  7. 24
      StabilityMatrix.Avalonia/ViewModels/Inference/SamplerCardViewModel.cs
  8. 43
      StabilityMatrix.Core/Models/Api/Comfy/Nodes/ComfyNodeBuilder.cs
  9. 23
      StabilityMatrix.Core/Models/Packages/StableDiffusionDirectMl.cs

11
CHANGELOG.md

@ -5,6 +5,17 @@ All notable changes to Stability Matrix will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
## v2.7.7
### Added
- Added `--use-directml` launch argument for SDWebUI DirectML fork
### Changed
- Model Browser downloads will no longer be disabled if the free drive space is unavailable
- Default Linux installation folder changed to prevent issues with hidden folders
- Changed default Period to "AllTime" in the Model Browser
### Fixed
- Fixed error where Environment Variables were not editable
- Fixed SDTurboScheduler's missing denoise parameter
## v2.7.6
### Added
- Added SDXL Turbo and Stable Video Diffusion to the Hugging Face tab

14
StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj

@ -24,16 +24,16 @@
<PackageReference Include="AutoComplete.Net" Version="1.2211.2014.42"/>
<PackageReference Include="Avalonia.AvaloniaEdit" Version="11.0.5" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="11.0.0.2" />
<PackageReference Include="Avalonia" Version="11.0.6" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.6" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.6" />
<PackageReference Include="Avalonia" Version="11.0.5" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.5" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.5" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.6" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.5" />
<PackageReference Include="Avalonia.HtmlRenderer" Version="11.0.0" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.6" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.5" />
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.0.5" />
<PackageReference Include="bodong.Avalonia.PropertyGrid" Version="11.0.6.1" />
<PackageReference Include="bodong.PropertyModels" Version="11.0.6.1" />
<PackageReference Include="bodong.Avalonia.PropertyGrid" Version="11.0.5.1" />
<PackageReference Include="bodong.PropertyModels" Version="11.0.5.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="DiscordRichPresence" Version="1.2.1.24" />

57
StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CivitAiBrowserViewModel.cs

@ -72,7 +72,7 @@ public partial class CivitAiBrowserViewModel : TabViewModelBase
private bool showMainLoadingSpinner;
[ObservableProperty]
private CivitPeriod selectedPeriod = CivitPeriod.Month;
private CivitPeriod selectedPeriod = CivitPeriod.AllTime;
[ObservableProperty]
private CivitSortMode sortMode = CivitSortMode.HighestRated;
@ -118,8 +118,10 @@ public partial class CivitAiBrowserViewModel : TabViewModelBase
private List<CheckpointBrowserCardViewModel> allModelCards = new();
public IEnumerable<CivitPeriod> AllCivitPeriods => Enum.GetValues(typeof(CivitPeriod)).Cast<CivitPeriod>();
public IEnumerable<CivitSortMode> AllSortModes => Enum.GetValues(typeof(CivitSortMode)).Cast<CivitSortMode>();
public IEnumerable<CivitPeriod> AllCivitPeriods =>
Enum.GetValues(typeof(CivitPeriod)).Cast<CivitPeriod>();
public IEnumerable<CivitSortMode> AllSortModes =>
Enum.GetValues(typeof(CivitSortMode)).Cast<CivitSortMode>();
public IEnumerable<CivitModelType> AllModelTypes =>
Enum.GetValues(typeof(CivitModelType))
@ -128,7 +130,17 @@ public partial class CivitAiBrowserViewModel : TabViewModelBase
.OrderBy(t => t.ToString());
public List<string> BaseModelOptions =>
["All", "SD 1.5", "SD 1.5 LCM", "SD 2.1", "SDXL 0.9", "SDXL 1.0", "SDXL 1.0 LCM", "SDXL Turbo", "Other"];
[
"All",
"SD 1.5",
"SD 1.5 LCM",
"SD 2.1",
"SDXL 0.9",
"SDXL 1.0",
"SDXL 1.0 LCM",
"SDXL Turbo",
"Other"
];
public CivitAiBrowserViewModel(
ICivitApi civitApi,
@ -189,7 +201,11 @@ public partial class CivitAiBrowserViewModel : TabViewModelBase
ShowNsfw = settingsManager.Settings.ModelBrowserNsfwEnabled;
settingsManager.RelayPropertyFor(this, model => model.ShowNsfw, settings => settings.ModelBrowserNsfwEnabled);
settingsManager.RelayPropertyFor(
this,
model => model.ShowNsfw,
settings => settings.ModelBrowserNsfwEnabled
);
}
/// <summary>
@ -238,7 +254,10 @@ public partial class CivitAiBrowserViewModel : TabViewModelBase
}
// Filter out unknown model types and archived/taken-down models
models = models.Where(m => m.Type.ConvertTo<SharedFolderType>() > 0).Where(m => m.Mode == null).ToList();
models = models
.Where(m => m.Type.ConvertTo<SharedFolderType>() > 0)
.Where(m => m.Mode == null)
.ToList();
// Database update calls will invoke `OnModelsUpdated`
// Add to database
@ -451,8 +470,7 @@ public partial class CivitAiBrowserViewModel : TabViewModelBase
try
{
cachedQuery = await liteDbContext
.CivitModelQueryCache
.IncludeAll()
.CivitModelQueryCache.IncludeAll()
.FindByIdAsync(ObjectHash.GetMd5Guid(modelRequest));
}
catch (Exception e)
@ -556,7 +574,12 @@ public partial class CivitAiBrowserViewModel : TabViewModelBase
TrySearchAgain().SafeFireAndForget();
settingsManager.Transaction(
s =>
s.ModelSearchOptions = new ModelSearchOptions(value, SortMode, SelectedModelType, SelectedBaseModelType)
s.ModelSearchOptions = new ModelSearchOptions(
value,
SortMode,
SelectedModelType,
SelectedBaseModelType
)
);
}
@ -578,7 +601,13 @@ public partial class CivitAiBrowserViewModel : TabViewModelBase
{
TrySearchAgain().SafeFireAndForget();
settingsManager.Transaction(
s => s.ModelSearchOptions = new ModelSearchOptions(SelectedPeriod, SortMode, value, SelectedBaseModelType)
s =>
s.ModelSearchOptions = new ModelSearchOptions(
SelectedPeriod,
SortMode,
value,
SelectedBaseModelType
)
);
}
@ -586,7 +615,13 @@ public partial class CivitAiBrowserViewModel : TabViewModelBase
{
TrySearchAgain().SafeFireAndForget();
settingsManager.Transaction(
s => s.ModelSearchOptions = new ModelSearchOptions(SelectedPeriod, SortMode, SelectedModelType, value)
s =>
s.ModelSearchOptions = new ModelSearchOptions(
SelectedPeriod,
SortMode,
SelectedModelType,
value
)
);
}

14
StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectDataDirectoryViewModel.cs

@ -24,13 +24,19 @@ namespace StabilityMatrix.Avalonia.ViewModels.Dialogs;
public partial class SelectDataDirectoryViewModel : ContentDialogViewModelBase
{
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public static string DefaultInstallLocation => Compat.AppDataHome;
public static string DefaultInstallLocation =>
Compat.IsLinux
? Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"StabilityMatrix"
)
: Compat.AppDataHome;
private readonly ISettingsManager settingsManager;
private const string ValidExistingDirectoryText = "Valid existing data directory found";
private const string InvalidDirectoryText =
"Directory must be empty or have a valid settings.json file";
private const string InvalidDirectoryText = "Directory must be empty or have a valid settings.json file";
private const string NotEnoughFreeSpaceText = "Not enough free space on the selected drive";
private const string FatWarningText = "FAT32 / exFAT drives are not supported at this time";
@ -38,7 +44,7 @@ public partial class SelectDataDirectoryViewModel : ContentDialogViewModelBase
private string dataDirectory = DefaultInstallLocation;
[ObservableProperty]
private bool isPortableMode;
private bool isPortableMode = Compat.IsLinux;
[ObservableProperty]
private string directoryStatusText = string.Empty;

28
StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs

@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using Avalonia.Media.Imaging;
using Avalonia.Threading;
@ -11,7 +10,6 @@ using StabilityMatrix.Avalonia.Models;
using StabilityMatrix.Avalonia.ViewModels.Base;
using StabilityMatrix.Core.Attributes;
using StabilityMatrix.Core.Helper;
using StabilityMatrix.Core.Models.FileInterfaces;
using StabilityMatrix.Core.Services;
namespace StabilityMatrix.Avalonia.ViewModels.Dialogs;
@ -90,15 +88,13 @@ public partial class SelectModelVersionViewModel : ContentDialogViewModelBase
CanGoToNextImage = allImages.Count > 1;
}
Dispatcher
.UIThread
.Post(() =>
{
CanGoToPreviousImage = false;
SelectedFile = SelectedVersionViewModel?.CivitFileViewModels.FirstOrDefault();
ImageUrls = new ObservableCollection<ImageSource>(allImages);
SelectedImageIndex = 0;
});
Dispatcher.UIThread.Post(() =>
{
CanGoToPreviousImage = false;
SelectedFile = SelectedVersionViewModel?.CivitFileViewModels.FirstOrDefault();
ImageUrls = new ObservableCollection<ImageSource>(allImages);
SelectedImageIndex = 0;
});
}
partial void OnSelectedFileChanged(CivitFileViewModel? value)
@ -107,10 +103,16 @@ public partial class SelectModelVersionViewModel : ContentDialogViewModelBase
if (settingsManager.IsLibraryDirSet)
{
var fileSizeBytes = value?.CivitFile.SizeKb * 1024;
var freeSizeBytes = SystemInfo.GetDiskFreeSpaceBytes(settingsManager.ModelsDirectory);
var freeSizeBytes =
SystemInfo.GetDiskFreeSpaceBytes(settingsManager.ModelsDirectory) ?? long.MaxValue;
canImport = fileSizeBytes < freeSizeBytes;
ImportTooltip = canImport
? $"Free space after download: {Size.FormatBytes(Convert.ToUInt64(freeSizeBytes - fileSizeBytes))}"
? "Free space after download: "
+ (
freeSizeBytes < long.MaxValue
? Size.FormatBytes(Convert.ToUInt64(freeSizeBytes - fileSizeBytes))
: "Unknown"
)
: $"Not enough space on disk. Need {Size.FormatBytes(Convert.ToUInt64(fileSizeBytes))} but only have {Size.FormatBytes(Convert.ToUInt64(freeSizeBytes))}";
}
else

43
StabilityMatrix.Avalonia/ViewModels/Inference/InferenceTextToImageViewModel.cs

@ -114,6 +114,14 @@ public class InferenceTextToImageViewModel : InferenceGenerationViewModelBase, I
SamplerCardViewModel.IsRefinerStepsEnabled =
e.Sender is { IsRefinerSelectionEnabled: true, SelectedRefiner: not null };
});
SamplerCardViewModel
.WhenPropertyChanged(x => x.SelectedScheduler)
.Subscribe(e =>
{
e.Sender.IsDenoiseStrengthEnabled =
e.Sender.SelectedScheduler?.DisplayName.Equals("SD Turbo") ?? false;
});
}
/// <inheritdoc />
@ -162,18 +170,21 @@ public class InferenceTextToImageViewModel : InferenceGenerationViewModelBase, I
protected override IEnumerable<ImageSource> GetInputImages()
{
var samplerImages = SamplerCardViewModel
.ModulesCardViewModel
.Cards
.OfType<IInputImageProvider>()
.ModulesCardViewModel.Cards.OfType<IInputImageProvider>()
.SelectMany(m => m.GetInputImages());
var moduleImages = ModulesCardViewModel.Cards.OfType<IInputImageProvider>().SelectMany(m => m.GetInputImages());
var moduleImages = ModulesCardViewModel
.Cards.OfType<IInputImageProvider>()
.SelectMany(m => m.GetInputImages());
return samplerImages.Concat(moduleImages);
}
/// <inheritdoc />
protected override async Task GenerateImageImpl(GenerateOverrides overrides, CancellationToken cancellationToken)
protected override async Task GenerateImageImpl(
GenerateOverrides overrides,
CancellationToken cancellationToken
)
{
// Validate the prompts
if (!await PromptCardViewModel.ValidatePrompts())
@ -267,12 +278,16 @@ public class InferenceTextToImageViewModel : InferenceGenerationViewModelBase, I
if (state.TryGetPropertyValue("HiresSampler", out var hiresSamplerState))
{
module.GetCard<SamplerCardViewModel>().LoadStateFromJsonObject(hiresSamplerState!.AsObject());
module
.GetCard<SamplerCardViewModel>()
.LoadStateFromJsonObject(hiresSamplerState!.AsObject());
}
if (state.TryGetPropertyValue("HiresUpscaler", out var hiresUpscalerState))
{
module.GetCard<UpscalerCardViewModel>().LoadStateFromJsonObject(hiresUpscalerState!.AsObject());
module
.GetCard<UpscalerCardViewModel>()
.LoadStateFromJsonObject(hiresUpscalerState!.AsObject());
}
});
@ -282,17 +297,17 @@ public class InferenceTextToImageViewModel : InferenceGenerationViewModelBase, I
if (state.TryGetPropertyValue("Upscaler", out var upscalerState))
{
module.GetCard<UpscalerCardViewModel>().LoadStateFromJsonObject(upscalerState!.AsObject());
module
.GetCard<UpscalerCardViewModel>()
.LoadStateFromJsonObject(upscalerState!.AsObject());
}
});
// Add FreeU to sampler
SamplerCardViewModel
.ModulesCardViewModel
.AddModule<FreeUModule>(module =>
{
module.IsEnabled = state.GetPropertyValueOrDefault<bool>("IsFreeUEnabled");
});
SamplerCardViewModel.ModulesCardViewModel.AddModule<FreeUModule>(module =>
{
module.IsEnabled = state.GetPropertyValueOrDefault<bool>("IsFreeUEnabled");
});
}
base.LoadStateFromJsonObject(state);

24
StabilityMatrix.Avalonia/ViewModels/Inference/SamplerCardViewModel.cs

@ -87,7 +87,10 @@ public partial class SamplerCardViewModel : LoadableViewModelBase, IParametersLo
private int TotalSteps => Steps + RefinerSteps;
public SamplerCardViewModel(IInferenceClientManager clientManager, ServiceManager<ViewModelBase> vmFactory)
public SamplerCardViewModel(
IInferenceClientManager clientManager,
ServiceManager<ViewModelBase> vmFactory
)
{
ClientManager = clientManager;
ModulesCardViewModel = vmFactory.Get<StackEditableCardViewModel>(modulesCard =>
@ -101,7 +104,10 @@ public partial class SamplerCardViewModel : LoadableViewModelBase, IParametersLo
public void ApplyStep(ModuleApplyStepEventArgs e)
{
// Resample the current primary if size does not match the selected size
if (e.Builder.Connections.PrimarySize.Width != Width || e.Builder.Connections.PrimarySize.Height != Height)
if (
e.Builder.Connections.PrimarySize.Width != Width
|| e.Builder.Connections.PrimarySize.Height != Height
)
{
e.Builder.Connections.Primary = e.Builder.Group_Upscale(
e.Nodes.GetUniqueName("Sampler_ScalePrimary"),
@ -147,7 +153,8 @@ public partial class SamplerCardViewModel : LoadableViewModelBase, IParametersLo
var primaryLatent = e.Builder.GetPrimaryAsLatent();
// Set primary sampler and scheduler
e.Builder.Connections.PrimarySampler = SelectedSampler ?? throw new ValidationException("Sampler not selected");
e.Builder.Connections.PrimarySampler =
SelectedSampler ?? throw new ValidationException("Sampler not selected");
e.Builder.Connections.PrimaryScheduler =
SelectedScheduler ?? throw new ValidationException("Scheduler not selected");
@ -173,7 +180,8 @@ public partial class SamplerCardViewModel : LoadableViewModelBase, IParametersLo
{
Name = "SDTurboScheduler",
Model = e.Builder.Connections.BaseModel ?? throw new ArgumentException("No BaseModel"),
Steps = Steps
Steps = Steps,
Denoise = DenoiseStrength
}
);
@ -249,7 +257,8 @@ public partial class SamplerCardViewModel : LoadableViewModelBase, IParametersLo
new ComfyNodeBuilder.KSamplerAdvanced
{
Name = "Refiner_Sampler",
Model = e.Builder.Connections.RefinerModel ?? throw new ArgumentException("No RefinerModel"),
Model =
e.Builder.Connections.RefinerModel ?? throw new ArgumentException("No RefinerModel"),
AddNoise = false,
NoiseSeed = e.Builder.Connections.Seed,
Steps = TotalSteps,
@ -295,7 +304,10 @@ public partial class SamplerCardViewModel : LoadableViewModelBase, IParametersLo
if (
!string.IsNullOrEmpty(parameters.Sampler)
&& GenerationParametersConverter.TryGetSamplerScheduler(parameters.Sampler, out var samplerScheduler)
&& GenerationParametersConverter.TryGetSamplerScheduler(
parameters.Sampler,
out var samplerScheduler
)
)
{
SelectedSampler = ClientManager.Samplers.FirstOrDefault(s => s == samplerScheduler.Sampler);

43
StabilityMatrix.Core/Models/Api/Comfy/Nodes/ComfyNodeBuilder.cs

@ -110,6 +110,9 @@ public class ComfyNodeBuilder
[Range(1, 10)]
public required int Steps { get; init; }
[Range(0, 1.0)]
public required double Denoise { get; init; }
}
public record EmptyLatentImage : ComfyTypedNodeBase<LatentNodeConnection>
@ -147,7 +150,11 @@ public class ComfyNodeBuilder
return new NamedComfyNode<ImageNodeConnection>(name)
{
ClassType = "ImageUpscaleWithModel",
Inputs = new Dictionary<string, object?> { ["upscale_model"] = upscaleModel.Data, ["image"] = image.Data }
Inputs = new Dictionary<string, object?>
{
["upscale_model"] = upscaleModel.Data,
["image"] = image.Data
}
};
}
@ -272,7 +279,8 @@ public class ComfyNodeBuilder
public required string ControlNetName { get; init; }
}
public record ControlNetApplyAdvanced : ComfyTypedNodeBase<ConditioningNodeConnection, ConditioningNodeConnection>
public record ControlNetApplyAdvanced
: ComfyTypedNodeBase<ConditioningNodeConnection, ConditioningNodeConnection>
{
public required ConditioningNodeConnection Positive { get; init; }
public required ConditioningNodeConnection Negative { get; init; }
@ -365,7 +373,9 @@ public class ComfyNodeBuilder
.Output,
image =>
Nodes
.AddNamedNode(ImageScale($"{name}_ImageUpscale", image, upscaleInfo.Name, height, width, false))
.AddNamedNode(
ImageScale($"{name}_ImageUpscale", image, upscaleInfo.Name, height, width, false)
)
.Output
);
}
@ -376,7 +386,11 @@ public class ComfyNodeBuilder
var samplerImage = GetPrimaryAsImage(primary, vae);
// Do group upscale
var modelUpscaler = Group_UpscaleWithModel($"{name}_ModelUpscale", upscaleInfo.Name, samplerImage);
var modelUpscaler = Group_UpscaleWithModel(
$"{name}_ModelUpscale",
upscaleInfo.Name,
samplerImage
);
// Since the model upscale is fixed to model (2x/4x), scale it again to the requested size
var resizedScaled = Nodes.AddNamedNode(
@ -432,7 +446,11 @@ public class ComfyNodeBuilder
);
// Do group upscale
var modelUpscaler = Group_UpscaleWithModel($"{name}_ModelUpscale", upscaleInfo.Name, samplerImage.Output);
var modelUpscaler = Group_UpscaleWithModel(
$"{name}_ModelUpscale",
upscaleInfo.Name,
samplerImage.Output
);
// Since the model upscale is fixed to model (2x/4x), scale it again to the requested size
var resizedScaled = Nodes.AddNamedNode(
@ -506,7 +524,11 @@ public class ComfyNodeBuilder
);
// Do group upscale
var modelUpscaler = Group_UpscaleWithModel($"{name}_ModelUpscale", upscaleInfo.Name, samplerImage.Output);
var modelUpscaler = Group_UpscaleWithModel(
$"{name}_ModelUpscale",
upscaleInfo.Name,
samplerImage.Output
);
// Since the model upscale is fixed to model (2x/4x), scale it again to the requested size
var resizedScaled = Nodes.AddNamedNode(
@ -706,7 +728,10 @@ public class ComfyNodeBuilder
return Connections.Primary.AsT1;
}
return GetPrimaryAsImage(Connections.Primary ?? throw new NullReferenceException("No primary connection"), vae);
return GetPrimaryAsImage(
Connections.Primary ?? throw new NullReferenceException("No primary connection"),
vae
);
}
/// <summary>
@ -756,7 +781,9 @@ public class ComfyNodeBuilder
public ConditioningNodeConnection GetRefinerOrBaseConditioning()
{
return RefinerConditioning ?? BaseConditioning ?? throw new NullReferenceException("No Conditioning");
return RefinerConditioning
?? BaseConditioning
?? throw new NullReferenceException("No Conditioning");
}
public ConditioningNodeConnection GetRefinerOrBaseNegativeConditioning()

23
StabilityMatrix.Core/Models/Packages/StableDiffusionDirectMl.cs

@ -5,6 +5,7 @@ using NLog;
using StabilityMatrix.Core.Attributes;
using StabilityMatrix.Core.Helper;
using StabilityMatrix.Core.Helper.Cache;
using StabilityMatrix.Core.Helper.HardwareInfo;
using StabilityMatrix.Core.Models.FileInterfaces;
using StabilityMatrix.Core.Models.Progress;
using StabilityMatrix.Core.Processes;
@ -36,6 +37,8 @@ public class StableDiffusionDirectMl(
public override SharedFolderMethod RecommendedSharedFolderMethod => SharedFolderMethod.Symlink;
public override TorchVersion GetRecommendedTorchVersion() => TorchVersion.DirectMl;
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Recommended;
public override IEnumerable<TorchVersion> AvailableTorchVersions =>
@ -43,6 +46,26 @@ public class StableDiffusionDirectMl(
public override bool ShouldIgnoreReleases => true;
public override List<LaunchOptionDefinition> LaunchOptions
{
get
{
var baseLaunchOptions = base.LaunchOptions;
baseLaunchOptions.Insert(
0,
new LaunchOptionDefinition
{
Name = "Use DirectML",
Type = LaunchOptionType.Bool,
InitialValue = HardwareHelper.PreferDirectML(),
Options = ["--use-directml"]
}
);
return baseLaunchOptions;
}
}
public override async Task InstallPackage(
string installLocation,
TorchVersion torchVersion,

Loading…
Cancel
Save