comfy-ts 2.17.1 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +3 -3
- package/dist/index.cjs +944 -165
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1154 -408
- package/dist/index.d.ts +1154 -408
- package/dist/index.js +944 -165
- package/dist/index.js.map +1 -1
- package/dist/{run-run-tg82jUIk.js → run-run-Wn7H72Zg.js} +2 -2
- package/dist/{run-run-tg82jUIk.js.map → run-run-Wn7H72Zg.js.map} +1 -1
- package/dist/{run-tui-Bw7BA75d.js → run-tui-VWSj1D_j.js} +2 -2
- package/dist/{run-tui-Bw7BA75d.js.map → run-tui-VWSj1D_j.js.map} +1 -1
- package/dist/serve-web.js +47 -47
- package/dist/{state-zTow5ucI.js → state-DgwWhZWb.js} +945 -166
- package/dist/state-DgwWhZWb.js.map +1 -0
- package/dist/web.d.ts +1172 -426
- package/dist/web.js +944 -165
- package/dist/web.js.map +1 -1
- package/examples/comfy-cloud/ace-step15-t2a.cflow.ts +163 -0
- package/examples/comfy-cloud/anima-t2i-base.cflow.ts +57 -0
- package/examples/comfy-cloud/boogu-t2i.cflow.ts +55 -0
- package/examples/comfy-cloud/chronoedit-i2i.cflow.ts +95 -0
- package/examples/comfy-cloud/ernie-t2i-base.cflow.ts +81 -0
- package/examples/comfy-cloud/flux1-t2i-krea.cflow.ts +63 -0
- package/examples/comfy-cloud/flux2-i2i-dev.cflow.ts +83 -0
- package/examples/comfy-cloud/flux2-t2i-dev.cflow.ts +60 -0
- package/examples/comfy-cloud/hidream-o1-i2i.cflow.ts +71 -0
- package/examples/comfy-cloud/hidream-o1-t2i.cflow.ts +62 -0
- package/examples/comfy-cloud/krea2-i2i.cflow.ts +78 -0
- package/examples/comfy-cloud/ltx2-i2v.cflow.ts +175 -0
- package/examples/comfy-cloud/ltx2-t2v.cflow.ts +143 -0
- package/examples/comfy-cloud/ltx23-i2v.cflow.ts +189 -0
- package/examples/comfy-cloud/ltx23-t2v.cflow.ts +151 -0
- package/examples/comfy-cloud/mage-flow-i2i-turbo.cflow.ts +72 -0
- package/examples/comfy-cloud/mage-flow-i2i.cflow.ts +74 -0
- package/examples/comfy-cloud/mage-flow-t2i-turbo.cflow.ts +60 -0
- package/examples/comfy-cloud/mage-flow-t2i.cflow.ts +60 -0
- package/examples/comfy-cloud/minimax-h3-t2i.cflow.ts +64 -0
- package/examples/comfy-cloud/netayume-t2i.cflow.ts +60 -0
- package/examples/comfy-cloud/qwen-image-i2i-2509.cflow.ts +75 -0
- package/examples/comfy-cloud/qwen-image-t2i-2512.cflow.ts +63 -0
- package/examples/comfy-cloud/sdk.d.ts +21683 -13737
- package/examples/comfy-cloud/stable-audio3-t2a.cflow.ts +96 -0
- package/examples/comfy-cloud/z-image-t2i-base.cflow.ts +54 -0
- package/examples/rvion/04-krea2-turbo-t2i.cflow.ts +1 -1
- package/package.json +2 -2
- package/src/graph/ComfyNode.ts +93 -12
- package/src/host/ComfyHost.ts +31 -10
- package/src/host/ComfyManager.ts +448 -62
- package/src/litegraph/CanonicalWorkflow.ts +3 -0
- package/src/litegraph/LiteGraphJSON.ts +2 -2
- package/src/litegraph/LiteGraphNodeInput.ts +2 -2
- package/src/litegraph/LiteGraphNodeOutput.ts +2 -2
- package/src/litegraph/convertFlowToLiteGraphJSON.ts +112 -37
- package/src/litegraph/expandSubgraphs.ts +14 -0
- package/src/litegraph/normalizeWorkflow.ts +1 -0
- package/src/manager/ComfyRegistry.ts +2 -0
- package/src/manager/generated/KnownComfyCustomNodeName.ts +6354 -1680
- package/src/manager/generated/KnownComfyPluginTitle.ts +718 -356
- package/src/manager/generated/KnownComfyPluginURL.ts +357 -181
- package/src/manager/generated/KnownModel_Base.ts +9 -5
- package/src/manager/generated/KnownModel_FileName.ts +135 -0
- package/src/manager/generated/KnownModel_Name.ts +135 -0
- package/src/manager/generated/KnownModel_SavePath.ts +16 -14
- package/src/manager/generated/KnownModel_Type.ts +15 -13
- package/src/manager/installedView.ts +176 -0
- package/src/manager/json/custom-node-list.json +4018 -2248
- package/src/manager/json/extension-node-map.json +8903 -2964
- package/src/manager/json/github-stats.json +10796 -10036
- package/src/manager/json/model-list.json +298 -1
- package/src/manager/loaders/step4_model-list-loader.ts +1 -0
- package/src/manager/types/ComfyManagerAPIModelList.ts +3 -0
- package/src/manager/types/ComfyManagerAPIPluginList.ts +19 -0
- package/src/runner/ComfyExecution.ts +4 -1
- package/src/runner/ComfyWsApi.ts +82 -15
- package/src/sdk-generator/ComfySchema.ts +10 -1
- package/src/sdk-generator/ComfyUIObjectInfoTypes.ts +4 -1
- package/src/sdk-generator/comfyui-sdk-codegen.ts +61 -20
- package/src/sdk-generator/inputWidgetKind.ts +19 -4
- package/src/sdk-generator/litegraphToApiRequestPayload.ts +141 -33
- package/dist/state-zTow5ucI.js.map +0 -1
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
// ltx23 i2v on Comfy Cloud — LTX-2.3 22b dev fp8 + its distilled lora, image to video WITH a generated soundtrack, two passes at cfg 1
|
|
2
|
+
// source template: video_ltx2_3_i2v.json (official workflow-templates)
|
|
3
|
+
// needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
|
|
4
|
+
// note: video outputs PERSIST on the host (upstream ships no websocket saver for video — image examples stream ephemerally)
|
|
5
|
+
// run directly: bun examples/comfy-cloud/ltx23-i2v.cflow.ts [path/to/image.png] ["prompt"]
|
|
6
|
+
import { asAbsolutePath, exampleImagePath, MediaImage, v } from 'comfy-ts'
|
|
7
|
+
import { cloudHost, requireCloudKey } from './cloudHost.ts'
|
|
8
|
+
|
|
9
|
+
const host = await cloudHost()
|
|
10
|
+
|
|
11
|
+
// bundled default input (examples/images/, ships in the tarball) — the TUI picker or argv[2] swap it
|
|
12
|
+
const image = v.image(exampleImagePath('walrus_1344x768.jpg'))
|
|
13
|
+
|
|
14
|
+
const CKPT = 'ltx-2.3-22b-dev-fp8.safetensors'
|
|
15
|
+
|
|
16
|
+
export const ltx23I2v = host.defineWorkflow({
|
|
17
|
+
id: 'ltx23-i2v',
|
|
18
|
+
vars: {
|
|
19
|
+
image,
|
|
20
|
+
// ONE prompt var: `- ` lines are the NEGATIVE prompt, `//` lines are comments
|
|
21
|
+
prompt: v.prompt(
|
|
22
|
+
'The walrus lies on the rocks as the camera performs a single, smooth push-in, from a wide shot of the shore to a medium close frame, then holds. It lifts its head, shakes the water off its whiskers and lets out a deep, rumbling bellow. Waves break behind it, spray drifts in the wind, gulls call overhead. No pull-back; the only camera move is the continuous push-in.\n- pc game, console game, video game, cartoon, childish, ugly',
|
|
23
|
+
),
|
|
24
|
+
seed: v.seed(42),
|
|
25
|
+
// on: the text encoder itself (gemma 3, abliterated lora) first rewrites the prompt into a detailed shot description
|
|
26
|
+
enhance: v.toggle(false, 'enhance prompt'),
|
|
27
|
+
// the OUTPUT size: the start image is cropped to it, the first pass samples at half of it
|
|
28
|
+
size: v.size({ width: 1280, height: 720 }),
|
|
29
|
+
// 8n + 1 frames; another count snaps to the closest valid one
|
|
30
|
+
length: v.int(121, { min: 9, max: 481 }),
|
|
31
|
+
fps: v.int(25, { min: 1, max: 60 }),
|
|
32
|
+
},
|
|
33
|
+
// async build: the input image is uploaded (hash-named, deduped) per run
|
|
34
|
+
build: async (b, vars, wf) => {
|
|
35
|
+
const img = new MediaImage({ path: asAbsolutePath(image.absPath()) })
|
|
36
|
+
const loaded = await img.loadInWorkflow_viaLoadImageNode(wf)
|
|
37
|
+
|
|
38
|
+
const ckpt = b.CheckpointLoaderSimple({ ckpt_name: CKPT })
|
|
39
|
+
const clip = b.LTXAVTextEncoderLoader({
|
|
40
|
+
text_encoder: 'gemma_3_12B_it_fp4_mixed.safetensors',
|
|
41
|
+
ckpt_name: CKPT,
|
|
42
|
+
device: 'default',
|
|
43
|
+
})
|
|
44
|
+
const audioVae = b.LTXVAudioVAELoader({ ckpt_name: CKPT })
|
|
45
|
+
// the dev model at half strength of the distilled lora: cfg 1 and short sigma schedules on both passes
|
|
46
|
+
const model = b.LoraLoaderModelOnly({
|
|
47
|
+
model: ckpt.outputs.MODEL,
|
|
48
|
+
lora_name: 'ltx_2.3_22b_distilled_1.1_lora_dynamic_fro09_avg_rank_111_bf16.safetensors',
|
|
49
|
+
strength_model: 0.5,
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
// the start image: center-cropped to the output size, longest side to 1536, then re-compressed the way ltx was trained on video frames
|
|
53
|
+
const start = b.LTXVPreprocess({
|
|
54
|
+
image: b.ImageScaleToMaxDimension({
|
|
55
|
+
image: b.ImageScale({
|
|
56
|
+
image: loaded,
|
|
57
|
+
upscale_method: 'lanczos',
|
|
58
|
+
width: vars.size.width,
|
|
59
|
+
height: vars.size.height,
|
|
60
|
+
crop: 'center',
|
|
61
|
+
}),
|
|
62
|
+
upscale_method: 'area',
|
|
63
|
+
largest_size: 1536,
|
|
64
|
+
}),
|
|
65
|
+
img_compression: 18,
|
|
66
|
+
}).outputs.output_image
|
|
67
|
+
|
|
68
|
+
const positiveText = vars.enhance
|
|
69
|
+
? b.TextGenerateLTX2Prompt({
|
|
70
|
+
clip: b.LoraLoader({
|
|
71
|
+
model,
|
|
72
|
+
clip,
|
|
73
|
+
lora_name: 'gemma-3-12b-it-abliterated_lora_rank64_bf16.safetensors',
|
|
74
|
+
strength_model: 1,
|
|
75
|
+
strength_clip: 1,
|
|
76
|
+
}).outputs.CLIP,
|
|
77
|
+
prompt: vars.prompt.positive,
|
|
78
|
+
max_length: 2048,
|
|
79
|
+
sampling_mode: 'on',
|
|
80
|
+
'sampling_mode.temperature': 0.7,
|
|
81
|
+
'sampling_mode.top_k': 64,
|
|
82
|
+
'sampling_mode.top_p': 0.95,
|
|
83
|
+
'sampling_mode.min_p': 0.05,
|
|
84
|
+
'sampling_mode.repetition_penalty': 1.05,
|
|
85
|
+
'sampling_mode.seed': 0,
|
|
86
|
+
thinking: false,
|
|
87
|
+
use_default_template: true,
|
|
88
|
+
mtp: 'auto',
|
|
89
|
+
}).outputs.generated_text
|
|
90
|
+
: vars.prompt.positive
|
|
91
|
+
const cond = b.LTXVConditioning({
|
|
92
|
+
positive: b.CLIPTextEncode({ clip, text: positiveText }),
|
|
93
|
+
negative: b.CLIPTextEncode({ clip, text: vars.prompt.negative }),
|
|
94
|
+
frame_rate: vars.fps,
|
|
95
|
+
})
|
|
96
|
+
const sampler = b.KSamplerSelect({ sampler_name: 'euler' })
|
|
97
|
+
const noise = b.RandomNoise({ noise_seed: vars.seed })
|
|
98
|
+
|
|
99
|
+
// pass 1: half resolution, the start image written into the first frame at strength 0.7
|
|
100
|
+
const base = b.SamplerCustomAdvanced({
|
|
101
|
+
noise,
|
|
102
|
+
guider: b.CFGGuider({ model, positive: cond.outputs.positive, negative: cond.outputs.negative, cfg: 1 }),
|
|
103
|
+
sampler,
|
|
104
|
+
sigmas: b.ManualSigmas({ sigmas: '1.0, 0.99375, 0.9875, 0.98125, 0.975, 0.909375, 0.725, 0.421875, 0.0' }),
|
|
105
|
+
latent_image: b.LTXVConcatAVLatent({
|
|
106
|
+
video_latent: b.LTXVImgToVideoInplace({
|
|
107
|
+
vae: ckpt.outputs.VAE,
|
|
108
|
+
image: start,
|
|
109
|
+
latent: b.EmptyLTXVLatentVideo({
|
|
110
|
+
width: Math.round(vars.size.width / 2),
|
|
111
|
+
height: Math.round(vars.size.height / 2),
|
|
112
|
+
length: vars.length,
|
|
113
|
+
batch_size: 1,
|
|
114
|
+
}),
|
|
115
|
+
strength: 0.7,
|
|
116
|
+
bypass: false,
|
|
117
|
+
}),
|
|
118
|
+
audio_latent: b.LTXVEmptyLatentAudio({
|
|
119
|
+
frames_number: vars.length,
|
|
120
|
+
frame_rate: vars.fps,
|
|
121
|
+
batch_size: 1,
|
|
122
|
+
audio_vae: audioVae,
|
|
123
|
+
}),
|
|
124
|
+
}),
|
|
125
|
+
})
|
|
126
|
+
const baseAv = b.LTXVSeparateAVLatent({ av_latent: base.outputs.output })
|
|
127
|
+
const cropped = b.LTXVCropGuides({
|
|
128
|
+
positive: cond.outputs.positive,
|
|
129
|
+
negative: cond.outputs.negative,
|
|
130
|
+
latent: baseAv.outputs.video_latent,
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
// pass 2: x2 latent upscale, the start image pinned again at full strength, then a short refine
|
|
134
|
+
const refined = b.SamplerCustomAdvanced({
|
|
135
|
+
noise,
|
|
136
|
+
guider: b.CFGGuider({ model, positive: cropped.outputs.positive, negative: cropped.outputs.negative, cfg: 1 }),
|
|
137
|
+
sampler,
|
|
138
|
+
sigmas: b.ManualSigmas({ sigmas: '0.85, 0.7250, 0.4219, 0.0' }),
|
|
139
|
+
latent_image: b.LTXVConcatAVLatent({
|
|
140
|
+
video_latent: b.LTXVImgToVideoInplace({
|
|
141
|
+
vae: ckpt.outputs.VAE,
|
|
142
|
+
image: start,
|
|
143
|
+
latent: b.LTXVLatentUpsampler({
|
|
144
|
+
samples: baseAv.outputs.video_latent,
|
|
145
|
+
upscale_model: b.LatentUpscaleModelLoader({
|
|
146
|
+
model_name: 'ltx-2.3-spatial-upscaler-x2-1.1.safetensors',
|
|
147
|
+
}),
|
|
148
|
+
vae: ckpt.outputs.VAE,
|
|
149
|
+
}),
|
|
150
|
+
strength: 1,
|
|
151
|
+
bypass: false,
|
|
152
|
+
}),
|
|
153
|
+
audio_latent: baseAv.outputs.audio_latent,
|
|
154
|
+
}),
|
|
155
|
+
})
|
|
156
|
+
const av = b.LTXVSeparateAVLatent({ av_latent: refined.outputs.output })
|
|
157
|
+
|
|
158
|
+
b.SaveVideo({
|
|
159
|
+
video: b.CreateVideo({
|
|
160
|
+
images: b.VAEDecodeTiled({
|
|
161
|
+
samples: av.outputs.video_latent,
|
|
162
|
+
vae: ckpt.outputs.VAE,
|
|
163
|
+
tile_size: 768,
|
|
164
|
+
overlap: 64,
|
|
165
|
+
temporal_size: 4096,
|
|
166
|
+
temporal_overlap: 4,
|
|
167
|
+
}),
|
|
168
|
+
audio: b.LTXVAudioVAEDecode({ samples: av.outputs.audio_latent, audio_vae: audioVae }),
|
|
169
|
+
fps: vars.fps,
|
|
170
|
+
}),
|
|
171
|
+
filename_prefix: 'comfy-ts-zoo/ltx23-i2v',
|
|
172
|
+
format: 'auto',
|
|
173
|
+
codec: 'auto',
|
|
174
|
+
})
|
|
175
|
+
},
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
export default ltx23I2v
|
|
179
|
+
|
|
180
|
+
// standalone run (skipped when another driver — e.g. the TUI — imports this module)
|
|
181
|
+
if (import.meta.main) {
|
|
182
|
+
requireCloudKey()
|
|
183
|
+
if (process.argv[2]) ltx23I2v.vars.image.set(process.argv[2])
|
|
184
|
+
if (process.argv[3]) ltx23I2v.vars.prompt.set(process.argv[3])
|
|
185
|
+
const execution = await ltx23I2v.run({ log: true })
|
|
186
|
+
// SaveVideo outputs land host side (no auto-download for video yet)
|
|
187
|
+
console.log(`🟢 ${execution.status}: video saved on the host under comfy-ts-zoo/ltx23-i2v`)
|
|
188
|
+
host.disconnect()
|
|
189
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// ltx23 t2v on Comfy Cloud — LTX-2.3 22b dev fp8 + its distilled lora, text to video WITH a generated soundtrack, two passes at cfg 1
|
|
2
|
+
// source template: video_ltx2_3_t2v.json (official workflow-templates)
|
|
3
|
+
// needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
|
|
4
|
+
// note: video outputs PERSIST on the host (upstream ships no websocket saver for video — image examples stream ephemerally)
|
|
5
|
+
// run directly: bun examples/comfy-cloud/ltx23-t2v.cflow.ts ["prompt"] [seed]
|
|
6
|
+
import { v } from 'comfy-ts'
|
|
7
|
+
import { cloudHost, requireCloudKey } from './cloudHost.ts'
|
|
8
|
+
|
|
9
|
+
const host = await cloudHost()
|
|
10
|
+
|
|
11
|
+
const CKPT = 'ltx-2.3-22b-dev-fp8.safetensors'
|
|
12
|
+
|
|
13
|
+
export const ltx23T2v = host.defineWorkflow({
|
|
14
|
+
id: 'ltx23-t2v',
|
|
15
|
+
vars: {
|
|
16
|
+
// ONE prompt var: `- ` lines are the NEGATIVE prompt, `//` lines are comments
|
|
17
|
+
prompt: v.prompt(
|
|
18
|
+
'Dynamic cinematic close-up of high-tech modular machinery self-assembling in midair, precision robotic parts, magnetic connectors, and glowing circuits clicking together, subtle smoke and light flares, extremely detailed titanium textures. The final product displays a clean, clear surface with large glowing engraved text "LTX-2.3" centered and unobstructed, dramatic lighting, photorealism, sharp focus.\n- pc game, console game, video game, cartoon, childish, ugly',
|
|
19
|
+
),
|
|
20
|
+
seed: v.seed(42),
|
|
21
|
+
// on: the text encoder itself (gemma 3, abliterated lora) first rewrites the prompt into a detailed shot description
|
|
22
|
+
enhance: v.toggle(true, 'enhance prompt'),
|
|
23
|
+
// the OUTPUT size: the first pass samples at half of it, the latent upscaler doubles it
|
|
24
|
+
size: v.size({ width: 1280, height: 720 }),
|
|
25
|
+
// 8n + 1 frames; another count snaps to the closest valid one
|
|
26
|
+
length: v.int(121, { min: 9, max: 481 }),
|
|
27
|
+
fps: v.int(25, { min: 1, max: 60 }),
|
|
28
|
+
},
|
|
29
|
+
build: (b, vars) => {
|
|
30
|
+
const ckpt = b.CheckpointLoaderSimple({ ckpt_name: CKPT })
|
|
31
|
+
const clip = b.LTXAVTextEncoderLoader({
|
|
32
|
+
text_encoder: 'gemma_3_12B_it_fp4_mixed.safetensors',
|
|
33
|
+
ckpt_name: CKPT,
|
|
34
|
+
device: 'default',
|
|
35
|
+
})
|
|
36
|
+
const audioVae = b.LTXVAudioVAELoader({ ckpt_name: CKPT })
|
|
37
|
+
// the dev model at half strength of the distilled lora: cfg 1 and short sigma schedules on both passes
|
|
38
|
+
const model = b.LoraLoaderModelOnly({
|
|
39
|
+
model: ckpt.outputs.MODEL,
|
|
40
|
+
lora_name: 'ltx_2.3_22b_distilled_1.1_lora_dynamic_fro09_avg_rank_111_bf16.safetensors',
|
|
41
|
+
strength_model: 0.5,
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const positiveText = vars.enhance
|
|
45
|
+
? b.TextGenerateLTX2Prompt({
|
|
46
|
+
clip: b.LoraLoader({
|
|
47
|
+
model,
|
|
48
|
+
clip,
|
|
49
|
+
lora_name: 'gemma-3-12b-it-abliterated_lora_rank64_bf16.safetensors',
|
|
50
|
+
strength_model: 1,
|
|
51
|
+
strength_clip: 1,
|
|
52
|
+
}).outputs.CLIP,
|
|
53
|
+
prompt: vars.prompt.positive,
|
|
54
|
+
max_length: 2048,
|
|
55
|
+
sampling_mode: 'on',
|
|
56
|
+
'sampling_mode.temperature': 0.7,
|
|
57
|
+
'sampling_mode.top_k': 64,
|
|
58
|
+
'sampling_mode.top_p': 0.95,
|
|
59
|
+
'sampling_mode.min_p': 0.05,
|
|
60
|
+
'sampling_mode.repetition_penalty': 1.05,
|
|
61
|
+
'sampling_mode.seed': 0,
|
|
62
|
+
thinking: false,
|
|
63
|
+
use_default_template: true,
|
|
64
|
+
mtp: 'auto',
|
|
65
|
+
}).outputs.generated_text
|
|
66
|
+
: vars.prompt.positive
|
|
67
|
+
const cond = b.LTXVConditioning({
|
|
68
|
+
positive: b.CLIPTextEncode({ clip, text: positiveText }),
|
|
69
|
+
negative: b.CLIPTextEncode({ clip, text: vars.prompt.negative }),
|
|
70
|
+
frame_rate: vars.fps,
|
|
71
|
+
})
|
|
72
|
+
const sampler = b.KSamplerSelect({ sampler_name: 'euler' })
|
|
73
|
+
const noise = b.RandomNoise({ noise_seed: vars.seed })
|
|
74
|
+
|
|
75
|
+
// pass 1: video + audio latents sampled together at half resolution
|
|
76
|
+
const base = b.SamplerCustomAdvanced({
|
|
77
|
+
noise,
|
|
78
|
+
guider: b.CFGGuider({ model, positive: cond.outputs.positive, negative: cond.outputs.negative, cfg: 1 }),
|
|
79
|
+
sampler,
|
|
80
|
+
sigmas: b.ManualSigmas({ sigmas: '1.0, 0.99375, 0.9875, 0.98125, 0.975, 0.909375, 0.725, 0.421875, 0.0' }),
|
|
81
|
+
latent_image: b.LTXVConcatAVLatent({
|
|
82
|
+
video_latent: b.EmptyLTXVLatentVideo({
|
|
83
|
+
width: Math.round(vars.size.width / 2),
|
|
84
|
+
height: Math.round(vars.size.height / 2),
|
|
85
|
+
length: vars.length,
|
|
86
|
+
batch_size: 1,
|
|
87
|
+
}),
|
|
88
|
+
audio_latent: b.LTXVEmptyLatentAudio({
|
|
89
|
+
frames_number: vars.length,
|
|
90
|
+
frame_rate: vars.fps,
|
|
91
|
+
batch_size: 1,
|
|
92
|
+
audio_vae: audioVae,
|
|
93
|
+
}),
|
|
94
|
+
}),
|
|
95
|
+
})
|
|
96
|
+
const baseAv = b.LTXVSeparateAVLatent({ av_latent: base.outputs.output })
|
|
97
|
+
const cropped = b.LTXVCropGuides({
|
|
98
|
+
positive: cond.outputs.positive,
|
|
99
|
+
negative: cond.outputs.negative,
|
|
100
|
+
latent: baseAv.outputs.video_latent,
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
// pass 2: x2 latent upscale of the video, then a short refine over the rejoined av latent
|
|
104
|
+
const refined = b.SamplerCustomAdvanced({
|
|
105
|
+
noise,
|
|
106
|
+
guider: b.CFGGuider({ model, positive: cropped.outputs.positive, negative: cropped.outputs.negative, cfg: 1 }),
|
|
107
|
+
sampler,
|
|
108
|
+
sigmas: b.ManualSigmas({ sigmas: '0.85, 0.7250, 0.4219, 0.0' }),
|
|
109
|
+
latent_image: b.LTXVConcatAVLatent({
|
|
110
|
+
video_latent: b.LTXVLatentUpsampler({
|
|
111
|
+
samples: baseAv.outputs.video_latent,
|
|
112
|
+
upscale_model: b.LatentUpscaleModelLoader({ model_name: 'ltx-2.3-spatial-upscaler-x2-1.1.safetensors' }),
|
|
113
|
+
vae: ckpt.outputs.VAE,
|
|
114
|
+
}),
|
|
115
|
+
audio_latent: baseAv.outputs.audio_latent,
|
|
116
|
+
}),
|
|
117
|
+
})
|
|
118
|
+
const av = b.LTXVSeparateAVLatent({ av_latent: refined.outputs.output })
|
|
119
|
+
|
|
120
|
+
b.SaveVideo({
|
|
121
|
+
video: b.CreateVideo({
|
|
122
|
+
images: b.VAEDecodeTiled({
|
|
123
|
+
samples: av.outputs.video_latent,
|
|
124
|
+
vae: ckpt.outputs.VAE,
|
|
125
|
+
tile_size: 768,
|
|
126
|
+
overlap: 64,
|
|
127
|
+
temporal_size: 4096,
|
|
128
|
+
temporal_overlap: 4,
|
|
129
|
+
}),
|
|
130
|
+
audio: b.LTXVAudioVAEDecode({ samples: av.outputs.audio_latent, audio_vae: audioVae }),
|
|
131
|
+
fps: vars.fps,
|
|
132
|
+
}),
|
|
133
|
+
filename_prefix: 'comfy-ts-zoo/ltx23-t2v',
|
|
134
|
+
format: 'auto',
|
|
135
|
+
codec: 'auto',
|
|
136
|
+
})
|
|
137
|
+
},
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
export default ltx23T2v
|
|
141
|
+
|
|
142
|
+
// standalone run (skipped when another driver — e.g. the TUI — imports this module)
|
|
143
|
+
if (import.meta.main) {
|
|
144
|
+
requireCloudKey()
|
|
145
|
+
if (process.argv[2]) ltx23T2v.vars.prompt.set(process.argv[2])
|
|
146
|
+
if (process.argv[3]) ltx23T2v.vars.seed.set(Number(process.argv[3]))
|
|
147
|
+
const execution = await ltx23T2v.run({ log: true })
|
|
148
|
+
// SaveVideo outputs land host side (no auto-download for video yet)
|
|
149
|
+
console.log(`🟢 ${execution.status}: video saved on the host under comfy-ts-zoo/ltx23-t2v`)
|
|
150
|
+
host.disconnect()
|
|
151
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// mage-flow i2i turbo on Comfy Cloud — Microsoft Mage-Flow-Edit Turbo int8, 4-step distilled instruction edit at cfg 1
|
|
2
|
+
// source template: image_mage_flow_edit_turbo_int8.json (official workflow-templates)
|
|
3
|
+
// needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
|
|
4
|
+
// run directly: bun examples/comfy-cloud/mage-flow-i2i-turbo.cflow.ts [path/to/image.png] ["edit prompt"] [seed]
|
|
5
|
+
import { asAbsolutePath, exampleImagePath, MediaImage, v } from 'comfy-ts'
|
|
6
|
+
import { cloudHost, requireCloudKey } from './cloudHost.ts'
|
|
7
|
+
|
|
8
|
+
const host = await cloudHost()
|
|
9
|
+
|
|
10
|
+
// bundled default input (examples/images/, ships in the tarball) — the TUI picker or argv[2] swap it
|
|
11
|
+
const image = v.image(exampleImagePath('bear_1024x1024.jpg'))
|
|
12
|
+
|
|
13
|
+
export const mageFlowI2iTurbo = host.defineWorkflow({
|
|
14
|
+
id: 'mage-flow-i2i-turbo',
|
|
15
|
+
vars: {
|
|
16
|
+
image,
|
|
17
|
+
// ONE prompt var: say what stays, then what changes; `- ` lines are the NEGATIVE prompt
|
|
18
|
+
prompt: v.prompt('Remove the bear, keep the rest of the scene unchanged.'),
|
|
19
|
+
seed: v.seed(42),
|
|
20
|
+
steps: v.int(4, { min: 1, max: 30 }),
|
|
21
|
+
},
|
|
22
|
+
// async build: the input image is uploaded (hash-named, deduped) per run
|
|
23
|
+
build: async (b, vars, wf) => {
|
|
24
|
+
const img = new MediaImage({ path: asAbsolutePath(image.absPath()) })
|
|
25
|
+
const loaded = await img.loadInWorkflow_viaLoadImageNode(wf)
|
|
26
|
+
|
|
27
|
+
const vae = b.VAELoader({ vae_name: 'mage_flow_vae_bf16.safetensors' })
|
|
28
|
+
// the reference → ~1MP on a 16 px grid; width and height 0 = the output takes the reference's size
|
|
29
|
+
const encoded = b.TextEncodeMageFlowEdit({
|
|
30
|
+
clip: b.CLIPLoader({ clip_name: 'qwen3vl_4b_bf16.safetensors', type: 'mage', device: 'default' }),
|
|
31
|
+
prompt: vars.prompt.positive,
|
|
32
|
+
negative_prompt: vars.prompt.negative,
|
|
33
|
+
'images.image_1': b.ImageScaleToTotalPixels({
|
|
34
|
+
image: loaded,
|
|
35
|
+
upscale_method: 'nearest-exact',
|
|
36
|
+
megapixels: 1,
|
|
37
|
+
resolution_steps: 16,
|
|
38
|
+
}),
|
|
39
|
+
vae,
|
|
40
|
+
width: 0,
|
|
41
|
+
height: 0,
|
|
42
|
+
batch_size: 1,
|
|
43
|
+
})
|
|
44
|
+
const samples = b.KSampler({
|
|
45
|
+
model: b.UNETLoader({ unet_name: 'mage_flow_edit_turbo_int8_convrot.safetensors', weight_dtype: 'default' }),
|
|
46
|
+
positive: encoded.outputs.positive,
|
|
47
|
+
negative: encoded.outputs.negative,
|
|
48
|
+
latent_image: encoded.outputs.latent,
|
|
49
|
+
seed: vars.seed,
|
|
50
|
+
steps: vars.steps,
|
|
51
|
+
// distilled: no guidance
|
|
52
|
+
cfg: 1,
|
|
53
|
+
sampler_name: 'euler',
|
|
54
|
+
scheduler: 'simple',
|
|
55
|
+
denoise: 1,
|
|
56
|
+
})
|
|
57
|
+
b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
|
|
58
|
+
},
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
export default mageFlowI2iTurbo
|
|
62
|
+
|
|
63
|
+
// standalone run (skipped when another driver — e.g. the TUI — imports this module)
|
|
64
|
+
if (import.meta.main) {
|
|
65
|
+
requireCloudKey()
|
|
66
|
+
if (process.argv[2]) mageFlowI2iTurbo.vars.image.set(process.argv[2])
|
|
67
|
+
if (process.argv[3]) mageFlowI2iTurbo.vars.prompt.set(process.argv[3])
|
|
68
|
+
if (process.argv[4]) mageFlowI2iTurbo.vars.seed.set(Number(process.argv[4]))
|
|
69
|
+
const execution = await mageFlowI2iTurbo.run({ log: true, save: { prefix: 'comfy-ts-zoo/mage-flow-i2i-turbo' } })
|
|
70
|
+
for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
|
|
71
|
+
host.disconnect()
|
|
72
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// mage-flow i2i on Comfy Cloud — Microsoft Mage-Flow-Edit int8, instruction-based image edit (background, style, light, local changes)
|
|
2
|
+
// source template: image_mage_flow_edit_int8.json (official workflow-templates)
|
|
3
|
+
// needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
|
|
4
|
+
// run directly: bun examples/comfy-cloud/mage-flow-i2i.cflow.ts [path/to/image.png] ["edit prompt"] [seed]
|
|
5
|
+
import { asAbsolutePath, exampleImagePath, MediaImage, v } from 'comfy-ts'
|
|
6
|
+
import { cloudHost, requireCloudKey } from './cloudHost.ts'
|
|
7
|
+
|
|
8
|
+
const host = await cloudHost()
|
|
9
|
+
|
|
10
|
+
// bundled default input (examples/images/, ships in the tarball) — the TUI picker or argv[2] swap it
|
|
11
|
+
const image = v.image(exampleImagePath('bear_1024x1024.jpg'))
|
|
12
|
+
|
|
13
|
+
export const mageFlowI2i = host.defineWorkflow({
|
|
14
|
+
id: 'mage-flow-i2i',
|
|
15
|
+
vars: {
|
|
16
|
+
image,
|
|
17
|
+
// ONE prompt var: say what stays, then what changes; `- ` lines are the NEGATIVE prompt
|
|
18
|
+
prompt: v.prompt(
|
|
19
|
+
'Keep the bear and its pose unchanged. Replace the background with a wide, flat grassland prairie under soft golden sunlight, open sky, endless green fields.',
|
|
20
|
+
),
|
|
21
|
+
seed: v.seed(42),
|
|
22
|
+
steps: v.int(30, { min: 1, max: 100 }),
|
|
23
|
+
cfg: v.float(5, { min: 1, max: 15 }),
|
|
24
|
+
},
|
|
25
|
+
// async build: the input image is uploaded (hash-named, deduped) per run
|
|
26
|
+
build: async (b, vars, wf) => {
|
|
27
|
+
const img = new MediaImage({ path: asAbsolutePath(image.absPath()) })
|
|
28
|
+
const loaded = await img.loadInWorkflow_viaLoadImageNode(wf)
|
|
29
|
+
|
|
30
|
+
const vae = b.VAELoader({ vae_name: 'mage_flow_vae_bf16.safetensors' })
|
|
31
|
+
// the reference → ~1MP on a 16 px grid; width and height 0 = the output takes the reference's size
|
|
32
|
+
const encoded = b.TextEncodeMageFlowEdit({
|
|
33
|
+
clip: b.CLIPLoader({ clip_name: 'qwen3vl_4b_bf16.safetensors', type: 'mage', device: 'default' }),
|
|
34
|
+
prompt: vars.prompt.positive,
|
|
35
|
+
negative_prompt: vars.prompt.negative,
|
|
36
|
+
'images.image_1': b.ImageScaleToTotalPixels({
|
|
37
|
+
image: loaded,
|
|
38
|
+
upscale_method: 'lanczos',
|
|
39
|
+
megapixels: 1,
|
|
40
|
+
resolution_steps: 16,
|
|
41
|
+
}),
|
|
42
|
+
vae,
|
|
43
|
+
width: 0,
|
|
44
|
+
height: 0,
|
|
45
|
+
batch_size: 1,
|
|
46
|
+
})
|
|
47
|
+
const samples = b.KSampler({
|
|
48
|
+
model: b.UNETLoader({ unet_name: 'mage_flow_edit_int8_convrot.safetensors', weight_dtype: 'default' }),
|
|
49
|
+
positive: encoded.outputs.positive,
|
|
50
|
+
negative: encoded.outputs.negative,
|
|
51
|
+
latent_image: encoded.outputs.latent,
|
|
52
|
+
seed: vars.seed,
|
|
53
|
+
steps: vars.steps,
|
|
54
|
+
cfg: vars.cfg,
|
|
55
|
+
sampler_name: 'euler',
|
|
56
|
+
scheduler: 'simple',
|
|
57
|
+
denoise: 1,
|
|
58
|
+
})
|
|
59
|
+
b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
export default mageFlowI2i
|
|
64
|
+
|
|
65
|
+
// standalone run (skipped when another driver — e.g. the TUI — imports this module)
|
|
66
|
+
if (import.meta.main) {
|
|
67
|
+
requireCloudKey()
|
|
68
|
+
if (process.argv[2]) mageFlowI2i.vars.image.set(process.argv[2])
|
|
69
|
+
if (process.argv[3]) mageFlowI2i.vars.prompt.set(process.argv[3])
|
|
70
|
+
if (process.argv[4]) mageFlowI2i.vars.seed.set(Number(process.argv[4]))
|
|
71
|
+
const execution = await mageFlowI2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/mage-flow-i2i' } })
|
|
72
|
+
for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
|
|
73
|
+
host.disconnect()
|
|
74
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// mage-flow t2i turbo on Comfy Cloud — Microsoft Mage-Flow Turbo int8, 4-step distilled text to image at cfg 1 (512 to 2048 px a side, multiples of 16)
|
|
2
|
+
// source template: image_mage_flow_turbo_t2i_int8.json (official workflow-templates)
|
|
3
|
+
// needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
|
|
4
|
+
// run directly: bun examples/comfy-cloud/mage-flow-t2i-turbo.cflow.ts ["prompt"] [seed]
|
|
5
|
+
import { v } from 'comfy-ts'
|
|
6
|
+
import { cloudHost, requireCloudKey } from './cloudHost.ts'
|
|
7
|
+
|
|
8
|
+
const host = await cloudHost()
|
|
9
|
+
|
|
10
|
+
export const mageFlowT2iTurbo = host.defineWorkflow({
|
|
11
|
+
id: 'mage-flow-t2i-turbo',
|
|
12
|
+
vars: {
|
|
13
|
+
// ONE prompt var: `- ` lines are the NEGATIVE prompt, `//` lines are comments
|
|
14
|
+
prompt: v.prompt(
|
|
15
|
+
'Vintage analogue film photograph, a surreal scene in which a person is completely wrapped and hidden by a large soft white cumulus cloud; only a loose blue-and-white floral shirt and the shape of a seated figure show beneath it. The figure sits sideways at an old wooden classroom desk beside a large wooden window with pale blue sky outside. Soft daylight, quiet dreamy nostalgic atmosphere, muted retro pastel colors, subtle film grain, soft focus, minimalist surreal photography.',
|
|
16
|
+
),
|
|
17
|
+
seed: v.seed(42),
|
|
18
|
+
steps: v.int(4, { min: 1, max: 30 }),
|
|
19
|
+
size: v.size({ width: 1024, height: 1024 }),
|
|
20
|
+
},
|
|
21
|
+
build: (b, vars) => {
|
|
22
|
+
const vae = b.VAELoader({ vae_name: 'mage_flow_vae_bf16.safetensors' })
|
|
23
|
+
// one encode node builds the positive, the negative AND the empty latent at the asked size
|
|
24
|
+
const encoded = b.TextEncodeMageFlowEdit({
|
|
25
|
+
clip: b.CLIPLoader({ clip_name: 'qwen3vl_4b_bf16.safetensors', type: 'mage', device: 'default' }),
|
|
26
|
+
prompt: vars.prompt.positive,
|
|
27
|
+
negative_prompt: vars.prompt.negative,
|
|
28
|
+
vae,
|
|
29
|
+
width: vars.size.width,
|
|
30
|
+
height: vars.size.height,
|
|
31
|
+
batch_size: 1,
|
|
32
|
+
})
|
|
33
|
+
const samples = b.KSampler({
|
|
34
|
+
model: b.UNETLoader({ unet_name: 'mage_flow_turbo_int8_convrot.safetensors', weight_dtype: 'default' }),
|
|
35
|
+
positive: encoded.outputs.positive,
|
|
36
|
+
negative: encoded.outputs.negative,
|
|
37
|
+
latent_image: encoded.outputs.latent,
|
|
38
|
+
seed: vars.seed,
|
|
39
|
+
steps: vars.steps,
|
|
40
|
+
// distilled: no guidance
|
|
41
|
+
cfg: 1,
|
|
42
|
+
sampler_name: 'euler',
|
|
43
|
+
scheduler: 'simple',
|
|
44
|
+
denoise: 1,
|
|
45
|
+
})
|
|
46
|
+
b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
export default mageFlowT2iTurbo
|
|
51
|
+
|
|
52
|
+
// standalone run (skipped when another driver — e.g. the TUI — imports this module)
|
|
53
|
+
if (import.meta.main) {
|
|
54
|
+
requireCloudKey()
|
|
55
|
+
if (process.argv[2]) mageFlowT2iTurbo.vars.prompt.set(process.argv[2])
|
|
56
|
+
if (process.argv[3]) mageFlowT2iTurbo.vars.seed.set(Number(process.argv[3]))
|
|
57
|
+
const execution = await mageFlowT2iTurbo.run({ log: true, save: { prefix: 'comfy-ts-zoo/mage-flow-t2i-turbo' } })
|
|
58
|
+
for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
|
|
59
|
+
host.disconnect()
|
|
60
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// mage-flow t2i on Comfy Cloud — Microsoft Mage-Flow int8, native-resolution text to image (512 to 2048 px a side, multiples of 16)
|
|
2
|
+
// source template: image_mage_flow_t2i_int8.json (official workflow-templates)
|
|
3
|
+
// needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
|
|
4
|
+
// run directly: bun examples/comfy-cloud/mage-flow-t2i.cflow.ts ["prompt"] [seed]
|
|
5
|
+
import { v } from 'comfy-ts'
|
|
6
|
+
import { cloudHost, requireCloudKey } from './cloudHost.ts'
|
|
7
|
+
|
|
8
|
+
const host = await cloudHost()
|
|
9
|
+
|
|
10
|
+
export const mageFlowT2i = host.defineWorkflow({
|
|
11
|
+
id: 'mage-flow-t2i',
|
|
12
|
+
vars: {
|
|
13
|
+
// ONE prompt var: `- ` lines are the NEGATIVE prompt, `//` lines are comments
|
|
14
|
+
prompt: v.prompt(
|
|
15
|
+
'Analog film photograph, wide landscape shot, a lone man viewed from behind wearing a long dark brown overcoat standing in an empty snowy desert. A giant single pillar brutalist concrete gas station canopy with wide mushroom-shaped roof, minimalist retro futurism architecture. A smooth cream vintage fastback sports car parked beside an old red-and-white fuel pump. Distant snow-capped mountain ranges, pale muted sky, gravel ground with thin scattered snow. Soft natural daylight, muted earth tone palette, subtle film grain, medium format film aesthetic, cinematic minimalist photography',
|
|
16
|
+
),
|
|
17
|
+
seed: v.seed(42),
|
|
18
|
+
steps: v.int(30, { min: 1, max: 100 }),
|
|
19
|
+
cfg: v.float(5, { min: 1, max: 15 }),
|
|
20
|
+
size: v.size({ width: 1024, height: 1024 }),
|
|
21
|
+
},
|
|
22
|
+
build: (b, vars) => {
|
|
23
|
+
const vae = b.VAELoader({ vae_name: 'mage_flow_vae_bf16.safetensors' })
|
|
24
|
+
// one encode node builds the positive, the negative AND the empty latent at the asked size
|
|
25
|
+
const encoded = b.TextEncodeMageFlowEdit({
|
|
26
|
+
clip: b.CLIPLoader({ clip_name: 'qwen3vl_4b_bf16.safetensors', type: 'mage', device: 'default' }),
|
|
27
|
+
prompt: vars.prompt.positive,
|
|
28
|
+
negative_prompt: vars.prompt.negative,
|
|
29
|
+
vae,
|
|
30
|
+
width: vars.size.width,
|
|
31
|
+
height: vars.size.height,
|
|
32
|
+
batch_size: 1,
|
|
33
|
+
})
|
|
34
|
+
const samples = b.KSampler({
|
|
35
|
+
model: b.UNETLoader({ unet_name: 'mage_flow_int8_convrot.safetensors', weight_dtype: 'default' }),
|
|
36
|
+
positive: encoded.outputs.positive,
|
|
37
|
+
negative: encoded.outputs.negative,
|
|
38
|
+
latent_image: encoded.outputs.latent,
|
|
39
|
+
seed: vars.seed,
|
|
40
|
+
steps: vars.steps,
|
|
41
|
+
cfg: vars.cfg,
|
|
42
|
+
sampler_name: 'euler',
|
|
43
|
+
scheduler: 'simple',
|
|
44
|
+
denoise: 1,
|
|
45
|
+
})
|
|
46
|
+
b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
export default mageFlowT2i
|
|
51
|
+
|
|
52
|
+
// standalone run (skipped when another driver — e.g. the TUI — imports this module)
|
|
53
|
+
if (import.meta.main) {
|
|
54
|
+
requireCloudKey()
|
|
55
|
+
if (process.argv[2]) mageFlowT2i.vars.prompt.set(process.argv[2])
|
|
56
|
+
if (process.argv[3]) mageFlowT2i.vars.seed.set(Number(process.argv[3]))
|
|
57
|
+
const execution = await mageFlowT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/mage-flow-t2i' } })
|
|
58
|
+
for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
|
|
59
|
+
host.disconnect()
|
|
60
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// minimax-h3 t2i on Comfy Cloud — MiniMax H3 int8, the video model rendering one still frame (no cfg, res_multistep)
|
|
2
|
+
// source template: image_minimax_h3_t2i.json (official workflow-templates)
|
|
3
|
+
// needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
|
|
4
|
+
// run directly: bun examples/comfy-cloud/minimax-h3-t2i.cflow.ts ["prompt"] [seed]
|
|
5
|
+
import { v } from 'comfy-ts'
|
|
6
|
+
import { cloudHost, requireCloudKey } from './cloudHost.ts'
|
|
7
|
+
|
|
8
|
+
const host = await cloudHost()
|
|
9
|
+
|
|
10
|
+
export const minimaxH3T2i = host.defineWorkflow({
|
|
11
|
+
id: 'minimax-h3-t2i',
|
|
12
|
+
vars: {
|
|
13
|
+
// ONE prompt var, positive only: the guider takes no negative (`//` lines are comments)
|
|
14
|
+
prompt: v.prompt(
|
|
15
|
+
'Epic sci-fi concept art, extreme low-angle wide shot of a colossal spacecraft hovering above a sandstorm-ravaged desert. The open hangar glows furnace-orange through dense blowing dust and volumetric light shafts. A long boarding ramp descends to the dunes; a lone human climbs it, wind-whipped sand swirling around their ankles, tiny against the massive hull. Low amber sun behind the craft, long god-rays across ochre and rust dunes. Monumental scale, cinematic digital illustration, ultra-detailed metal plating and dust particles, dramatic rim light, sharp focus, no text, no watermark.',
|
|
16
|
+
),
|
|
17
|
+
seed: v.seed(42),
|
|
18
|
+
// 30 is the checkpoint default; detail keeps improving up to 50
|
|
19
|
+
steps: v.int(30, { min: 1, max: 80 }),
|
|
20
|
+
size: v.size({ width: 1280, height: 720 }),
|
|
21
|
+
},
|
|
22
|
+
build: (b, vars) => {
|
|
23
|
+
// int8 attention on Nvidia and AMD: the template's default backend for this checkpoint
|
|
24
|
+
const model = b.ModelAttentionBackend({
|
|
25
|
+
model: b.UNETLoader({
|
|
26
|
+
unet_name: 'minimax_h3_fl2va_pruned_int8_convrot.safetensors',
|
|
27
|
+
weight_dtype: 'default',
|
|
28
|
+
}),
|
|
29
|
+
attention: 'comfy kitchen attention',
|
|
30
|
+
})
|
|
31
|
+
const clip = b.CLIPLoader({
|
|
32
|
+
clip_name: 'qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors',
|
|
33
|
+
type: 'minimax',
|
|
34
|
+
device: 'default',
|
|
35
|
+
})
|
|
36
|
+
const sampled = b.SamplerCustomAdvanced({
|
|
37
|
+
noise: b.RandomNoise({ noise_seed: vars.seed }),
|
|
38
|
+
guider: b.BasicGuider({ model, conditioning: b.CLIPTextEncode({ clip, text: vars.prompt.positive }) }),
|
|
39
|
+
sampler: b.KSamplerSelect({ sampler_name: 'res_multistep' }),
|
|
40
|
+
sigmas: b.BasicScheduler({ model, scheduler: 'simple', steps: vars.steps, denoise: 1 }),
|
|
41
|
+
latent_image: b.EmptyLatentImage({ width: vars.size.width, height: vars.size.height, batch_size: 1 }),
|
|
42
|
+
})
|
|
43
|
+
// the sampler returns an audio+video latent: keep the video half, decode its single frame
|
|
44
|
+
const av = b.LTXVSeparateAVLatent({ av_latent: sampled.outputs.output })
|
|
45
|
+
b.SaveImageWebsocket({
|
|
46
|
+
images: b.VAEDecode({
|
|
47
|
+
samples: av.outputs.video_latent,
|
|
48
|
+
vae: b.VAELoader({ vae_name: 'minimax_h3_video_vae_fp16.safetensors' }),
|
|
49
|
+
}),
|
|
50
|
+
})
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
export default minimaxH3T2i
|
|
55
|
+
|
|
56
|
+
// standalone run (skipped when another driver — e.g. the TUI — imports this module)
|
|
57
|
+
if (import.meta.main) {
|
|
58
|
+
requireCloudKey()
|
|
59
|
+
if (process.argv[2]) minimaxH3T2i.vars.prompt.set(process.argv[2])
|
|
60
|
+
if (process.argv[3]) minimaxH3T2i.vars.seed.set(Number(process.argv[3]))
|
|
61
|
+
const execution = await minimaxH3T2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/minimax-h3-t2i' } })
|
|
62
|
+
for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
|
|
63
|
+
host.disconnect()
|
|
64
|
+
}
|