From 73613bb36b7f18f9dd322aafc12dedadb3e5d014 Mon Sep 17 00:00:00 2001 From: Ionite Date: Sat, 27 May 2023 03:22:29 -0400 Subject: [PATCH] Add Progress api models --- StabilityMatrix/Models/Api/ProgressRequest.cs | 9 +++++++ .../Models/Api/ProgressResponse.cs | 24 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 StabilityMatrix/Models/Api/ProgressRequest.cs create mode 100644 StabilityMatrix/Models/Api/ProgressResponse.cs diff --git a/StabilityMatrix/Models/Api/ProgressRequest.cs b/StabilityMatrix/Models/Api/ProgressRequest.cs new file mode 100644 index 00000000..e24eba05 --- /dev/null +++ b/StabilityMatrix/Models/Api/ProgressRequest.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace StabilityMatrix.Models.Api; + +public class ProgressRequest +{ + [JsonPropertyName("skip_current_image")] + public bool? SkipCurrentImage { get; set; } +} diff --git a/StabilityMatrix/Models/Api/ProgressResponse.cs b/StabilityMatrix/Models/Api/ProgressResponse.cs new file mode 100644 index 00000000..2f0e1a7c --- /dev/null +++ b/StabilityMatrix/Models/Api/ProgressResponse.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; + +namespace StabilityMatrix.Models.Api; + +public class ProgressResponse +{ + // Range from 0 to 1 + [JsonPropertyName("progress")] + public float Progress { get; set; } + + // ETA in seconds + [JsonPropertyName("eta_relative")] + public float EtaRelative { get; set; } + + // state: dict + + // The current image in base64 format. opts.show_progress_every_n_steps is required for this to work + [JsonPropertyName("current_image")] + public string? CurrentImage { get; set; } + + [JsonPropertyName("textinfo")] + public string? TextInfo { get; set; } + +}