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.
 
 
 

18 lines
647 B

using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel;
using StabilityMatrix.Core.Models.Api;
namespace StabilityMatrix.Avalonia.ViewModels.Dialogs;
public partial class CivitFileViewModel : ObservableObject
{
[ObservableProperty] private CivitFile civitFile;
[ObservableProperty] private bool isInstalled;
public CivitFileViewModel(HashSet<string> installedModelHashes, CivitFile civitFile)
{
CivitFile = civitFile;
IsInstalled = CivitFile is {Type: CivitFileType.Model, Hashes.BLAKE3: not null} &&
installedModelHashes.Contains(CivitFile.Hashes.BLAKE3);
}
}