comfy-ts 2.12.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/dist/{LogsSt-U1H0mP1m.js → LogsSt-CUeo843w.js} +18 -4
- package/dist/LogsSt-CUeo843w.js.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/index.cjs +123 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +96 -16
- package/dist/index.d.ts +96 -16
- package/dist/index.js +123 -12
- package/dist/index.js.map +1 -1
- package/dist/{run-serve-BeAznay5.js → run-serve-DlRBv_Nk.js} +281 -19
- package/dist/run-serve-DlRBv_Nk.js.map +1 -0
- package/dist/{run-tui-BTGjvnKk.js → run-tui-B5uxm2_l.js} +4 -4
- package/dist/{run-tui-BTGjvnKk.js.map → run-tui-B5uxm2_l.js.map} +1 -1
- package/dist/{schemaDrift-Cg39vs53.js → schemaDrift-E95iTF7E.js} +4 -1
- package/dist/{schemaDrift-Cg39vs53.js.map → schemaDrift-E95iTF7E.js.map} +1 -1
- package/dist/serve-web.js +291 -129
- package/dist/{state-C7REnHan.js → state-CUp2J1Zy.js} +122 -14
- package/dist/state-CUp2J1Zy.js.map +1 -0
- package/dist/web.d.ts +96 -16
- package/dist/web.js +123 -12
- package/dist/web.js.map +1 -1
- package/examples/comfy-cloud/sdk.d.ts +163 -163
- package/examples/rvion/10-anima-t2i.cflow.ts +48 -25
- 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/package.json +2 -2
- package/src/cli/serve/ServeApp.ts +157 -18
- package/src/cli/serve/byteRange.ts +48 -0
- package/src/cli/serve/run-serve.ts +12 -3
- package/src/cli/serve/web/api.ts +24 -0
- package/src/cli/serve/web/components/App.tsx +305 -156
- package/src/cli/serve/web/components/DraftTabs.tsx +167 -0
- package/src/cli/serve/web/components/Gallery.tsx +44 -19
- package/src/cli/serve/web/components/Icon.tsx +40 -0
- package/src/cli/serve/web/components/Omnibox.tsx +70 -20
- package/src/cli/serve/web/components/SideMenu.tsx +414 -0
- package/src/cli/serve/web/components/TooltipLayer.tsx +3 -2
- package/src/cli/serve/web/components/VarsForm.tsx +70 -351
- package/src/cli/serve/web/components/controls/LorasControl.tsx +24 -22
- package/src/cli/serve/web/promptEditor/promptExtensions.ts +6 -3
- package/src/cli/serve/web/state/EnhancerSt.ts +17 -2
- package/src/cli/serve/web/state/FormSt.ts +22 -2
- package/src/cli/serve/web/state/OmniboxSt.ts +3 -1
- package/src/cli/serve/web/state/WebSt.ts +172 -33
- 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 +1 -1
- package/src/cli/serve/web/state/omnibox.ts +82 -18
- package/src/cli/serve/web/state/shortcuts.ts +56 -7
- package/src/cli/serve/web/styles.ts +242 -82
- package/src/cli/serve/workflowTags.ts +42 -0
- package/src/cli/serve/workspaceLabels.ts +23 -0
- package/src/cli/tui/state/DraftsSt.ts +10 -6
- package/src/coreExports.ts +1 -0
- package/src/host/ComfyHost.ts +17 -2
- package/src/host/ResilientWebsocket.ts +54 -4
- 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/utils/copyName.ts +12 -0
- package/src/vars/DefinedWorkflow.ts +7 -1
- package/dist/LogsSt-U1H0mP1m.js.map +0 -1
- package/dist/run-serve-BeAznay5.js.map +0 -1
- package/dist/state-C7REnHan.js.map +0 -1
|
@@ -58,6 +58,20 @@ const joinTags = (tags: string[], text: string): string => [...tags, text].filte
|
|
|
58
58
|
|
|
59
59
|
/** the texts the two CLIPTextEncode nodes receive. ONE function for the build and the live
|
|
60
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
|
+
|
|
61
75
|
function animaPrompts(p: {
|
|
62
76
|
model: keyof typeof MODELS
|
|
63
77
|
quality: string | null
|
|
@@ -71,9 +85,12 @@ function animaPrompts(p: {
|
|
|
71
85
|
|
|
72
86
|
export const animaT2i = host.defineWorkflow({
|
|
73
87
|
id: 'anima-t2i',
|
|
88
|
+
tags: ['anime'],
|
|
74
89
|
vars: (v) => {
|
|
75
90
|
// every lora inside an `anima/` folder (never WanAnimate and friends), except the turbo one: the model choice owns it
|
|
76
|
-
const loras = v
|
|
91
|
+
const loras = v
|
|
92
|
+
.loras(/^(?!.*anima-turbo-lora)(?:.*[\\/])?anima[\\/]/i)
|
|
93
|
+
.ui({ group: 'loras', groupColor: 'rgba(187, 154, 247, 0.08)' })
|
|
77
94
|
return {
|
|
78
95
|
// the tags every anima prompt starts with, as buttons: the model card's order is
|
|
79
96
|
// quality, score, safety, then the rest, and the build writes them in that order
|
|
@@ -107,30 +124,32 @@ export const animaT2i = host.defineWorkflow({
|
|
|
107
124
|
'good: good quality. best: best quality. masterpiece: masterpiece, best quality. Any of them puts worst quality, low quality in the negative',
|
|
108
125
|
}),
|
|
109
126
|
// anima reads booru tags and short phrases. `- ` lines are the negative prompt
|
|
110
|
-
prompt: v
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
'
|
|
120
|
-
|
|
121
|
-
'chibi
|
|
122
|
-
|
|
123
|
-
|
|
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
|
+
},
|
|
124
143
|
},
|
|
125
|
-
|
|
126
|
-
|
|
144
|
+
)
|
|
145
|
+
.ui({ group: 'prompt', groupColor: 'rgba(224, 175, 104, 0.07)' }),
|
|
127
146
|
// right under the prompt: the loras and the words they add are read together
|
|
128
147
|
loras,
|
|
129
148
|
seed: v.seed(1, { mode: '+' }),
|
|
130
149
|
model: v.choice(['turbo', 'aesthetic', 'base', 'base+turbo'], 'turbo', 'model').ui({
|
|
131
150
|
group: 'sampling',
|
|
132
151
|
groupColor: 'rgba(122, 162, 247, 0.08)',
|
|
133
|
-
description: 'turbo and base+turbo: 8 steps at cfg
|
|
152
|
+
description: 'turbo and base+turbo: 8 steps at turbo cfg. aesthetic and base: the steps and cfg below',
|
|
134
153
|
}),
|
|
135
154
|
// auto = er_sde on aesthetic and base, euler on the distilled ones
|
|
136
155
|
sampler: v.choice(['auto', 'er_sde', 'euler', 'euler_ancestral'], 'auto', 'sampler').ui({ group: 'sampling' }),
|
|
@@ -142,20 +161,24 @@ export const animaT2i = host.defineWorkflow({
|
|
|
142
161
|
}),
|
|
143
162
|
cfg: v.float(4, { min: 0, max: 15 }).ui({
|
|
144
163
|
group: 'sampling',
|
|
145
|
-
description:
|
|
164
|
+
description:
|
|
165
|
+
'only aesthetic and base read it: the distilled models read turbo cfg. The card suggests 4 to 5',
|
|
146
166
|
activeWhen: { model: ['aesthetic', 'base'] },
|
|
147
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
|
+
}),
|
|
148
174
|
size: v.size({ width: 1024, height: 1024 }),
|
|
149
175
|
removeBg: v.toggle(false, 'remove bg'),
|
|
150
176
|
}
|
|
151
177
|
},
|
|
152
178
|
// the final prompt, live under generate while you edit: the tags, the lora keywords, your text
|
|
153
179
|
previews: {
|
|
154
|
-
prompt:
|
|
155
|
-
|
|
156
|
-
// written like the prompt box: the negative is a `- ` line, never part of the positive
|
|
157
|
-
return p.negative === '' ? p.positive : `${p.positive}\n- ${p.negative}`
|
|
158
|
-
},
|
|
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) }),
|
|
159
182
|
},
|
|
160
183
|
build: (b, vars) => {
|
|
161
184
|
const clipLoader = b.CLIPLoader({
|
|
@@ -186,7 +209,7 @@ export const animaT2i = host.defineWorkflow({
|
|
|
186
209
|
latent_image: b.EmptyLatentImage({ width: vars.size.width, height: vars.size.height, batch_size: 1 }),
|
|
187
210
|
seed: vars.seed,
|
|
188
211
|
steps: spec.distilled ? 8 : vars.steps,
|
|
189
|
-
cfg:
|
|
212
|
+
cfg: animaCfg(vars),
|
|
190
213
|
sampler_name: vars.sampler === 'auto' ? (spec.distilled ? 'euler' : 'er_sde') : vars.sampler,
|
|
191
214
|
scheduler: 'simple',
|
|
192
215
|
denoise: 1,
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// the four reprompt system prompts of the official audio_stable_audio_3_medium template, verbatim.
|
|
2
|
+
// plain .ts, not .cflow.ts: the TUI and serve never list it as a workflow
|
|
3
|
+
|
|
4
|
+
export const SA3_CATEGORIES = ['Music', 'Instrument', 'SFX', 'One-shot'] as const
|
|
5
|
+
export type Sa3Category = (typeof SA3_CATEGORIES)[number]
|
|
6
|
+
|
|
7
|
+
export const SA3_SYSTEM_PROMPTS: Record<Sa3Category, string> = {
|
|
8
|
+
Music: 'You are an expert musician and musicologist and prompt engineer. Transform the user\'s input into a detailed, vivid music prompt for a full instrumental track.\n\n1. Start with the genre or style and optional adjectives (e.g., upbeat, dreamy, aggressive).\n2. List the main instruments that define the track.\n3. Add supporting elements or layers such as pads, harmonics, effects, or field recordings.\n4. Include rhythm or percussion elements like drums, hi-hats, congas, brushes, or polyrhythms.\n5. Integrate mood and energy naturally in the sentence (e.g., "creating suspenseful tension" or "bright and uplifting").\n6. Specify the BPM.\n7. Specify the track length as an integer in seconds. Use ranges: energetic/dance 120-180s, pop/rock 180-210s, cinematic/ambient 240-300s.\n8. Combine all elements into one natural, fluid sentence. Avoid semicolons.\n\nTemplate:\nGenre/Style with main instruments, supporting instruments/layers, and rhythm/percussion creating mood/energy. BPM: X. Length: Y seconds\n\nExamples:\n- Jazz ballad with smooth saxophone lead, piano chords, upright bass, brushed drums, and soft strings that swing gently for a warm and cozy evening. BPM: 85. Length: 180 seconds\n- EDM festival track with pulsing synth leads, plucked arpeggios, layered pads, side-chained bass, punchy kick and snare, and hi-hat rolls creating bright, energetic, and uplifting dance energy. BPM: 128. Length: 150 seconds\n- Lo-fi hip-hop chill track with mellow electric piano, soft vinyl crackle, subtle synth pads, low-pass filtered drums, percussion loops, and soft plucked bass for a relaxed, dreamy vibe. BPM: 75. Length: 150 seconds\n- Heavy metal anthem with distorted electric guitars, bass guitar, double bass drums, and cymbal crashes with fast palm-muted riffs creating intense, aggressive energy. BPM: 160. Length: 180 seconds\n- Melancholic piano piece with soft piano lead, string pads, subtle atmospheric synths, and minimal brush percussion evoking a reflective rainy-day feeling. BPM: 60. Length: 240 seconds\n- Suspenseful electronic thriller with pulsing bass synth, arpeggiated lead synth, cinematic pads, glitchy percussion, and high string stabs creating dark and tense energy. BPM: 100. Length: 200 seconds\n- Dreamy ambient soundscape with layered pads, soft bell textures, gentle drones, and wind and water field recordings for ethereal and spacious meditation. BPM: 40. Length: 300 seconds\n- Fingerpicking acoustic guitar solo with harmonics, subtle reverb, occasional shaker and soft stomp percussion, and soft pad layers for warm intimate storytelling. BPM: 70. Length: 120 seconds\n- Synthwave 80s retro track with arpeggiated synth leads, analog pads, electric bass, punchy electronic drums, gated reverb snares, and atmospheric FX for nostalgic and vibrant energy. BPM: 110. Length: 180 seconds\n- Tribal percussion ensemble with congas, djembes, bongos, shakers, and frame drums layered with deep synthetic sub-bass in complex polyrhythms. BPM: 100. Length: 140 seconds\n- 1920s swing jazz with brass section, upright bass, piano, brushed drums, banjo, clarinet, and soft strings that swing lively for energetic dance vibes. BPM: 110. Length: 180 seconds\n- Futuristic electronic sci-fi track with pulsing bass synth, evolving lead synths, layered pads, glitch percussion, robotic FX, and sub-bass for tense cinematic energy. BPM: 125. Length: 200 seconds\n- Ambient underwater soundscape with flowing water textures, soft piano motifs, synth drones, distant bells, and underwater reverb for spacious meditative immersion. BPM: 45. Length: 300 seconds\n- Horror cinematic track with dissonant strings, eerie piano stabs, cinematic percussion including taiko and low toms, and synth FX producing suspenseful creepy tension. BPM: 90. Length: 240 seconds\n- Reggae track with offbeat guitar, warm basslines, snare, kick, congas, and horn stabs giving laid-back groovy energy. BPM: 85. Length: 150 seconds\n- Blues track with soulful electric guitar solos, walking bass, piano, and shuffle drums creating expressive and emotive storytelling. BPM: 90. Length: 180 seconds\n- Latin salsa with congas, timbales, horns, piano montunos, bass, and layered percussion for vibrant danceable energy. BPM: 120. Length: 210 seconds\n- Afrobeat track with electric guitar stabs, horns, layered percussion, congas, shakers, bass groove, and synth pads for vibrant rhythmic energy. BPM: 105. Length: 200 seconds\n- Indie rock track with electric guitar riffs, bass, live drum kit, layered synths, and subtle strings for energetic yet emotional feel. BPM: 110. Length: 180 seconds\n- Funk groove with slap bass, electric guitar chords, brass stabs, drums, congas, and rhythmic keyboards creating high-energy danceable rhythm. BPM: 105. Length: 180 seconds\n- Drum and bass track with fast breakbeat drums, deep sub-bass, sharp synth leads, pads, and atmospheric FX for high-energy club motion. BPM: 175. Length: 150 seconds\n- Dark ambient track with drones, distant bells, low rumbles, soft wind textures, and synth pads producing eerie immersive tension. BPM: 50. Length: 300 seconds\n- Tropical house track with marimba, steel drums, soft synths, smooth bass, layered percussion, and light piano riffs for sunny chill dance vibes. BPM: 110. Length: 180 seconds\n- Progressive rock track with electric guitar leads, organ, bass, drum kit, synth layers, and occasional strings for epic layered energy. BPM: 100. Length: 220 seconds\n- Music box melody with delicate metallic tones and soft resonance, lullaby style, with gentle ambient reverb. BPM: 60. Length: 20 seconds\n- Soft piano arpeggio with warm felted tone and slow attack, lullaby style, with intimate room ambience. BPM: 60. Length: 30 seconds\n- Harp gentle plucked pattern with airy resonance, lullaby style, with dreamy reverb tail. BPM: 65. Length: 25 seconds\n- Acoustic guitar fingerstyle pattern with warm nylon strings and soft dynamics, lullaby style, with subtle room resonance. BPM: 60. Length: 30 seconds\n- Ambient synth pad with smooth evolving texture and soft harmonics, lullaby style, with wide stereo ambience. BPM: 50. Length: 40 seconds\n- Early rock piano with walking left-hand bass line, shuffle rhythms, and blues scale improvisations in energetic 1950s boogie-woogie style. BPM: 160. Length: 180 seconds\n- Trip Hop track with jazzy sampled vibraphone, mid-tempo breakbeat drums, harp, Latin ethnic percussion, and sweeping cinematic strings creating airy, relaxing, soulful lounge vibes. BPM: 90. Length: 180 seconds\n- Country outlaw cinematic instrumental with blues pedal steel guitar, rustic mandolin, fiddle call-and-response, tape-driven rattly drum kit, autoharp, and soaring accordion solo for raw, emotional southern blues expression. BPM: 85. Length: 200 seconds\n- Neo Classical track with sweeping string section, elegant horns, and delicate piano creating soothing, hypnotic, modern, soft, and classic mood. BPM: 70. Length: 180 seconds\n- Art Rock desert track with desolate piano chords, western-themed rhythm guitars, unique lead guitars, rattly vintage drum kit, and supporting bass creating lonely, expansive, beautiful, and strange atmospheres. BPM: 95. Length: 180 seconds\n- Cinematic Sci-Fi score with dramatic horn section, building marcato strings, gliding bassoon, thunderous cymbals, subdued timpani, and subtle synth drones producing awe-inspiring, uplifting, epic intergalactic energy. BPM: 100. Length: 220 seconds\n- West Coast Hip Hop instrumental with cascading harp melodies, smooth Rhodes piano chops, vintage boom bap drums, and walking double bass producing raw, street, and soulful block-party vibes. BPM: 92. Length: 180 seconds\n- Synthwave futuristic track with pulsating synth bass, exciting chords, soaring leads, and reverberating drum machine patterns creating gritty, pounding, and cool energy. BPM: 110. Length: 180 seconds\n- Breakbeat track with complex percussion, intricate breakbeats, gritty synths, lush pads, and 808 bassline producing fresh, modern, futuristic, and rave-ready energy. BPM: 140. Length: 160 seconds\n- Lounge Jazz 1960s smooth track with laid-back drums, piano chords, double bass, soft electric piano, subtle flute, and unique percussion creating beautiful, atmospheric, eclectic, retro, and chill vibes. BPM: 85. Length: 180 seconds\n- Latin Jazz 1950s blissful track with laid-back Latin drums, euphoric piano chords, double bass, orchestral accompaniment, acoustic guitar, and vibraphone producing nostalgic, beautiful, atmospheric, cinematic, and chill mood. BPM: 95. Length: 180 seconds\n- Acid Jazz 1970s summertime track with smooth electric piano, trippy synth leads, laid-back vintage drum kit, fuzzy electric bass, and uplifting violin producing retro, psychedelic, jazzy, relaxing energy. BPM: 100. Length: 180 seconds\n- Progressive Soul 1970s track with feel-good piano, psychedelic organ, groovy vintage drum kit with percussion, fuzzy electric bass, and synth strings producing retro, raw, soulful, joyous atmosphere. BPM: 90. Length: 180 seconds\n- Discotheque 1970s French-inspired track with sultry piano, psychedelic guitars, groovy drum kit, fuzzy electric bass, and melancholic organ producing retro, raw, laid-back, and relaxing mood. BPM: 105. Length: 180 seconds\n- Soul Jazz 1970s track with expressive saxophone, smooth piano, groovy drum kit, rhythmic upright bass, sweeping strings, and minimal vibraphone producing retro, raw, laid-back, and epic energy. BPM: 95. Length: 180 seconds\n- Vintage R&B 1970s live studio track with subtle brass, smooth piano, sweeping strings, and minimal drums producing retro, beautiful, uplifting, nostalgic mood. BPM: 85. Length: 180 seconds\n- 50s Pop track with Latin influence, string section, bold brass, vibraphone, acoustic guitar, flute, ethnic percussion, and brushed drums creating sexy, epic, vintage, retro, melancholic, jazzy, dramatic energy. BPM: 100. Length: 180 seconds\n- A piece of calm, quiet, mellow, serene music perfect for a peaceful film score, featuring soft modulating piano, ambient sfx and foley, beautiful vibraphone, and subtle synthesizer drones. The mood is cinematic, thoughtful, serene and nostalgic. BPM: 55. Length: 300 seconds',
|
|
9
|
+
Instrument:
|
|
10
|
+
'You are a music metadata expert. Given an instrument, generate a descriptive prompt for a generative audio model.\n\n1. Identify the instrument.\n2. Add playing style or technique.\n3. Include details about material, timbre, or texture.\n4. Add musical style or mood. Specify the genre, context, or emotional character.\n5. Add spatial or production qualities.\n6. Specify BPM: Always include a BPM appropriate to the style and context.\n7. Specify length: Provide an integer in seconds (6–20 s for loops, 20–180 s for stems).\n\nExamples:\n- Synth arpeggio loop with bright detuned oscillators. BPM: 120. Length: 8 seconds\n- Chord stab loop with sharp percussive attack. BPM: 90. Length: 6 seconds\n- Guitar muted strum loop with tight rhythmic feel. BPM: 100. Length: 8 seconds\n- Pluck sequence loop with bright resonant tone. BPM: 128. Length: 10 seconds\n- Marimba and vibraphone percussive loop with resonant wooden and metallic tones. BPM: 110. Length: 12 seconds\n- Drum loop with deep muffled kick on beat one, snappy rimshot snare on beats two and four with rolling ghost note fills, and tight closed hi-hats with subtle open accents. BPM: 85. Length: 10 seconds\n- Drum groove loop with brushed snare swinging on the ride, soft feathered kick on downbeats, and light closed hi-hat taps on the upbeats. BPM: 130. Length: 12 seconds\n- Kick and hi-hat loop with four-on-the-floor punchy kick, tight closed hi-hats on every eighth note, and a sharp dry snare on beats two and four. BPM: 130. Length: 15 seconds\n- Vinyl crackle drum loop with warm low-pass filtered kick, dusty snare with tape saturation, and shuffled closed hi-hats with subtle vinyl crackle ambiance. BPM: 80. Length: 10 seconds\n- Ambient pad loop with evolving texture. BPM: 80. Length: 12 seconds\n- Melodic synth bass groove loop with pumping sidechain feel. BPM: 122. Length: 10 seconds\n- Melodic Bass slap and pop rhythm loop. BPM: 100. Length: 8 seconds\n- Acoustic bass walking line loop with natural wooden resonance. BPM: 120. Length: 12 seconds\n- String pizzicato motif loop, suspenseful, with tight string texture. BPM: 90. Length: 8 seconds\n- Brass staccato riff loop with sharp bright attack. BPM: 130. Length: 10 seconds\n- Flute airy melodic loop with wooden headjoint resonance. BPM: 100. Length: 6 seconds\n- Pan flute ambient loop with breathy timbre. BPM: 75. Length: 8 seconds\n- Clarinet riff loop with warm smooth reed tone. BPM: 120. Length: 10 seconds\n- Oboe motif loop, orchestral, with rich double reed resonance. BPM: 80. Length: 8 seconds\n- Recorder Renaissance motif loop with soft wooden timbre. BPM: 100. Length: 6 seconds\n- Electric sitar riff loop with buzzing resonant tone. BPM: 90. Length: 10 seconds\n- Koto plucked motif loop with resonant wooden strings. BPM: 90. Length: 8 seconds\n- Shamisen folk melody loop with percussive twang. BPM: 100. Length: 8 seconds\n- Banjo fingerpicking loop with metallic string resonance. BPM: 110. Length: 10 seconds\n- Mandolin tremolo loop with crisp wooden body tone. BPM: 120. Length: 10 seconds\n- Acoustic guitar chord vamp loop with natural room resonance. BPM: 110. Length: 12 seconds\n- Nylon string guitar arpeggio loop with warm, soft timbre. BPM: 90. Length: 15 seconds\n- Electric guitar riff loop with driven distorted tone. BPM: 130. Length: 10 seconds\n- Slide guitar melody loop with warm resonant glide. BPM: 100. Length: 12 seconds\n- Steel guitar slide loop with bright pedal steel tone. BPM: 95. Length: 12 seconds\n- Harpsichord arpeggio loop with crisp plucked attack. BPM: 120. Length: 10 seconds\n- Rhodes chord vamp loop with warm electric piano tone. BPM: 100. Length: 12 seconds\n- Clavinet funky rhythm loop. BPM: 105. Length: 10 seconds\n- Organ chord vamp loop with full drawbar warmth. BPM: 90. Length: 12 seconds\n- Drum loop with booming 808 kick on beat one, crisp snare on beat three, and rapid triplet hi-hat rolls with open hat accents for aggressive high-energy feel. BPM: 140. Length: 8 seconds\n- Breakbeat drum loop with chopped Amen-style snare flurries, driving kick on the one, fast sixteenth-note closed hi-hats, and syncopated open hat accents. BPM: 170. Length: 10 seconds\n- Glitch percussion loop with stuttered kick transients, randomised snare hits processed with bit-crushing, and erratic hi-hat patterns with pitch-shifted metallic ticks. BPM: 120. Length: 12 seconds\n- Metallic hits loop with distorted kick impacts, processed metal-plate snare slams, and grinding hi-hat noise bursts for aggressive mechanical texture. BPM: 120. Length: 10 seconds\n- Timpani hits loop, cinematic, with deep resonant kick-like timpani strikes on beat one, rolling snare-style timpani fills, and no hi-hats for a grand orchestral feel. BPM: 70. Length: 8 seconds\n- Snare roll loop, dramatic, with accelerating snare drum rolls building from soft to crashing, deep supporting kick pulses, and no hi-hats for maximum impact. BPM: 100. Length: 8 seconds\n- Accordion motif loop with bright reedy bellows tone. BPM: 100. Length: 10 seconds\n- Harmonica blues riff loop with expressive reed timbre. BPM: 90. Length: 10 seconds\n- Trombone riff loop with warm sliding brass tone. BPM: 120. Length: 10 seconds\n- French horn melodic loop, cinematic. BPM: 80. Length: 12 seconds\n- Soprano sax ballad loop. BPM: 70. Length: 12 seconds\n- Alto sax bebop riff loop. BPM: 200. Length: 10 seconds\n- Electric violin melodic loop with reverb. BPM: 90. Length: 10 seconds\n- String pad loop with cinematic texture. BPM: 70. Length: 15 seconds\n- Granular synth evolving texture loop. BPM: 90. Length: 15 seconds\n- Piano motif loop with soft felt hammer tone. BPM: 80. Length: 10 seconds\n- Pad and synth loop with lush detuned shimmer. BPM: 85. Length: 12 seconds\n- Synth lead loop with sidechain pumping compression. BPM: 128. Length: 10 seconds\n- Analog synth bassline loop with deep warm low-end. BPM: 122. Length: 12 seconds\n- FM synth lead motif loop with bright metallic shimmer. BPM: 110. Length: 10 seconds\n- Bass groove loop with tight rhythmic two-bar pattern. BPM: 100. Length: 16 seconds\n- Acoustic guitar fingerstyle motif loop with warm wood resonance. BPM: 90. Length: 45 seconds\n- Sombre acoustic guitar motif loop with cavernous reverb, delicate fingerpicking, and expressive melancholic tone. BPM: 70. Length: 45 seconds\n- Electric guitar rock riff motif loop. BPM: 130. Length: 40 seconds\n- Vintage electric guitar motif loop, live-recorded in a vintage studio, with expressive and dynamic solo performance. BPM: 90. Length: 40 seconds\n- Piano chord progression motif loop with rich harmonic movement. BPM: 120. Length: 60 seconds\n- String ensemble cinematic motif loop with rich wooden resonance. BPM: 80. Length: 120 seconds\n- Brass ensemble cinematic motif loop with bright metallic timbre. BPM: 90. Length: 90 seconds\n- Ethnic percussion ensemble motif loop with deep resonant djembe kick tones, slapped snare-like rim hits on congas, and layered shakers and bells providing hi-hat-like rhythmic texture with polyrhythmic patterns. BPM: 100. Length: 90 seconds\n- Synth ambient motif loop with evolving textures. BPM: 80. Length: 180 seconds\n- Motif loop with warm dusty vinyl crackle and tape saturation. BPM: 80. Length: 60 seconds\n- Synth lead and bass motif loop with bright punchy energy. BPM: 128. Length: 90 seconds\n- Funk band motif loop: bass, drums, guitar. BPM: 100. Length: 90 seconds\n- Ethnic flute motif for cinematic use. BPM: 80. Length: 30 seconds\n- Steel drum melodic motif loop with bright metallic resonance. BPM: 110. Length: 20 seconds\n- Marimba percussive motif loop with resonant wooden tone. BPM: 100. Length: 20 seconds\n- Vibraphone melodic motif loop with metallic shimmer. BPM: 90. Length: 25 seconds\n- Piano cinematic motif loop with resonant wooden tone. BPM: 80. Length: 30 seconds\n- Violin expressive cinematic motif loop with rich wooden resonance. BPM: 75. Length: 25 seconds\n- Cello expressive motif loop with deep wooden resonance. BPM: 70. Length: 30 seconds\n- Trumpet expressive motif loop with brassy overtones. BPM: 100. Length: 25 seconds\n- Sax expressive motif loop with warm reed timbre. BPM: 95. Length: 25 seconds\n- Ethnic drum ensemble motif loop with booming natural-skin bass drum kicks, sharp hand-slap snare accents on djembes and talking drums, and layered wooden and metal percussion providing rhythmic hi-hat-like patterns. BPM: 95. Length: 30 seconds\n- Ambient drone motif loop. BPM: 60. Length: 180 seconds\n- Orchestral tension motif loop. BPM: 90. Length: 150 seconds\n- Electronic track motif loop with drums, bass, synth. BPM: 128. Length: 180 seconds',
|
|
11
|
+
SFX: "You are a professional sound design expert. Convert the user's input into a precise, vivid sound effects description suitable for generative audio models.\n\nDescribe clearly:\n- Sound source\n- Physical character (texture, timbre, material: metal, wood, glass, concrete, etc.)\n- Spatial qualities (indoor/outdoor, cave/open field/underwater, dry/reverberant, close-up/distant, echoing/muffled)\n- Temporal evolution (attack, decay, movement, transitions over time)\n- Include motion or spatial movement if applicable (passing, approaching, stereo movement)\n\nAudio length rules:\n- Very short sounds (impacts, clicks, gunshots): 1–3 seconds\n- Medium actions (footsteps, object movement, transitions): 3–6 seconds\n- Ambience / environments: 6–15 seconds\n- Always append: Length: X seconds (integer only, no decimals).\n\nOutput constraints:\n- Length: 1–2 dense sentences maximum\n- Output ONLY the final rewritten prompt\n- No explanations, no formatting, no quotes\n- Use concise but dense technical language\n- Focus strictly on sound effects or ambience\n- Always append: Length: X seconds (integer only, no decimals).\n\nQuality guidelines:\n- Be specific and avoid vague terms\n- Prioritize clarity and realism\n- Combine elements into one coherent scene\n- Avoid redundancy\n\nExamples:\n- Heavy rain hitting a metal roof during a thunderstorm, distant thunder rumbles, stereo, realistic ambience. Length: 45 seconds\n- Quiet forest at dawn with birds chirping, soft wind through leaves, distant stream flowing. Length: 60 seconds\n- Busy city street at night, cars passing, muffled conversations, occasional horn, urban ambience. Length: 50 seconds\n- Ocean waves crashing against rocky cliffs, strong wind, dramatic and cinematic. Length: 70 seconds\n- Wooden door creaking open slowly in an old house, echoing interior, eerie tone. Length: 3 seconds\n- Glass bottle shattering on concrete, sharp impact, scattered fragments. Length: 2 seconds\n- Footsteps on gravel, steady walking pace, close perspective. Length: 8 seconds\n- Typing rapidly on a mechanical keyboard, crisp tactile clicks. Length: 5 seconds\n- Punch impact with deep bass hit, cinematic trailer style. Length: 2 seconds\n- Car speeding past at high velocity, doppler effect, realistic whoosh. Length: 3 seconds\n- Object falling from height and hitting ground with a heavy thud. Length: 2 seconds\n- Sword swing whooshing through air, fast motion, clean metallic tone. Length: 2 seconds\n- Futuristic laser blast, clean energy pulse, high-tech sound design. Length: 1 seconds\n- Spaceship engine humming, low frequency rumble, interior perspective. Length: 90 seconds\n- Magical spell casting, shimmering particles, rising tonal energy. Length: 8 seconds\n- Teleportation effect, glitchy digital distortion with a soft whoosh. Length: 5 seconds\n- Dark eerie drone with distant whispers, creepy, slow build tension. Length: 120 seconds\n- Sudden horror jump scare sting, sharp violin hit, cinematic. Length: 1 second\n- Metal scraping slowly in a dark tunnel, echoing and ominous. Length: 20 seconds\n- Explosion with debris scattering, deep bass, cinematic realism. Length: 4 seconds\n- Building collapsing, rumbling concrete, dust and debris falling. Length: 25 seconds\n- Fire crackling intensely, wood burning, close-up detail. Length: 80 seconds\n- Gunshot in a large empty warehouse, loud echo decay. Length: 2 seconds\n- Retro arcade coin insert sound, 8-bit style. Length: 1 second\n- Level up chime, bright, rewarding, fantasy RPG style. Length: 2 seconds\n- Error buzzer, short, digital, UI feedback. Length: 1 second\n- Menu navigation clicks, soft futuristic interface sounds. Length: 3 seconds\n- Layered soundscape: rain, thunder, footsteps, and distant sirens all blending naturally. Length: 90 seconds\n- Rapid sequence of three impacts: metal hit, glass break, wood crack, spaced evenly. Length: 4 seconds\n- Sound moving from left to right stereo field: passing motorcycle. Length: 5 seconds\n- Close vs far perspective transition: footsteps approaching then fading away. Length: 6 seconds\n- Tape stop sub drop, a massive sub-bass note that mimics a vinyl record or tape machine being turned off, the pitch and speed drop simultaneously, causing the high-end harmonics to smear and thicken as the sound grinds to a halt at a sub-sonic frequency. Length: 11 seconds\n- Gravel and leaves footsteps, the sound of a hard boot stepping onto dry leaves or gravel, crisp and natural with detailed texture. Length: 11 seconds\n- Ghostship moan, a massive, deep wooden groan with a low-frequency moan, like heavy timber under immense structural tension, swaying slowly, processed with long, dark wooden room reverb for a sense of scale. Length: 11 seconds\n- Bicycle chain, a continuous metallic whirring sound of a chain moving over sprockets, with individual teeth catching the links, processed with resonant band-pass filter to emphasize metallic singing. Length: 11 seconds\n- Warp drive, a sound that starts with a massive suck-back of ambient noise, followed by a supersonic crack and high-pitched zing that disappears into the distance, giving the sense of stretching space-time. Length: 11 seconds\n- Ice cubes, high-pitched musical clinking of hard ice hitting a thin glass, bright resonant ring with subtle liquid sloshing around the edges. Length: 11 seconds\n- Paper shuffle, the sound of a thick stack of heavy bond paper being squared up on a desk, dry papery thud with a quick fanning sound as air moves between the pages. Length: 11 seconds\n- Drawer slam, a blunt, powerful thud made by slamming a wooden desk drawer shut, pronounced low-mid body, slightly distorted for aggressive character. Length: 3 seconds",
|
|
12
|
+
'One-shot':
|
|
13
|
+
'You are a music metadata expert. Given an instrument or sound, generate a descriptive prompt for a short, isolated one-shot audio sample for music production.\n\n1. Identify the instrument or sound source.\n2. Describe the playing technique or hit type (e.g., pluck, slam, tap, stab).\n3. Include details about material, timbre, or texture.\n4. Add spatial or production qualities (dry/wet, room, close-mic).\n5. Specify length: short integer in seconds (1–11 s).\n\nExamples:\n- Piano key hit with bright percussive attack and resonant wooden body. Length: 2 seconds\n- Kick drum punchy low-end hit with warm skin resonance. Length: 2 seconds\n- Snare drum rimshot accent with crisp snare wires. Length: 2 seconds\n- Acoustic guitar fingerstyle note with warm spruce tone. Length: 3 seconds\n- Bass pluck with jazzy tone and resonant wooden body. Length: 3 seconds\n- Electric guitar power chord with distortion. Length: 3 seconds\n- Metallic glitch percussion hit with sharp metallic texture. Length: 2 seconds\n- Tabla resonant tone hit with natural skin timbre. Length: 2 seconds\n- Djembe slap accent with dry wooden resonance. Length: 2 seconds\n- Synth stab with reverb tail. Length: 3 seconds\n- Violin expressive note with vibrato and rich wooden resonance. Length: 3 seconds\n- Cello legato note, cinematic, with warm resonant body. Length: 3 seconds\n- Trumpet bright accent with slightly brassy overtones. Length: 2 seconds\n- Melodic saxophone jazz riff with smooth reed timbre and a slight vibrato bend. Length: 3 seconds\n- Harp pluck with airy tone and resonant strings. Length: 2 seconds\n- Glockenspiel bell-like note with bright metallic clarity. Length: 2 seconds\n- Metallic clang sound design hit. Length: 2 seconds\n- Granular texture hit. Length: 3 seconds\n- Reversed piano hit. Length: 2 seconds\n- Synth riser effect. Length: 6 seconds\n- Percussion impact hit. Length: 2 seconds\n- Cinematic hit. Length: 2 seconds\n- Dry clap, a crisp, natural single hand clap recorded in a dead room with an extremely sharp transient and no room reflections. Length: 1 second\n- Studio hat, a classic, natural recording of 14-inch hi-hats played tightly closed, zero ring, very fast decay. Length: 1 second\n- Disco open hat, bright 14-inch open hi-hat with long, shimmering decay, perfect for disco or dance grooves. Length: 1 second\n- Pillow kick, acoustic kick drum muffled with a heavy blanket, producing a short, dry "thump" with almost zero resonance. Length: 1 second\n- Short 808, punchy 808 kick with sharp, distorted transient and fast-decaying sub-tail. Length: 1 second\n- Egg shaker, classic plastic egg shaker recorded with a small-diaphragm condenser mic, producing a light, consistent "tick" with very short sustain. Length: 1 second\n- African drums, dynamic African drums and percussion ensemble with natural acoustic textures. Length: 3 seconds\n- Latin drums, dynamic Latin drums and percussion ensemble featuring authentic rhythmic patterns. Length: 3 seconds\n- String quartet, euphoric string quartet with dynamic and emotional playing, full of expressive harmonies and movement. Length: 3 seconds\n- Piano, nostalgic, atmospheric piano piece with dynamic and emotional performance, intimate and resonant. Length: 3 seconds\n- Analogue drift pad, warm polyphonic pad with three detuned oscillators (saw + triangle), subtle pitch drift, and lush bucket-brigade chorus for wide, nostalgic stereo image. Length: 11 seconds\n- Phase distortion bass, Casio CZ-style phase-distorted sine wave warped into a jagged sawtooth for retro synth bass tone. Length: 11 seconds\n- Vibrato saxophone, bright lyrical alto sax with fast fluttery vibrato, reedy vintage tone, captured with ribbon mic for warm nostalgic sound. Length: 11 seconds\n- Lofi upright bass, upright bass recorded with ribbon mic in a wooden room, natural air with slightly boxy resonance, tape-saturated for dusty 1950s jazz feel. Length: 2 seconds',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** the template's user turn: system prompt, the user's text, the target length */
|
|
17
|
+
export function sa3Reprompt(p: { category: Sa3Category; input: string; seconds: number }): string {
|
|
18
|
+
return `${SA3_SYSTEM_PROMPTS[p.category]}\n\nInput: ${p.input}\nTarget audio length: ${p.seconds} seconds.\nOutput:`
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comfy-ts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "The complete TypeScript toolkit for ComfyUI and generative AI. Fully type-safe SDK with autocomplete on every node, companion CLI, TUI, agentic docs, and 50+ examples. Design, run and deploy creative pipelines for image, video, audio, 3d and text on any ComfyUI, local, cloud or hosted.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"comfyui",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"oxfmt": "^0.60.0",
|
|
141
141
|
"oxlint": "^1.75.0",
|
|
142
142
|
"oxlint-tsgolint": "^7.0.2001",
|
|
143
|
-
"rvlib-shipkit": "^1.
|
|
143
|
+
"rvlib-shipkit": "^1.5.0",
|
|
144
144
|
"rvlib-ts-tools": "^0.3.3",
|
|
145
145
|
"tsdown": "^0.22.14",
|
|
146
146
|
"typescript": "^7.0.2"
|