using Refit; using StabilityMatrix.Core.Models.Api.Comfy; namespace StabilityMatrix.Core.Api; [Headers("User-Agent: StabilityMatrix")] public interface IComfyApi { [Post("/prompt")] Task PostPrompt( [Body] ComfyPromptRequest prompt, CancellationToken cancellationToken = default ); [Post("/interrupt")] Task PostInterrupt(CancellationToken cancellationToken = default); /// /// Upload an image to Comfy /// /// Image as StreamPart /// Whether to overwrite at destination /// One of "input", "temp", "output" /// Subfolder /// Cancellation Token [Multipart] [Post("/upload/image")] Task PostUploadImage( StreamPart image, string? overwrite = null, string? type = null, string? subfolder = null, CancellationToken cancellationToken = default ); [Get("/history/{promptId}")] Task> GetHistory( string promptId, CancellationToken cancellationToken = default ); [Get("/object_info/{nodeType}")] Task> GetObjectInfo( string nodeType, CancellationToken cancellationToken = default ); [Get("/view")] Task GetImage( string filename, string subfolder, string type, CancellationToken cancellationToken = default ); }