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.

61 lines
2.0 KiB

using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using DynamicData.Binding;
using StabilityMatrix.Avalonia.Models;
using StabilityMatrix.Core.Inference;
using StabilityMatrix.Core.Models;
using StabilityMatrix.Core.Models.Api.Comfy;
using StabilityMatrix.Core.Models.FileInterfaces;
namespace StabilityMatrix.Avalonia.Services;
public interface IInferenceClientManager : IDisposable, INotifyPropertyChanged, INotifyPropertyChanging
{
ComfyClient? Client { get; set; }
/// <summary>
/// Whether the client is connected
/// </summary>
[MemberNotNullWhen(true, nameof(Client))]
bool IsConnected { get; }
/// <summary>
/// Whether the client is connecting
/// </summary>
bool IsConnecting { get; }
/// <summary>
/// Whether the user can initiate a connection
/// </summary>
bool CanUserConnect { get; }
/// <summary>
/// Whether the user can initiate a disconnection
/// </summary>
bool CanUserDisconnect { get; }
IObservableCollection<HybridModelFile> Models { get; }
IObservableCollection<HybridModelFile> VaeModels { get; }
IObservableCollection<HybridModelFile> ControlNetModels { get; }
IObservableCollection<HybridModelFile> PromptExpansionModels { get; }
IObservableCollection<ComfySampler> Samplers { get; }
IObservableCollection<ComfyUpscaler> Upscalers { get; }
IObservableCollection<ComfyScheduler> Schedulers { get; }
IObservableCollection<ComfyAuxPreprocessor> Preprocessors { get; }
Task CopyImageToInputAsync(FilePath imageFile, CancellationToken cancellationToken = default);
Task UploadInputImageAsync(ImageSource image, CancellationToken cancellationToken = default);
Task WriteImageToInputAsync(ImageSource imageSource, CancellationToken cancellationToken = default);
Task ConnectAsync(CancellationToken cancellationToken = default);
Task ConnectAsync(PackagePair packagePair, CancellationToken cancellationToken = default);
Task CloseAsync();
}