comfy-ts 2.17.1 → 2.18.1

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.
Files changed (80) hide show
  1. package/dist/cli.js +3 -3
  2. package/dist/index.cjs +1078 -190
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +1185 -410
  5. package/dist/index.d.ts +1185 -410
  6. package/dist/index.js +1078 -190
  7. package/dist/index.js.map +1 -1
  8. package/dist/{run-run-tg82jUIk.js → run-run-Zr699h2S.js} +2 -2
  9. package/dist/{run-run-tg82jUIk.js.map → run-run-Zr699h2S.js.map} +1 -1
  10. package/dist/{run-tui-Bw7BA75d.js → run-tui-CeM1GOJP.js} +2 -2
  11. package/dist/{run-tui-Bw7BA75d.js.map → run-tui-CeM1GOJP.js.map} +1 -1
  12. package/dist/serve-web.js +47 -47
  13. package/dist/{state-zTow5ucI.js → state-C067Kbew.js} +1079 -191
  14. package/dist/state-C067Kbew.js.map +1 -0
  15. package/dist/web.d.ts +1203 -428
  16. package/dist/web.js +1078 -190
  17. package/dist/web.js.map +1 -1
  18. package/examples/comfy-cloud/ace-step15-t2a.cflow.ts +163 -0
  19. package/examples/comfy-cloud/anima-t2i-base.cflow.ts +57 -0
  20. package/examples/comfy-cloud/boogu-t2i.cflow.ts +55 -0
  21. package/examples/comfy-cloud/chronoedit-i2i.cflow.ts +95 -0
  22. package/examples/comfy-cloud/ernie-t2i-base.cflow.ts +81 -0
  23. package/examples/comfy-cloud/flux1-t2i-krea.cflow.ts +63 -0
  24. package/examples/comfy-cloud/flux2-i2i-dev.cflow.ts +83 -0
  25. package/examples/comfy-cloud/flux2-t2i-dev.cflow.ts +60 -0
  26. package/examples/comfy-cloud/hidream-o1-i2i.cflow.ts +71 -0
  27. package/examples/comfy-cloud/hidream-o1-t2i.cflow.ts +62 -0
  28. package/examples/comfy-cloud/krea2-i2i.cflow.ts +78 -0
  29. package/examples/comfy-cloud/ltx2-i2v.cflow.ts +175 -0
  30. package/examples/comfy-cloud/ltx2-t2v.cflow.ts +143 -0
  31. package/examples/comfy-cloud/ltx23-i2v.cflow.ts +189 -0
  32. package/examples/comfy-cloud/ltx23-t2v.cflow.ts +151 -0
  33. package/examples/comfy-cloud/mage-flow-i2i-turbo.cflow.ts +72 -0
  34. package/examples/comfy-cloud/mage-flow-i2i.cflow.ts +74 -0
  35. package/examples/comfy-cloud/mage-flow-t2i-turbo.cflow.ts +60 -0
  36. package/examples/comfy-cloud/mage-flow-t2i.cflow.ts +60 -0
  37. package/examples/comfy-cloud/minimax-h3-t2i.cflow.ts +64 -0
  38. package/examples/comfy-cloud/netayume-t2i.cflow.ts +60 -0
  39. package/examples/comfy-cloud/qwen-image-i2i-2509.cflow.ts +75 -0
  40. package/examples/comfy-cloud/qwen-image-t2i-2512.cflow.ts +63 -0
  41. package/examples/comfy-cloud/sdk.d.ts +21683 -13737
  42. package/examples/comfy-cloud/stable-audio3-t2a.cflow.ts +96 -0
  43. package/examples/comfy-cloud/z-image-t2i-base.cflow.ts +54 -0
  44. package/examples/rvion/04-krea2-turbo-t2i.cflow.ts +1 -1
  45. package/package.json +2 -2
  46. package/src/graph/ComfyNode.ts +93 -12
  47. package/src/host/ComfyHost.ts +37 -46
  48. package/src/host/ComfyManager.ts +576 -64
  49. package/src/litegraph/CanonicalWorkflow.ts +3 -0
  50. package/src/litegraph/LiteGraphJSON.ts +2 -2
  51. package/src/litegraph/LiteGraphNodeInput.ts +2 -2
  52. package/src/litegraph/LiteGraphNodeOutput.ts +2 -2
  53. package/src/litegraph/convertFlowToLiteGraphJSON.ts +112 -37
  54. package/src/litegraph/expandSubgraphs.ts +72 -4
  55. package/src/litegraph/normalizeWorkflow.ts +7 -1
  56. package/src/manager/ComfyRegistry.ts +2 -0
  57. package/src/manager/generated/KnownComfyCustomNodeName.ts +6354 -1680
  58. package/src/manager/generated/KnownComfyPluginTitle.ts +718 -356
  59. package/src/manager/generated/KnownComfyPluginURL.ts +357 -181
  60. package/src/manager/generated/KnownModel_Base.ts +9 -5
  61. package/src/manager/generated/KnownModel_FileName.ts +135 -0
  62. package/src/manager/generated/KnownModel_Name.ts +135 -0
  63. package/src/manager/generated/KnownModel_SavePath.ts +16 -14
  64. package/src/manager/generated/KnownModel_Type.ts +15 -13
  65. package/src/manager/installedView.ts +178 -0
  66. package/src/manager/json/custom-node-list.json +4018 -2248
  67. package/src/manager/json/extension-node-map.json +8903 -2964
  68. package/src/manager/json/github-stats.json +10796 -10036
  69. package/src/manager/json/model-list.json +298 -1
  70. package/src/manager/loaders/step4_model-list-loader.ts +1 -0
  71. package/src/manager/types/ComfyManagerAPIModelList.ts +3 -0
  72. package/src/manager/types/ComfyManagerAPIPluginList.ts +19 -0
  73. package/src/runner/ComfyExecution.ts +4 -1
  74. package/src/runner/ComfyWsApi.ts +82 -15
  75. package/src/sdk-generator/ComfySchema.ts +10 -1
  76. package/src/sdk-generator/ComfyUIObjectInfoTypes.ts +4 -1
  77. package/src/sdk-generator/comfyui-sdk-codegen.ts +61 -20
  78. package/src/sdk-generator/inputWidgetKind.ts +19 -4
  79. package/src/sdk-generator/litegraphToApiRequestPayload.ts +157 -35
  80. package/dist/state-zTow5ucI.js.map +0 -1
