-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcomfy-basic-nodes.ts
129 lines (97 loc) · 2.3 KB
/
comfy-basic-nodes.ts
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import { ComfyNode } from './comfy-graph.ts'
export class ComfyKSamplerNode extends ComfyNode {
classType: string = 'KSampler'
get seed() {
return this.getInput('seed')
}
get steps() {
return this.getInput('steps')
}
get cfg() {
return this.getInput('cfg')
}
get samplerName() {
return this.getInput('sampler_name')
}
get scheduler() {
return this.getInput('scheduler')
}
get denoise() {
return this.getInput('denoise')
}
get model() {
return this.getInput('model')
}
get positive() {
return this.getInput('positive')
}
get negative() {
return this.getInput('negative')
}
get latentImage() {
return this.getInput('latent_image')
}
get latent() {
return this.getOutputRef(0)
}
}
export class ComfyCheckpointLoaderSimpleNode extends ComfyNode {
classType: string = 'CheckpointLoaderSimple'
get checkpointName() {
return this.getInput('ckpt_name')
}
get model() {
return this.getOutputRef(0)
}
get clip() {
return this.getOutputRef(1)
}
get vae() {
return this.getOutputRef(2)
}
}
export class ComfyEmptyLatentImageNode extends ComfyNode {
classType: string = 'EmptyLatentImage'
get width() {
return this.getInput('width')
}
get height() {
return this.getInput('height')
}
get batchSize() {
return this.getInput('batch_size')
}
get latent() {
return this.getOutputRef(0)
}
}
export class ComfyClipTextEncodeNode extends ComfyNode {
classType: string = 'CLIPTextEncode'
get clip() {
return this.getInput('clip')
}
get text() {
return this.getInput('text')
}
get conditioning() {
return this.getOutputRef(0)
}
}
export class ComfyVaeDecodeNode extends ComfyNode {
classType: string = 'VAEDecode'
get samples() {
return this.getInput('samples')
}
get vae() {
return this.getInput('vae')
}
get image() {
return this.getOutputRef(0)
}
}
export class ComfySaveImageWebsocketNode extends ComfyNode {
classType: string = 'SaveImageWebsocket'
get images() {
return this.getInput('images')
}
}