-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathComfyApi.cs
98 lines (73 loc) · 2.3 KB
/
ComfyApi.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
namespace AiServer.ServiceModel.Types;
public class ComfyHostedFileOutput
{
public string Url { get; set; }
public string FileName { get; set; }
}
public class AiServerHostedComfyFile
{
public string Url { get; set; }
public string FileName { get; set; }
public string ContentType { get; set; }
}
public class ComfyWorkflowRequest
{
public string? Model { get; set; }
public int? Steps { get; set; }
public int BatchSize { get; set; }
public int? Seed { get; set; }
public string? PositivePrompt { get; set; }
public string? NegativePrompt { get; set; }
public ComfyFileInput? Image { get; set; }
public ComfyFileInput? Audio { get; set; }
public ComfyFileInput? Mask { get; set; }
public Stream? ImageInput { get; set; }
public Stream? AudioInput { get; set; }
public Stream? MaskInput { get; set; }
public ComfySampler? Sampler { get; set; }
public string? Scheduler { get; set; } = "normal";
public double? CfgScale { get; set; }
public double? Denoise { get; set; }
public string? UpscaleModel { get; set; } = "RealESRGAN_x2.pth";
public int? Width { get; set; }
public int? Height { get; set; }
public ComfyTaskType TaskType { get; set; }
public string? Clip { get; set; }
public string? Vae { get; set; }
public double? SampleLength { get; set; }
public ComfyMaskSource MaskChannel { get; set; }
}
public class ComfyApiModel
{
public string? Description { get; set; }
public string? Tags { get; set; }
public string Filename { get; set; }
public string DownloadUrl { get; set; }
public string IconUrl { get; set; }
public string Url { get; set; }
}
public class ComfyApiModelSettings
{
public double? CfgScale { get; set; }
public string? Scheduler { get; set; }
public ComfySampler? Sampler { get; set; }
public int? Width { get; set; }
public int? Height { get; set; }
public int? Steps { get; set; }
public string? NegativePrompt { get; set; }
}
[EnumAsInt]
public enum ComfyTaskType
{
TextToImage = 1,
ImageToImage = 2,
ImageUpscale = 3,
ImageWithMask = 4,
ImageToText = 5,
TextToAudio = 6,
TextToSpeech = 7,
SpeechToText = 8,
}