@@ -0,0 +1,60 @@
1
+ // netayume t2i on Comfy Cloud — NetaYume Lumina 3.5, an anime fine-tune of Lumina-Image-2.0 (all-in-one checkpoint), best at 1024x1024
2
+ // source template: image_netayume_lumina_t2i.json (official workflow-templates)
3
+ // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // run directly: bun examples/comfy-cloud/netayume-t2i.cflow.ts ["prompt"] [seed]
5
+ import { v } from 'comfy-ts'
6
+ import { cloudHost, requireCloudKey } from './cloudHost.ts'
7
+
8
+ const host = await cloudHost()
9
+
10
+ // the gemma encoder reads a system prompt first: both prefixes stay fixed up to the <Prompt Start> tag
11
+ const POSITIVE_PREFIX =
12
+ 'You are an assistant designed to generate high quality anime images based on textual prompts. <Prompt Start> '
13
+ const NEGATIVE_PREFIX =
14
+ 'You are an assistant designed to generate low-quality images based on textual prompts <Prompt Start> '
15
+
16
+ export const netayumeT2i = host.defineWorkflow({
17
+ id: 'netayume-t2i',
18
+ vars: {
19
+ // ONE prompt var: `- ` lines are the NEGATIVE prompt; `@name` is an artist tag
20
+ prompt: v.prompt(
21
+ [
22
+ 'Warm and cheerful digital illustration of a girl standing in the middle of an orange grove, surrounded by lush green leaves and ripe, vibrant oranges hanging from the trees. She has chestnut-brown hair tied in a single loose braid falling over her shoulder, with soft bangs framing her bright, smiling face. She wears a crisp white blouse under a black jacket. Sunlight filters through the leaves, casting dappled golden light on her hair and shoulders. Painterly and soft art style.',
23
+ '- blurry, worst quality, low quality, jpeg artifacts, signature, watermark, username, error, deformed hands, bad anatomy, extra limbs, poorly drawn hands, poorly drawn face, mutation, deformed, extra eyes, extra arms, extra legs, malformed limbs, fused fingers, too many fingers, long neck, cross-eyed, bad proportions, missing arms, missing legs, extra digit, fewer digits, cropped',
24
+ ].join('\n'),
25
+ ),
26
+ seed: v.seed(42),
27
+ steps: v.int(30, { min: 1, max: 80 }),
28
+ cfg: v.float(4, { min: 1, max: 10 }),
29
+ size: v.size({ width: 1024, height: 1024 }),
30
+ },
31
+ build: (b, vars) => {
32
+ const ckpt = b.CheckpointLoaderSimple({ ckpt_name: 'NetaYumev35_pretrained_all_in_one.safetensors' })
33
+ const clip = ckpt.outputs.CLIP
34
+ const samples = b.KSampler({
35
+ model: b.ModelSamplingAuraFlow({ model: ckpt.outputs.MODEL, shift: 4 }),
36
+ positive: b.CLIPTextEncode({ clip, text: POSITIVE_PREFIX + vars.prompt.positive }),
37
+ negative: b.CLIPTextEncode({ clip, text: NEGATIVE_PREFIX + vars.prompt.negative }),
38
+ latent_image: b.EmptySD3LatentImage({ width: vars.size.width, height: vars.size.height, batch_size: 1 }),
39
+ seed: vars.seed,
40
+ steps: vars.steps,
41
+ cfg: vars.cfg,
42
+ sampler_name: 'res_multistep',
43
+ scheduler: 'simple',
44
+ denoise: 1,
45
+ })
46
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae: ckpt.outputs.VAE }) })
47
+ },
48
+ })
49
+
50
+ export default netayumeT2i
51
+
52
+ // standalone run (skipped when another driver — e.g. the TUI — imports this module)
53
+ if (import.meta.main) {
54
+ requireCloudKey()
55
+ if (process.argv[2]) netayumeT2i.vars.prompt.set(process.argv[2])
56
+ if (process.argv[3]) netayumeT2i.vars.seed.set(Number(process.argv[3]))
57
+ const execution = await netayumeT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/netayume-t2i' } })
58
+ for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
59
+ host.disconnect()
60
+ }
@@ -0,0 +1,75 @@
1
+ // qwen-image i2i 2509 on Comfy Cloud — Qwen-Image-Edit 2509 fp8 + its 4-step Lightning lora, instruction-driven image editing at cfg 1
2
+ // source template: image_qwen_image_edit_2509.json (official workflow-templates)
3
+ // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // run directly: bun examples/comfy-cloud/qwen-image-i2i-2509.cflow.ts [path/to/image.png] ["edit instruction"]
5
+ import { asAbsolutePath, exampleImagePath, MediaImage, v } from 'comfy-ts'
6
+ import { cloudHost, requireCloudKey } from './cloudHost.ts'
7
+
8
+ const host = await cloudHost()
9
+
10
+ // bundled default input (examples/images/, ships in the tarball) — the TUI picker or argv[2] swap it
11
+ const image = v.image(exampleImagePath('bear_1024x1024.jpg'))
12
+
13
+ export const qwenImageI2i2509 = host.defineWorkflow({
14
+ id: 'qwen-image-i2i-2509',
15
+ vars: {
16
+ image,
17
+ prompt: v.prompt('Replace the bear with a dalmatian, keeping the environment and scene consistent'),
18
+ seed: v.seed(42),
19
+ // the template ships its Lightning lora ON: 4 steps at cfg 1
20
+ steps: v.int(4, { min: 1, max: 30 }),
21
+ },
22
+ // async build: the input image is uploaded (hash-named, deduped) per run
23
+ build: async (b, vars, wf) => {
24
+ const img = new MediaImage({ path: asAbsolutePath(image.absPath()) })
25
+ const scaled = b.FluxKontextImageScale({ image: await img.loadInWorkflow_viaLoadImageNode(wf) })
26
+ const clip = b.CLIPLoader({
27
+ clip_name: 'qwen_2.5_vl_7b_fp8_scaled.safetensors',
28
+ type: 'qwen_image',
29
+ device: 'default',
30
+ })
31
+ const vae = b.VAELoader({ vae_name: 'qwen_image_vae.safetensors' })
32
+ // edit conditioning reads the input image itself, on both branches
33
+ const encode = (text: string) => b.TextEncodeQwenImageEditPlus({ prompt: text, clip, vae, image1: scaled })
34
+ const model = b.CFGNorm({
35
+ model: b.ModelSamplingAuraFlow({
36
+ model: b.LoraLoaderModelOnly({
37
+ model: b.UNETLoader({
38
+ unet_name: 'qwen_image_edit_2509_fp8_e4m3fn.safetensors',
39
+ weight_dtype: 'default',
40
+ }),
41
+ lora_name: 'Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors',
42
+ strength_model: 1,
43
+ }),
44
+ shift: 3,
45
+ }),
46
+ strength: 1,
47
+ pre_cfg: false,
48
+ })
49
+ const samples = b.KSampler({
50
+ model,
51
+ positive: encode(vars.prompt.positive),
52
+ negative: encode(vars.prompt.negative),
53
+ latent_image: b.VAEEncode({ pixels: scaled, vae }),
54
+ seed: vars.seed,
55
+ steps: vars.steps,
56
+ cfg: 1,
57
+ sampler_name: 'euler',
58
+ scheduler: 'simple',
59
+ denoise: 1,
60
+ })
61
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
62
+ },
63
+ })
64
+
65
+ export default qwenImageI2i2509
66
+
67
+ // standalone run (skipped when another driver — e.g. the TUI — imports this module)
68
+ if (import.meta.main) {
69
+ requireCloudKey()
70
+ if (process.argv[2]) qwenImageI2i2509.vars.image.set(process.argv[2])
71
+ if (process.argv[3]) qwenImageI2i2509.vars.prompt.set(process.argv[3])
72
+ const execution = await qwenImageI2i2509.run({ log: true, save: { prefix: 'comfy-ts-zoo/qwen-image-i2i-2509' } })
73
+ for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
74
+ host.disconnect()
75
+ }
@@ -0,0 +1,63 @@
1
+ // qwen-image t2i 2512 on Comfy Cloud — Qwen-Image 2512 fp8, the 2512 refresh of the Qwen-Image weights (50 steps, cfg 4)
2
+ // source template: image_qwen_Image_2512.json (official workflow-templates)
3
+ // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // run directly: bun examples/comfy-cloud/qwen-image-t2i-2512.cflow.ts ["prompt"] [seed]
5
+ import { v } from 'comfy-ts'
6
+ import { cloudHost, requireCloudKey } from './cloudHost.ts'
7
+
8
+ const host = await cloudHost()
9
+
10
+ export const qwenImageT2i2512 = host.defineWorkflow({
11
+ id: 'qwen-image-t2i-2512',
12
+ vars: {
13
+ // ONE prompt var: the `- ` line is the template's own negative (a Chinese quality list)
14
+ prompt: v.prompt(
15
+ [
16
+ 'Urban alleyway at dusk. A tall high-fashion model striding elegantly, mid-distance full body shot from an angular perspective, editorial with bold contrasts and tactile materials. A rose-gold metallic trench coat over a black textured turtleneck, forest-green pleated pants with raw hems, long braided dark hair, a vibrant yellow designer handbag with geometric details, white architectural sneakers. High contrast, extreme clarity, photorealistic.',
17
+ '- 低分辨率,低画质,肢体畸形,手指畸形,画面过饱和,蜡像感,人脸无细节,过度光滑,画面具有AI感。构图混乱。文字模糊,扭曲',
18
+ ].join('\n'),
19
+ ),
20
+ seed: v.seed(42),
21
+ // template defaults: 50 steps / cfg 4 (its optional 4-step Lightning lora branch ships off, dropped here)
22
+ steps: v.int(50, { min: 1, max: 100 }),
23
+ cfg: v.float(4, { min: 0, max: 30 }),
24
+ size: v.size({ width: 1328, height: 1328 }),
25
+ },
26
+ build: (b, vars) => {
27
+ const model = b.ModelSamplingAuraFlow({
28
+ model: b.UNETLoader({ unet_name: 'qwen_image_2512_fp8_e4m3fn.safetensors', weight_dtype: 'default' }),
29
+ shift: 3.1,
30
+ })
31
+ const clip = b.CLIPLoader({
32
+ clip_name: 'qwen_2.5_vl_7b_fp8_scaled.safetensors',
33
+ type: 'qwen_image',
34
+ device: 'default',
35
+ })
36
+ const vae = b.VAELoader({ vae_name: 'qwen_image_vae.safetensors' })
37
+ const samples = b.KSampler({
38
+ model,
39
+ positive: b.CLIPTextEncode({ clip, text: vars.prompt.positive }),
40
+ negative: b.CLIPTextEncode({ clip, text: vars.prompt.negative }),
41
+ latent_image: b.EmptySD3LatentImage({ width: vars.size.width, height: vars.size.height, batch_size: 1 }),
42
+ seed: vars.seed,
43
+ steps: vars.steps,
44
+ cfg: vars.cfg,
45
+ sampler_name: 'euler',
46
+ scheduler: 'simple',
47
+ denoise: 1,
48
+ })
49
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
50
+ },
51
+ })
52
+
53
+ export default qwenImageT2i2512
54
+
55
+ // standalone run (skipped when another driver — e.g. the TUI — imports this module)
56
+ if (import.meta.main) {
57
+ requireCloudKey()
58
+ if (process.argv[2]) qwenImageT2i2512.vars.prompt.set(process.argv[2])
59
+ if (process.argv[3]) qwenImageT2i2512.vars.seed.set(Number(process.argv[3]))
60
+ const execution = await qwenImageT2i2512.run({ log: true, save: { prefix: 'comfy-ts-zoo/qwen-image-t2i-2512' } })
61
+ for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
62
+ host.disconnect()
63
+ }