comfy-ts 2.11.0 → 2.13.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/README.md +1 -0
- package/dist/{LogsSt-qtFzOKpu.js → LogsSt-CUeo843w.js} +51 -7
- package/dist/LogsSt-CUeo843w.js.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/index.cjs +595 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +286 -46
- package/dist/index.d.ts +286 -46
- package/dist/index.js +591 -74
- package/dist/index.js.map +1 -1
- package/dist/{run-serve-BK7BA2dn.js → run-serve-DlRBv_Nk.js} +738 -58
- package/dist/run-serve-DlRBv_Nk.js.map +1 -0
- package/dist/{run-tui-CQyvMf0N.js → run-tui-B5uxm2_l.js} +43 -18
- package/dist/run-tui-B5uxm2_l.js.map +1 -0
- package/dist/{schemaDrift-DjjEtwfx.js → schemaDrift-E95iTF7E.js} +473 -60
- package/dist/schemaDrift-E95iTF7E.js.map +1 -0
- package/dist/serve-web.js +710 -174
- package/dist/{state--wrz0BQc.js → state-CUp2J1Zy.js} +126 -14
- package/dist/state-CUp2J1Zy.js.map +1 -0
- package/dist/web.d.ts +286 -46
- package/dist/web.js +591 -74
- package/dist/web.js.map +1 -1
- package/examples/comfy-cloud/sdk.d.ts +163 -163
- package/examples/rvion/06-qwen-image-edit.cflow.ts +3 -2
- package/examples/rvion/10-anima-t2i.cflow.ts +252 -0
- package/examples/rvion/11-yue2-t2a.cflow.ts +105 -0
- package/examples/rvion/12-stable-audio-3-t2a.cflow.ts +78 -0
- package/examples/rvion/13-ace-step-15-xl-t2a.cflow.ts +153 -0
- package/examples/rvion/stableAudio3Prompts.ts +19 -0
- package/extra/README.md +4 -0
- package/extra/comfyui-fresh-model-lists/README.md +25 -0
- package/extra/comfyui-fresh-model-lists/__init__.py +36 -0
- package/extra/comfyui-fresh-model-lists/test_fresh_model_lists.py +97 -0
- package/package.json +15 -7
- package/src/cli/draftMeta.ts +39 -0
- package/src/cli/serve/ServeApp.ts +305 -30
- package/src/cli/serve/applyVarPayload.ts +50 -22
- package/src/cli/serve/byteRange.ts +48 -0
- package/src/cli/serve/describeVar.ts +42 -6
- package/src/cli/serve/llmConfigShape.ts +51 -0
- package/src/cli/serve/llmConfigs.ts +52 -0
- package/src/cli/serve/run-serve.ts +12 -3
- package/src/cli/serve/tagList.ts +92 -0
- package/src/cli/serve/tagSource.ts +69 -0
- package/src/cli/serve/web/api.ts +72 -0
- package/src/cli/serve/web/components/App.tsx +485 -44
- package/src/cli/serve/web/components/DraftTabs.tsx +167 -0
- package/src/cli/serve/web/components/Gallery.tsx +133 -31
- package/src/cli/serve/web/components/HistoryPicker.tsx +149 -0
- package/src/cli/serve/web/components/Icon.tsx +58 -2
- package/src/cli/serve/web/components/MenuButton.tsx +53 -0
- package/src/cli/serve/web/components/Omnibox.tsx +135 -0
- package/src/cli/serve/web/components/PromptEnhancer.tsx +476 -180
- package/src/cli/serve/web/components/SideMenu.tsx +414 -0
- package/src/cli/serve/web/components/TooltipLayer.tsx +46 -0
- package/src/cli/serve/web/components/VarIcon.tsx +24 -0
- package/src/cli/serve/web/components/VarsForm.tsx +223 -351
- package/src/cli/serve/web/components/controls/BasicControls.tsx +57 -32
- package/src/cli/serve/web/components/controls/LorasControl.tsx +646 -317
- package/src/cli/serve/web/components/controls/PresetPicker.tsx +1 -1
- package/src/cli/serve/web/components/controls/PromptControl.tsx +279 -0
- package/src/cli/serve/web/components/controls/PromptEditor.tsx +113 -0
- package/src/cli/serve/web/components/controls/SeedControl.tsx +17 -10
- package/src/cli/serve/web/components/controls/SizeControl.tsx +111 -18
- package/src/cli/serve/web/components/modKey.ts +2 -0
- package/src/cli/serve/web/llm.ts +23 -12
- package/src/cli/serve/web/promptEditor/promptExtensions.ts +284 -0
- package/src/cli/serve/web/state/EnhancerSt.ts +431 -101
- package/src/cli/serve/web/state/FormSt.ts +214 -30
- package/src/cli/serve/web/state/OmniboxSt.ts +59 -0
- package/src/cli/serve/web/state/WebSt.ts +364 -80
- package/src/cli/serve/web/state/choiceButtons.ts +61 -0
- package/src/cli/serve/web/state/draftNames.ts +16 -0
- package/src/cli/serve/web/state/draftTabs.ts +75 -0
- package/src/cli/serve/web/state/generateButton.ts +16 -0
- package/src/cli/serve/web/state/history.ts +54 -0
- package/src/cli/serve/web/state/host.ts +5 -2
- package/src/cli/serve/web/state/keptLines.ts +53 -0
- package/src/cli/serve/web/state/latentMode.ts +20 -0
- package/src/cli/serve/web/state/loraSort.ts +18 -0
- package/src/cli/serve/web/state/moduleTree.ts +2 -2
- package/src/cli/serve/web/state/omnibox.ts +133 -0
- package/src/cli/serve/web/state/payload.ts +38 -58
- package/src/cli/serve/web/state/shortcuts.ts +103 -0
- package/src/cli/serve/web/state/sizeStars.ts +31 -0
- package/src/cli/serve/web/state/stableSlots.ts +21 -0
- package/src/cli/serve/web/state/varGroups.ts +24 -0
- package/src/cli/serve/web/styles.ts +653 -154
- package/src/cli/serve/webBundle.ts +54 -10
- package/src/cli/serve/workflowTags.ts +42 -0
- package/src/cli/serve/workspaceLabels.ts +23 -0
- package/src/cli/tui/components/PickerOverlays.tsx +9 -2
- package/src/cli/tui/imagePicker/ImagePickerSt.ts +1 -1
- package/src/cli/tui/state/DraftsSt.ts +28 -8
- package/src/cli/tui/state/EditorSt.ts +1 -1
- package/src/cli/tui/state/LorasSt.ts +1 -1
- package/src/cli/tui/state/PickerSt.ts +25 -7
- package/src/cli/tui/state/SettingsSt.ts +1 -1
- package/src/cli/tui/state/TuiSt.ts +10 -0
- package/src/coreExports.ts +21 -0
- package/src/host/ComfyHost.ts +17 -2
- package/src/host/ResilientWebsocket.ts +54 -4
- package/src/host/loraInfoCache.ts +6 -0
- package/src/runner/ComfyExecution.ts +60 -0
- package/src/runner/ComfyWorkflow.ts +4 -0
- package/src/runner/ComfyWsApi.ts +2 -0
- package/src/runner/MediaImage.ts +2 -2
- package/src/sdk-generator/ComfyUIObjectInfoTypes.ts +5 -5
- package/src/sdk-generator/comfyui-sdk-codegen.ts +1 -1
- package/src/state.ts +5 -0
- package/src/utils/copyName.ts +12 -0
- package/src/vars/ComfyVars.ts +337 -67
- package/src/vars/DefinedWorkflow.ts +47 -20
- package/src/vars/lanes.ts +238 -0
- package/src/vars/loraEntry.ts +101 -0
- package/src/vars/promptSyntax.ts +382 -0
- package/dist/LogsSt-qtFzOKpu.js.map +0 -1
- package/dist/run-serve-BK7BA2dn.js.map +0 -1
- package/dist/run-tui-CQyvMf0N.js.map +0 -1
- package/dist/schemaDrift-DjjEtwfx.js.map +0 -1
- package/dist/state--wrz0BQc.js.map +0 -1
- package/src/cli/serve/web/components/Sidebar.tsx +0 -66
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// mirrors the official image_qwen_image_edit_2511 template, single reference
|
|
3
3
|
// image; the lightning toggle switches the 4-step Lightning lora (cfg 1) vs
|
|
4
4
|
// full sampling (cfg 4 — raise steps to ~40 yourself when you flip it off)
|
|
5
|
+
// box inventory: qwen-image-edit-2511-Q2_K.gguf (ComfyUI-GGUF), Qwen-Image-Edit-2511-Lightning-4steps-V1.0-fp32 lora
|
|
5
6
|
// run directly: bun examples/rvion/06-qwen-image-edit.cflow.ts [path/to/image.png] ["edit instruction"]
|
|
6
7
|
import { asAbsolutePath, ComfyTS, exampleImagePath, MediaImage, v } from 'comfy-ts'
|
|
7
8
|
|
|
@@ -28,7 +29,7 @@ export const qwenImageEdit = host.defineWorkflow({
|
|
|
28
29
|
const loaded = await img.loadInWorkflow_viaLoadImageNode(wf)
|
|
29
30
|
const scaled = b.FluxKontextImageScale({ image: loaded })
|
|
30
31
|
|
|
31
|
-
const unet = b.
|
|
32
|
+
const unet = b['GGUF.UnetLoaderGGUF']({ unet_name: 'qwen-image-edit-2511-Q2_K.gguf' })
|
|
32
33
|
const clip = b.CLIPLoader({
|
|
33
34
|
clip_name: 'qwen_2.5_vl_7b_fp8_scaled.safetensors',
|
|
34
35
|
type: 'qwen_image',
|
|
@@ -44,7 +45,7 @@ export const qwenImageEdit = host.defineWorkflow({
|
|
|
44
45
|
if (vars.lightning) {
|
|
45
46
|
model = b.LoraLoaderModelOnly({
|
|
46
47
|
model,
|
|
47
|
-
lora_name: 'Qwen-Image-Edit-2511-Lightning-4steps-V1.0-
|
|
48
|
+
lora_name: 'Qwen-Image-Edit-2511-Lightning-4steps-V1.0-fp32.safetensors',
|
|
48
49
|
strength_model: 1,
|
|
49
50
|
})._MODEL
|
|
50
51
|
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
// anima text-to-image on the local box: anime UNET, qwen3 0.6b text encoder, qwen image vae.
|
|
2
|
+
// four models behind one choice, each with the settings its model card gives
|
|
3
|
+
// (huggingface.co/circlestone-labs/Anima): the distilled ones run 8 steps at cfg 1, the
|
|
4
|
+
// others 30-50 steps at cfg 4-5. er_sde is the author's default sampler, euler suits turbo.
|
|
5
|
+
//
|
|
6
|
+
// run directly: bun examples/rvion/10-anima-t2i.cflow.ts ["prompt"] [seed]
|
|
7
|
+
import { activeLoras, ComfyTS } from 'comfy-ts'
|
|
8
|
+
|
|
9
|
+
const comfy = ComfyTS.create()
|
|
10
|
+
const host = comfy.host({ id: 'windows-1', host: 'desktop-im18794', port: 8085 })
|
|
11
|
+
await host.loadSchemaFromCache()
|
|
12
|
+
|
|
13
|
+
const TURBO_LORA = 'anima\\anima-turbo-lora-v0.2.safetensors'
|
|
14
|
+
// the a1111 tagcomplete list: fetched by serve on first use, never part of this repo
|
|
15
|
+
const DANBOORU_TAGS = 'https://raw.githubusercontent.com/DominikDoom/a1111-sd-webui-tagcomplete/main/tags/danbooru.csv'
|
|
16
|
+
|
|
17
|
+
const MODELS = {
|
|
18
|
+
// distilled: fast, stable, a strong default style. What the author suggests starting with
|
|
19
|
+
turbo: { unet: 'anima-turbo-v1.1.safetensors', turboLora: false, distilled: true, scores: true },
|
|
20
|
+
// base fine-tuned on high quality images only. Its card: no score_* tags, they push it into slop
|
|
21
|
+
aesthetic: { unet: 'anima-aesthetic-v1.1.safetensors', turboLora: false, distilled: false, scores: false },
|
|
22
|
+
// the raw pretrained model: plain neutral style, what loras are trained on
|
|
23
|
+
base: { unet: 'anima-base-v1.0.safetensors', turboLora: false, distilled: false, scores: true },
|
|
24
|
+
// base with the official turbo lora, the template's fast path
|
|
25
|
+
'base+turbo': { unet: 'anima-base-v1.0.safetensors', turboLora: true, distilled: true, scores: true },
|
|
26
|
+
} as const
|
|
27
|
+
|
|
28
|
+
/** the tags in front of the prompt and the negative, from the top choices. Joined to the text
|
|
29
|
+
* with ', ', and an empty side adds nothing, so a bare prompt reads exactly as typed */
|
|
30
|
+
const QUALITY_TAGS: Record<string, string[]> = {
|
|
31
|
+
good: ['good quality'],
|
|
32
|
+
best: ['best quality'],
|
|
33
|
+
masterpiece: ['masterpiece', 'best quality'],
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function animaTags(p: {
|
|
37
|
+
/** null = no quality tags (the lit button clicked off) */
|
|
38
|
+
quality: string | null
|
|
39
|
+
/** every score picked becomes its own tag; none picked = no score tag */
|
|
40
|
+
score: readonly string[]
|
|
41
|
+
/** null = no rating tag */
|
|
42
|
+
safety: string | null
|
|
43
|
+
/** false on aesthetic: its card says score tags push it into slop */
|
|
44
|
+
scores: boolean
|
|
45
|
+
}): { positive: string[]; negative: string[] } {
|
|
46
|
+
const score = p.scores ? p.score.map((n) => `score_${n}`) : []
|
|
47
|
+
const quality = p.quality == null ? [] : (QUALITY_TAGS[p.quality] ?? [])
|
|
48
|
+
return {
|
|
49
|
+
positive: [...quality, ...score, ...(p.safety == null ? [] : [p.safety])],
|
|
50
|
+
negative: [
|
|
51
|
+
...(quality.length > 0 ? ['worst quality', 'low quality'] : []),
|
|
52
|
+
...(score.length > 0 ? ['score_1', 'score_2', 'score_3'] : []),
|
|
53
|
+
],
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const joinTags = (tags: string[], text: string): string => [...tags, text].filter((t) => t.trim() !== '').join(', ')
|
|
58
|
+
|
|
59
|
+
/** the texts the two CLIPTextEncode nodes receive. ONE function for the build and the live
|
|
60
|
+
* preview, so the preview is exactly what runs */
|
|
61
|
+
/** the cfg the sampler gets: the distilled models read `turboCfg` (the card says 1), the others
|
|
62
|
+
* `cfg`. At exactly 1 ComfyUI skips the negative pass, so the negative only acts above it */
|
|
63
|
+
export function animaCfg(p: { model: keyof typeof MODELS; cfg: number; turboCfg: number }): number {
|
|
64
|
+
return MODELS[p.model].distilled ? p.turboCfg : p.cfg
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** the live preview: the prompt as it runs, and a note when the negative cannot act */
|
|
68
|
+
export function animaPreview(p: { positive: string; negative: string; cfg: number }): string {
|
|
69
|
+
if (p.negative === '') return p.positive
|
|
70
|
+
const lines = [p.positive, `- ${p.negative}`]
|
|
71
|
+
if (p.cfg === 1) lines.push('// the negative is ignored at cfg 1: raise turbo cfg above 1 to use it')
|
|
72
|
+
return lines.join('\n')
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function animaPrompts(p: {
|
|
76
|
+
model: keyof typeof MODELS
|
|
77
|
+
quality: string | null
|
|
78
|
+
score: readonly string[]
|
|
79
|
+
safety: string | null
|
|
80
|
+
prompt: { positive: string; negative: string }
|
|
81
|
+
}): { positive: string; negative: string } {
|
|
82
|
+
const tags = animaTags({ quality: p.quality, score: p.score, safety: p.safety, scores: MODELS[p.model].scores })
|
|
83
|
+
return { positive: joinTags(tags.positive, p.prompt.positive), negative: joinTags(tags.negative, p.prompt.negative) }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const animaT2i = host.defineWorkflow({
|
|
87
|
+
id: 'anima-t2i',
|
|
88
|
+
tags: ['anime'],
|
|
89
|
+
vars: (v) => {
|
|
90
|
+
// every lora inside an `anima/` folder (never WanAnimate and friends), except the turbo one: the model choice owns it
|
|
91
|
+
const loras = v
|
|
92
|
+
.loras(/^(?!.*anima-turbo-lora)(?:.*[\\/])?anima[\\/]/i)
|
|
93
|
+
.ui({ group: 'loras', groupColor: 'rgba(187, 154, 247, 0.08)' })
|
|
94
|
+
return {
|
|
95
|
+
// the tags every anima prompt starts with, as buttons: the model card's order is
|
|
96
|
+
// quality, score, safety, then the rest, and the build writes them in that order
|
|
97
|
+
safety: v
|
|
98
|
+
.choice(['safe', 'sensitive', 'nsfw', 'explicit'], 'safe', { label: 'safety', select: 'zero-or-one' })
|
|
99
|
+
.ui({
|
|
100
|
+
group: 'tags',
|
|
101
|
+
groupColor: 'rgba(158, 206, 106, 0.07)',
|
|
102
|
+
description: 'the rating tag anima was trained with, written after quality and score',
|
|
103
|
+
// one color per rating, green to red, so the lit one says how far it goes
|
|
104
|
+
options: {
|
|
105
|
+
safe: { color: '#9ece6a' },
|
|
106
|
+
sensitive: { color: '#e0af68' },
|
|
107
|
+
nsfw: { color: '#ff9e64' },
|
|
108
|
+
explicit: { color: '#f7768e' },
|
|
109
|
+
},
|
|
110
|
+
}),
|
|
111
|
+
// any number of scores, each its own score_N tag in front, score_1..3 in the negative
|
|
112
|
+
// once one is picked. Left out on aesthetic, as its card says
|
|
113
|
+
score: v.choice(['6', '7', '8', '9'], ['7'], { label: 'score', select: 'many' }).ui({
|
|
114
|
+
group: 'tags',
|
|
115
|
+
description:
|
|
116
|
+
'click to toggle: every score picked adds its score_N tag, and score_1 to 3 go to the negative. None picked, no score. Left out on aesthetic: its card says score tags push it into slop',
|
|
117
|
+
}),
|
|
118
|
+
// the card's human quality scale: masterpiece, best quality, good quality, … worst quality
|
|
119
|
+
quality: v
|
|
120
|
+
.choice(['good', 'best', 'masterpiece'], 'masterpiece', { label: 'quality', select: 'zero-or-one' })
|
|
121
|
+
.ui({
|
|
122
|
+
group: 'tags',
|
|
123
|
+
description:
|
|
124
|
+
'good: good quality. best: best quality. masterpiece: masterpiece, best quality. Any of them puts worst quality, low quality in the negative',
|
|
125
|
+
}),
|
|
126
|
+
// anima reads booru tags and short phrases. `- ` lines are the negative prompt
|
|
127
|
+
prompt: v
|
|
128
|
+
.prompt(
|
|
129
|
+
'1girl, silver hair, long coat, standing on a rooftop at dusk, city lights, wind, looking at viewer\n- blurry, jpeg artifacts, sepia',
|
|
130
|
+
{
|
|
131
|
+
loraKeywordsFrom: loras,
|
|
132
|
+
// danbooru tag completion. The card: lowercase, spaces for underscores, artists as `@name`
|
|
133
|
+
tags: { url: DANBOORU_TAGS, artistPrefix: '@' },
|
|
134
|
+
// named starting texts: picking one REPLACES the box, the draft reverts it
|
|
135
|
+
presets: {
|
|
136
|
+
'rooftop portrait':
|
|
137
|
+
'1girl, silver hair, long coat, standing on a rooftop at dusk, city lights, wind, looking at viewer\n- blurry, jpeg artifacts, sepia',
|
|
138
|
+
'chibi sprite':
|
|
139
|
+
'chibi, full body, simple background, white background, round sheep mascot, big eyes, flat colors\n- blurry, text, watermark',
|
|
140
|
+
landscape:
|
|
141
|
+
'no humans, scenery, floating islands, waterfalls, soft clouds, golden hour, detailed background\n- blurry, jpeg artifacts',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
)
|
|
145
|
+
.ui({ group: 'prompt', groupColor: 'rgba(224, 175, 104, 0.07)' }),
|
|
146
|
+
// right under the prompt: the loras and the words they add are read together
|
|
147
|
+
loras,
|
|
148
|
+
seed: v.seed(1, { mode: '+' }),
|
|
149
|
+
model: v.choice(['turbo', 'aesthetic', 'base', 'base+turbo'], 'turbo', 'model').ui({
|
|
150
|
+
group: 'sampling',
|
|
151
|
+
groupColor: 'rgba(122, 162, 247, 0.08)',
|
|
152
|
+
description: 'turbo and base+turbo: 8 steps at turbo cfg. aesthetic and base: the steps and cfg below',
|
|
153
|
+
}),
|
|
154
|
+
// auto = er_sde on aesthetic and base, euler on the distilled ones
|
|
155
|
+
sampler: v.choice(['auto', 'er_sde', 'euler', 'euler_ancestral'], 'auto', 'sampler').ui({ group: 'sampling' }),
|
|
156
|
+
// the distilled models ignore these: 8 steps at cfg 1 is what they were distilled for
|
|
157
|
+
steps: v.int(30, { min: 1, max: 60 }).ui({
|
|
158
|
+
group: 'sampling',
|
|
159
|
+
description: 'only aesthetic and base read it: the distilled models run 8',
|
|
160
|
+
activeWhen: { model: ['aesthetic', 'base'] },
|
|
161
|
+
}),
|
|
162
|
+
cfg: v.float(4, { min: 0, max: 15 }).ui({
|
|
163
|
+
group: 'sampling',
|
|
164
|
+
description:
|
|
165
|
+
'only aesthetic and base read it: the distilled models read turbo cfg. The card suggests 4 to 5',
|
|
166
|
+
activeWhen: { model: ['aesthetic', 'base'] },
|
|
167
|
+
}),
|
|
168
|
+
turboCfg: v.int(1, { min: 1, max: 4, label: 'turbo cfg' }).ui({
|
|
169
|
+
group: 'sampling',
|
|
170
|
+
description:
|
|
171
|
+
'turbo and base+turbo only. 1 is what they were distilled for, and at 1 the negative prompt does nothing. Above 1 the negative takes effect, and each step costs about twice as long',
|
|
172
|
+
activeWhen: { model: ['turbo', 'base+turbo'] },
|
|
173
|
+
}),
|
|
174
|
+
size: v.size({ width: 1024, height: 1024 }),
|
|
175
|
+
removeBg: v.toggle(false, 'remove bg'),
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
// the final prompt, live under generate while you edit: the tags, the lora keywords, your text
|
|
179
|
+
previews: {
|
|
180
|
+
// written like the prompt box: the negative is a `- ` line, never part of the positive
|
|
181
|
+
prompt: (vars) => animaPreview({ ...animaPrompts(vars), cfg: animaCfg(vars) }),
|
|
182
|
+
},
|
|
183
|
+
build: (b, vars) => {
|
|
184
|
+
const clipLoader = b.CLIPLoader({
|
|
185
|
+
clip_name: 'qwen_3_06b_base.safetensors',
|
|
186
|
+
type: 'stable_diffusion',
|
|
187
|
+
device: 'default',
|
|
188
|
+
})
|
|
189
|
+
const spec = MODELS[vars.model]
|
|
190
|
+
let model = b.UNETLoader({ unet_name: spec.unet, weight_dtype: 'default' })._MODEL
|
|
191
|
+
let clip = clipLoader._CLIP
|
|
192
|
+
if (spec.turboLora) model = b.LoraLoaderModelOnly({ model, lora_name: TURBO_LORA, strength_model: 1 })._MODEL
|
|
193
|
+
for (const l of activeLoras(vars.loras)) {
|
|
194
|
+
const loaded = b.LoraLoader({
|
|
195
|
+
model,
|
|
196
|
+
clip,
|
|
197
|
+
lora_name: l.lora_name,
|
|
198
|
+
strength_model: l.strength_model,
|
|
199
|
+
strength_clip: l.strength_clip,
|
|
200
|
+
})
|
|
201
|
+
model = loaded._MODEL
|
|
202
|
+
clip = loaded._CLIP
|
|
203
|
+
}
|
|
204
|
+
const prompts = animaPrompts(vars)
|
|
205
|
+
const samples = b.KSampler({
|
|
206
|
+
model,
|
|
207
|
+
positive: b.CLIPTextEncode({ clip, text: prompts.positive }),
|
|
208
|
+
negative: b.CLIPTextEncode({ clip, text: prompts.negative }),
|
|
209
|
+
latent_image: b.EmptyLatentImage({ width: vars.size.width, height: vars.size.height, batch_size: 1 }),
|
|
210
|
+
seed: vars.seed,
|
|
211
|
+
steps: spec.distilled ? 8 : vars.steps,
|
|
212
|
+
cfg: animaCfg(vars),
|
|
213
|
+
sampler_name: vars.sampler === 'auto' ? (spec.distilled ? 'euler' : 'er_sde') : vars.sampler,
|
|
214
|
+
scheduler: 'simple',
|
|
215
|
+
denoise: 1,
|
|
216
|
+
})
|
|
217
|
+
const image = b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'qwen_image_vae.safetensors' }) })
|
|
218
|
+
if (vars.removeBg) {
|
|
219
|
+
// same cutout as 04: the savers drop RMBG's alpha unless the mask is rejoined, and
|
|
220
|
+
// JoinImageWithAlpha inverts the mask it gets, hence the InvertMask in front
|
|
221
|
+
const cutout = b['rmbg.RMBG']({
|
|
222
|
+
image,
|
|
223
|
+
model: 'BEN2',
|
|
224
|
+
sensitivity: 1,
|
|
225
|
+
process_res: 1024,
|
|
226
|
+
mask_blur: 0,
|
|
227
|
+
mask_offset: 0,
|
|
228
|
+
invert_output: false,
|
|
229
|
+
refine_foreground: false,
|
|
230
|
+
background: 'Alpha',
|
|
231
|
+
})
|
|
232
|
+
const rgba = b.JoinImageWithAlpha({
|
|
233
|
+
image: cutout.outputs.IMAGE,
|
|
234
|
+
alpha: b.InvertMask({ mask: cutout.outputs.MASK }),
|
|
235
|
+
})
|
|
236
|
+
b.SaveImageWebsocket({ images: rgba })
|
|
237
|
+
} else {
|
|
238
|
+
b.SaveImageWebsocket({ images: image })
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
export default animaT2i
|
|
244
|
+
|
|
245
|
+
// standalone run (skipped when another driver, the TUI or serve, imports this module)
|
|
246
|
+
if (import.meta.main) {
|
|
247
|
+
if (process.argv[2]) animaT2i.vars.prompt.set(process.argv[2])
|
|
248
|
+
if (process.argv[3]) animaT2i.vars.seed.set(Number(process.argv[3]))
|
|
249
|
+
const execution = await animaT2i.run({ log: true, save: { prefix: 'comfy-ts-example/anima-t2i' } })
|
|
250
|
+
for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
|
|
251
|
+
host.disconnect()
|
|
252
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// yue2 text-to-music on windows-1 — mirrors the official audio_yue2_text2music template
|
|
2
|
+
// a full song with vocals from a style line and tagged lyrics. ABC planning first writes a symbolic
|
|
3
|
+
// plan (melody + chords, or melody only), then the music follows it. The plan shows as a text output
|
|
4
|
+
// box inventory: yue2_3b_int8_convrot (Comfy-Org/YuE2, checkpoints/), ComfyUI ≥ 0.37
|
|
5
|
+
// PreviewAudio writes into the host's temp/ folder only (wiped at every ComfyUI boot)
|
|
6
|
+
// run directly: bun examples/rvion/11-yue2-t2a.cflow.ts ["prompt"] [seed]
|
|
7
|
+
import { ComfyTS, v } from 'comfy-ts'
|
|
8
|
+
|
|
9
|
+
const comfy = ComfyTS.create()
|
|
10
|
+
const host = comfy.host({ id: 'windows-1', host: 'desktop-im18794', port: 8085 })
|
|
11
|
+
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
12
|
+
|
|
13
|
+
export const yue2T2a = host.defineWorkflow({
|
|
14
|
+
id: 'yue2-t2a',
|
|
15
|
+
tags: ['song', 'lyrics'],
|
|
16
|
+
vars: {
|
|
17
|
+
// FIRST line = the style (language, genre, vocal, tempo, instruments), remaining lines = the
|
|
18
|
+
// lyrics with [Verse] [Chorus] [Bridge] [Outro] tags, only the words to be sung (`//` lines are comments)
|
|
19
|
+
prompt: v.prompt(
|
|
20
|
+
[
|
|
21
|
+
'English, warm female vocal, upbeat indie pop, 118 BPM, bright electric guitars, punchy drums, melodic bass, subtle synth layers, summer atmosphere, polished modern production',
|
|
22
|
+
'',
|
|
23
|
+
'[Verse]',
|
|
24
|
+
'Morning light across the window',
|
|
25
|
+
'City waking down below',
|
|
26
|
+
'I can hear the streets are calling',
|
|
27
|
+
'Feels like somewhere we should go',
|
|
28
|
+
'',
|
|
29
|
+
'[Chorus]',
|
|
30
|
+
'Run with me into the sunlight',
|
|
31
|
+
'Leave the shadows far behind',
|
|
32
|
+
"We don't need to know tomorrow",
|
|
33
|
+
'Tonight the whole world feels alive',
|
|
34
|
+
'',
|
|
35
|
+
'[Verse]',
|
|
36
|
+
'Radio playing through the open door',
|
|
37
|
+
'Laughing like we did before',
|
|
38
|
+
'Every mile becomes a memory',
|
|
39
|
+
'And I just want a little more',
|
|
40
|
+
'',
|
|
41
|
+
'[Chorus]',
|
|
42
|
+
'Run with me into the sunlight',
|
|
43
|
+
'Leave the shadows far behind',
|
|
44
|
+
"We don't need to know tomorrow",
|
|
45
|
+
'Tonight the whole world feels alive',
|
|
46
|
+
].join('\n'),
|
|
47
|
+
),
|
|
48
|
+
seed: v.seed(42, { mode: '+' }),
|
|
49
|
+
// full = melody and chords, melody = melody only (freer accompaniment), off = no plan
|
|
50
|
+
planning: v.choice(['full', 'melody', 'off'], 'full', 'abc planning'),
|
|
51
|
+
// an upper bound: the song may end sooner, when its structure is done
|
|
52
|
+
maxDuration: v.float(120, { min: 10, max: 360, label: 'max duration (s)' }),
|
|
53
|
+
},
|
|
54
|
+
build: (b, vars) => {
|
|
55
|
+
const ckpt = b.CheckpointLoaderSimple({ ckpt_name: 'yue2_3b_int8_convrot.safetensors' })
|
|
56
|
+
const [styleLine, ...lyricLines] = vars.prompt.positive.split('\n')
|
|
57
|
+
const style = styleLine ?? ''
|
|
58
|
+
const lyrics = lyricLines.join('\n').trim()
|
|
59
|
+
const mode = vars.planning === 'melody' ? 'melody' : 'full'
|
|
60
|
+
|
|
61
|
+
// an empty abc makes the music node ignore `mode`, which is what "off" means
|
|
62
|
+
const abc =
|
|
63
|
+
vars.planning === 'off'
|
|
64
|
+
? ''
|
|
65
|
+
: b.PreviewAny({
|
|
66
|
+
source: b.YuE2GenerateABC({ clip: ckpt, style, lyrics, seed: vars.seed, mode }).outputs.abc,
|
|
67
|
+
})
|
|
68
|
+
const music = b.YuE2GenerateMusic({
|
|
69
|
+
clip: ckpt,
|
|
70
|
+
style,
|
|
71
|
+
lyrics,
|
|
72
|
+
abc,
|
|
73
|
+
seed: vars.seed,
|
|
74
|
+
mode,
|
|
75
|
+
max_duration: vars.maxDuration,
|
|
76
|
+
})
|
|
77
|
+
const samples = b.KSampler({
|
|
78
|
+
model: ckpt,
|
|
79
|
+
positive: music.outputs.CONDITIONING,
|
|
80
|
+
negative: b.ConditioningZeroOut({ conditioning: music.outputs.CONDITIONING }),
|
|
81
|
+
// the music node decides the real length, the latent follows it
|
|
82
|
+
latent_image: b.EmptyYuE2LatentAudio({ seconds: music.outputs.seconds, batch_size: 1 }),
|
|
83
|
+
seed: vars.seed,
|
|
84
|
+
steps: 32,
|
|
85
|
+
cfg: 1,
|
|
86
|
+
sampler_name: 'dpm_2',
|
|
87
|
+
scheduler: 'sgm_uniform',
|
|
88
|
+
denoise: 1,
|
|
89
|
+
})
|
|
90
|
+
b.PreviewAudio({ audio: b.VAEDecodeAudio({ samples, vae: ckpt }) })
|
|
91
|
+
},
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
export default yue2T2a
|
|
95
|
+
|
|
96
|
+
// standalone run (skipped when another driver — e.g. the TUI — imports this module)
|
|
97
|
+
if (import.meta.main) {
|
|
98
|
+
if (process.argv[2]) yue2T2a.vars.prompt.set(process.argv[2])
|
|
99
|
+
if (process.argv[3]) yue2T2a.vars.seed.set(Number(process.argv[3]))
|
|
100
|
+
|
|
101
|
+
const execution = await yue2T2a.run({ log: true, save: { prefix: 'comfy-ts-example/yue2-t2a' } })
|
|
102
|
+
if (execution.text != null) console.log(`🎼 abc plan:\n${execution.text}`)
|
|
103
|
+
for (const audio of execution.audios) console.log(`🟢 ${audio.absPath}`)
|
|
104
|
+
host.disconnect()
|
|
105
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// stable audio 3 medium text-to-audio on windows-1 — mirrors the official audio_stable_audio_3_medium template
|
|
2
|
+
// instrumental music, instruments, sound effects or one-shots from one description. With `reprompt` on, a
|
|
3
|
+
// local qwen3.5 2b first rewrites the text with the template's system prompt for the category (shown as a text output)
|
|
4
|
+
// box inventory: stable_audio_3_medium (checkpoints/), t5gemma_b_b_ul2 + qwen3.5_2b_bf16 (text_encoders/), ComfyUI ≥ 0.37
|
|
5
|
+
// PreviewAudio writes into the host's temp/ folder only (wiped at every ComfyUI boot)
|
|
6
|
+
// run directly: bun examples/rvion/12-stable-audio-3-t2a.cflow.ts ["prompt"] [seed]
|
|
7
|
+
import { ComfyTS, v } from 'comfy-ts'
|
|
8
|
+
import { SA3_CATEGORIES, sa3Reprompt } from './stableAudio3Prompts.ts'
|
|
9
|
+
|
|
10
|
+
const comfy = ComfyTS.create()
|
|
11
|
+
const host = comfy.host({ id: 'windows-1', host: 'desktop-im18794', port: 8085 })
|
|
12
|
+
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
13
|
+
|
|
14
|
+
export const stableAudio3T2a = host.defineWorkflow({
|
|
15
|
+
id: 'stable-audio-3-t2a',
|
|
16
|
+
tags: ['music', 'sfx'],
|
|
17
|
+
vars: {
|
|
18
|
+
prompt: v.prompt(
|
|
19
|
+
'Tropical house track with marimba, steel drums, soft synths, smooth bass, layered percussion, and light piano riffs for sunny chill dance vibes',
|
|
20
|
+
),
|
|
21
|
+
seed: v.seed(42, { mode: '+' }),
|
|
22
|
+
category: v.choice(SA3_CATEGORIES, 'Music', 'category'),
|
|
23
|
+
reprompt: v.toggle(true, 'reprompt'),
|
|
24
|
+
seconds: v.float(60, { min: 1, max: 300, label: 'length (s)' }),
|
|
25
|
+
},
|
|
26
|
+
build: (b, vars) => {
|
|
27
|
+
const ckpt = b.CheckpointLoaderSimple({ ckpt_name: 'stable_audio_3_medium.safetensors' })
|
|
28
|
+
const clip = b.CLIPLoader({ clip_name: 't5gemma_b_b_ul2.safetensors', type: 'stable_audio', device: 'default' })
|
|
29
|
+
|
|
30
|
+
const text = vars.reprompt
|
|
31
|
+
? b.TextGenerate({
|
|
32
|
+
clip: b.CLIPLoader({
|
|
33
|
+
clip_name: 'qwen3.5_2b_bf16.safetensors',
|
|
34
|
+
type: 'stable_diffusion',
|
|
35
|
+
device: 'default',
|
|
36
|
+
}),
|
|
37
|
+
prompt: sa3Reprompt({ category: vars.category, input: vars.prompt.positive, seconds: vars.seconds }),
|
|
38
|
+
max_length: 256,
|
|
39
|
+
thinking: false,
|
|
40
|
+
sampling_mode: 'on',
|
|
41
|
+
'sampling_mode.temperature': 0.7,
|
|
42
|
+
'sampling_mode.top_k': 64,
|
|
43
|
+
'sampling_mode.top_p': 0.95,
|
|
44
|
+
'sampling_mode.min_p': 0.05,
|
|
45
|
+
'sampling_mode.repetition_penalty': 1.05,
|
|
46
|
+
'sampling_mode.seed': vars.seed,
|
|
47
|
+
}).outputs.generated_text
|
|
48
|
+
: vars.prompt.positive
|
|
49
|
+
if (typeof text !== 'string') b.PreviewAny({ source: text })
|
|
50
|
+
|
|
51
|
+
const samples = b.KSampler({
|
|
52
|
+
model: ckpt,
|
|
53
|
+
positive: b.CLIPTextEncode({ clip, text }),
|
|
54
|
+
negative: b.CLIPTextEncode({ clip, text: '' }),
|
|
55
|
+
latent_image: b.EmptyLatentAudio({ seconds: vars.seconds, batch_size: 1 }),
|
|
56
|
+
seed: vars.seed,
|
|
57
|
+
steps: 8,
|
|
58
|
+
cfg: 1,
|
|
59
|
+
sampler_name: 'lcm',
|
|
60
|
+
scheduler: 'simple',
|
|
61
|
+
denoise: 1,
|
|
62
|
+
})
|
|
63
|
+
b.PreviewAudio({ audio: b.VAEDecodeAudio({ samples, vae: ckpt }) })
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
export default stableAudio3T2a
|
|
68
|
+
|
|
69
|
+
// standalone run (skipped when another driver — e.g. the TUI — imports this module)
|
|
70
|
+
if (import.meta.main) {
|
|
71
|
+
if (process.argv[2]) stableAudio3T2a.vars.prompt.set(process.argv[2])
|
|
72
|
+
if (process.argv[3]) stableAudio3T2a.vars.seed.set(Number(process.argv[3]))
|
|
73
|
+
|
|
74
|
+
const execution = await stableAudio3T2a.run({ log: true, save: { prefix: 'comfy-ts-example/stable-audio-3-t2a' } })
|
|
75
|
+
if (execution.text != null) console.log(`📝 reprompted: ${execution.text}`)
|
|
76
|
+
for (const audio of execution.audios) console.log(`🟢 ${audio.absPath}`)
|
|
77
|
+
host.disconnect()
|
|
78
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// ace-step 1.5 xl text-to-music on windows-1 — mirrors the official audio_ace_step1_5_xl_{turbo,sft,base} templates
|
|
2
|
+
// a full song with vocals from a caption and tagged lyrics. Three models behind one choice, each with its
|
|
3
|
+
// template's sampling: turbo 8 steps at cfg 1, sft 50 at cfg 7, base 50 at cfg 6
|
|
4
|
+
// box inventory: acestep_v1.5_xl_{turbo,sft,base}_bf16 (diffusion_models/), ace_1.5_vae (vae/),
|
|
5
|
+
// qwen_0.6b_ace15 + qwen_4b_ace15 (text_encoders/), ComfyUI ≥ 0.37
|
|
6
|
+
// PreviewAudio writes into the host's temp/ folder only (wiped at every ComfyUI boot)
|
|
7
|
+
// run directly: bun examples/rvion/13-ace-step-15-xl-t2a.cflow.ts ["prompt"] [seed]
|
|
8
|
+
import { ComfyTS, v } from 'comfy-ts'
|
|
9
|
+
|
|
10
|
+
const comfy = ComfyTS.create()
|
|
11
|
+
const host = comfy.host({ id: 'windows-1', host: 'desktop-im18794', port: 8085 })
|
|
12
|
+
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
13
|
+
|
|
14
|
+
const MODELS = {
|
|
15
|
+
turbo: { unet: 'acestep_v1.5_xl_turbo_bf16.safetensors', steps: 8, cfg: 1, topP: 0.9 },
|
|
16
|
+
sft: { unet: 'acestep_v1.5_xl_sft_bf16.safetensors', steps: 50, cfg: 7, topP: 1 },
|
|
17
|
+
base: { unet: 'acestep_v1.5_xl_base_bf16.safetensors', steps: 50, cfg: 6, topP: 0.9 },
|
|
18
|
+
} as const
|
|
19
|
+
|
|
20
|
+
const KEYS = [
|
|
21
|
+
'C major',
|
|
22
|
+
'C# major',
|
|
23
|
+
'Db major',
|
|
24
|
+
'D major',
|
|
25
|
+
'D# major',
|
|
26
|
+
'Eb major',
|
|
27
|
+
'E major',
|
|
28
|
+
'F major',
|
|
29
|
+
'F# major',
|
|
30
|
+
'Gb major',
|
|
31
|
+
'G major',
|
|
32
|
+
'G# major',
|
|
33
|
+
'Ab major',
|
|
34
|
+
'A major',
|
|
35
|
+
'A# major',
|
|
36
|
+
'Bb major',
|
|
37
|
+
'B major',
|
|
38
|
+
'C minor',
|
|
39
|
+
'C# minor',
|
|
40
|
+
'Db minor',
|
|
41
|
+
'D minor',
|
|
42
|
+
'D# minor',
|
|
43
|
+
'Eb minor',
|
|
44
|
+
'E minor',
|
|
45
|
+
'F minor',
|
|
46
|
+
'F# minor',
|
|
47
|
+
'Gb minor',
|
|
48
|
+
'G minor',
|
|
49
|
+
'G# minor',
|
|
50
|
+
'Ab minor',
|
|
51
|
+
'A minor',
|
|
52
|
+
'A# minor',
|
|
53
|
+
'Bb minor',
|
|
54
|
+
'B minor',
|
|
55
|
+
] as const
|
|
56
|
+
|
|
57
|
+
export const aceStep15XlT2a = host.defineWorkflow({
|
|
58
|
+
id: 'ace-step-15-xl-t2a',
|
|
59
|
+
tags: ['song', 'lyrics'],
|
|
60
|
+
vars: {
|
|
61
|
+
// FIRST line = the caption (genre, instruments, vocals, production), remaining lines = the lyrics
|
|
62
|
+
// with [Verse] [Chorus] [Bridge] [Outro] tags (`//` lines are comments)
|
|
63
|
+
prompt: v.prompt(
|
|
64
|
+
[
|
|
65
|
+
'A lush neo-soul track anchored by a warm Rhodes electric piano playing rich ninth chords over a loose, soulful live drum groove with ghost notes and rim shots. A fretless bass sings beneath the harmony. The lead vocalist is a powerful, expressive woman moving between a smoky chest voice and an airy falsetto. Warm, analog production with subtle tape saturation.',
|
|
66
|
+
'',
|
|
67
|
+
'[Verse 1]',
|
|
68
|
+
'You never call when the neon goes dark',
|
|
69
|
+
'Just send a signal like an afterthought',
|
|
70
|
+
'I learned to read the silence between the lines',
|
|
71
|
+
"And honey that's a language I know too well by now",
|
|
72
|
+
'',
|
|
73
|
+
'[Chorus]',
|
|
74
|
+
"I'm done rewriting your story in my head",
|
|
75
|
+
"Done saving room for someone who's already gone",
|
|
76
|
+
"I'll keep the record on",
|
|
77
|
+
"But I'll stop singing your part",
|
|
78
|
+
'',
|
|
79
|
+
'[Verse 2]',
|
|
80
|
+
'The coffee shop still plays our favourite song',
|
|
81
|
+
'I ordered something different, stayed too long',
|
|
82
|
+
'But every note just proved that I was right',
|
|
83
|
+
'To let the whole thing go before it burned my life',
|
|
84
|
+
'',
|
|
85
|
+
'[Outro]',
|
|
86
|
+
].join('\n'),
|
|
87
|
+
),
|
|
88
|
+
seed: v.seed(42, { mode: '+' }),
|
|
89
|
+
model: v.choice(['turbo', 'sft', 'base'], 'turbo', 'model'),
|
|
90
|
+
seconds: v.float(120, { min: 10, max: 300, label: 'length (s)' }),
|
|
91
|
+
bpm: v.int(120, { min: 10, max: 300, label: 'bpm' }),
|
|
92
|
+
key: v.choice(KEYS, 'E minor', 'key'),
|
|
93
|
+
timeSignature: v.choice(['2', '3', '4', '6'], '4', 'beats per bar'),
|
|
94
|
+
language: v.choice(['en', 'fr', 'es', 'de', 'it', 'pt', 'ja', 'ko', 'zh'], 'en', 'language'),
|
|
95
|
+
},
|
|
96
|
+
build: (b, vars) => {
|
|
97
|
+
const m = MODELS[vars.model]
|
|
98
|
+
const [captionLine, ...lyricLines] = vars.prompt.positive.split('\n')
|
|
99
|
+
const clip = b.DualCLIPLoader({
|
|
100
|
+
clip_name1: 'qwen_0.6b_ace15.safetensors',
|
|
101
|
+
clip_name2: 'qwen_4b_ace15.safetensors',
|
|
102
|
+
type: 'ace',
|
|
103
|
+
device: 'default',
|
|
104
|
+
})
|
|
105
|
+
const positive = b['TextEncodeAceStepAudio1.5']({
|
|
106
|
+
clip,
|
|
107
|
+
tags: captionLine ?? '',
|
|
108
|
+
lyrics: lyricLines.join('\n').trim(),
|
|
109
|
+
seed: vars.seed,
|
|
110
|
+
bpm: vars.bpm,
|
|
111
|
+
duration: vars.seconds,
|
|
112
|
+
timesignature: vars.timeSignature,
|
|
113
|
+
language: vars.language,
|
|
114
|
+
keyscale: vars.key,
|
|
115
|
+
generate_audio_codes: true,
|
|
116
|
+
cfg_scale: 2,
|
|
117
|
+
temperature: 0.85,
|
|
118
|
+
top_p: m.topP,
|
|
119
|
+
top_k: 0,
|
|
120
|
+
min_p: 0,
|
|
121
|
+
})
|
|
122
|
+
const samples = b.KSampler({
|
|
123
|
+
model: b.ModelSamplingAuraFlow({
|
|
124
|
+
model: b.UNETLoader({ unet_name: m.unet, weight_dtype: 'default' }),
|
|
125
|
+
shift: 3,
|
|
126
|
+
}),
|
|
127
|
+
positive,
|
|
128
|
+
negative: b.ConditioningZeroOut({ conditioning: positive }),
|
|
129
|
+
latent_image: b['EmptyAceStep1.5LatentAudio']({ seconds: vars.seconds, batch_size: 1 }),
|
|
130
|
+
seed: vars.seed,
|
|
131
|
+
steps: m.steps,
|
|
132
|
+
cfg: m.cfg,
|
|
133
|
+
sampler_name: 'euler',
|
|
134
|
+
scheduler: 'simple',
|
|
135
|
+
denoise: 1,
|
|
136
|
+
})
|
|
137
|
+
b.PreviewAudio({
|
|
138
|
+
audio: b.VAEDecodeAudio({ samples, vae: b.VAELoader({ vae_name: 'ace_1.5_vae.safetensors' }) }),
|
|
139
|
+
})
|
|
140
|
+
},
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
export default aceStep15XlT2a
|
|
144
|
+
|
|
145
|
+
// standalone run (skipped when another driver — e.g. the TUI — imports this module)
|
|
146
|
+
if (import.meta.main) {
|
|
147
|
+
if (process.argv[2]) aceStep15XlT2a.vars.prompt.set(process.argv[2])
|
|
148
|
+
if (process.argv[3]) aceStep15XlT2a.vars.seed.set(Number(process.argv[3]))
|
|
149
|
+
|
|
150
|
+
const execution = await aceStep15XlT2a.run({ log: true, save: { prefix: 'comfy-ts-example/ace-step-15-xl-t2a' } })
|
|
151
|
+
for (const audio of execution.audios) console.log(`🟢 ${audio.absPath}`)
|
|
152
|
+
host.disconnect()
|
|
153
|
+
}
|