You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.7 KiB
58 lines
1.7 KiB
1 year ago
|
using System;
|
||
|
using StabilityMatrix.Avalonia.Services;
|
||
|
using StabilityMatrix.Avalonia.ViewModels.Base;
|
||
|
using StabilityMatrix.Avalonia.ViewModels.Inference;
|
||
|
using StabilityMatrix.Core.Models.Base;
|
||
|
|
||
|
namespace StabilityMatrix.Avalonia.Models.Inference;
|
||
|
|
||
|
public record EditableModule : StringValue
|
||
|
{
|
||
|
public static readonly EditableModule FreeU =
|
||
|
new(
|
||
|
"FreeU",
|
||
|
builder =>
|
||
|
builder.Get<StackExpanderViewModel>(vm =>
|
||
|
{
|
||
|
vm.Title = "FreeU";
|
||
|
vm.AddCards(builder.Get<FreeUCardViewModel>());
|
||
|
})
|
||
|
);
|
||
|
|
||
|
public static readonly EditableModule HiresFix =
|
||
|
new(
|
||
|
"HiresFix",
|
||
|
builder =>
|
||
|
builder.Get<StackExpanderViewModel>(vm =>
|
||
|
{
|
||
|
vm.Title = "HiresFix";
|
||
|
vm.AddCards(
|
||
|
builder.Get<UpscalerCardViewModel>(),
|
||
|
builder.Get<SamplerCardViewModel>(vmSampler =>
|
||
|
{
|
||
|
vmSampler.IsDenoiseStrengthEnabled = true;
|
||
|
})
|
||
|
);
|
||
|
})
|
||
|
);
|
||
|
|
||
|
public static readonly EditableModule Upscaler =
|
||
|
new(
|
||
|
"Upscaler",
|
||
|
builder =>
|
||
|
builder.Get<StackExpanderViewModel>(vm =>
|
||
|
{
|
||
|
vm.Title = "Upscaler";
|
||
|
vm.AddCards(builder.Get<UpscalerCardViewModel>());
|
||
|
})
|
||
|
);
|
||
|
|
||
|
public Func<ServiceManager<ViewModelBase>, ViewModelBase> Build { get; }
|
||
|
|
||
|
private EditableModule(string value, Func<ServiceManager<ViewModelBase>, ViewModelBase> build)
|
||
|
: base(value)
|
||
|
{
|
||
|
Build = build;
|
||
|
}
|
||
|
}
|