Multi-Platform Package Manager for Stable Diffusion
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.
 
 
 

20 lines
737 B

using CommunityToolkit.Mvvm.ComponentModel;
using StabilityMatrix.Core.Models.Api;
using StabilityMatrix.Core.Services;
namespace StabilityMatrix.Avalonia.ViewModels.Dialogs;
public partial class CivitFileViewModel : ObservableObject
{
[ObservableProperty] private CivitFile civitFile;
[ObservableProperty] private bool isInstalled;
public CivitFileViewModel(ISettingsManager settingsManager, CivitFile civitFile)
{
CivitFile = civitFile;
var installedModelHashes = settingsManager.Settings.InstalledModelHashes;
IsInstalled = CivitFile is {Type: CivitFileType.Model, Hashes.BLAKE3: not null} &&
installedModelHashes.Contains(CivitFile.Hashes.BLAKE3);
}
}