comfy-ts 1.3.0 → 2.0.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.
Files changed (115) hide show
  1. package/README.md +106 -6
  2. package/dist/{DefinedWorkflow-gpknV-5f.js → DefinedWorkflow-CqNE_kgR.js} +67 -14
  3. package/dist/DefinedWorkflow-CqNE_kgR.js.map +1 -0
  4. package/dist/{DraftsSt-DmA0jWGl.js → DraftsSt-Da4DZUP7.js} +2 -2
  5. package/dist/{DraftsSt-DmA0jWGl.js.map → DraftsSt-Da4DZUP7.js.map} +1 -1
  6. package/dist/cli.js +3 -3
  7. package/dist/index.cjs +548 -239
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +164 -116
  10. package/dist/index.d.ts +165 -117
  11. package/dist/index.js +540 -230
  12. package/dist/index.js.map +1 -1
  13. package/dist/{run-serve-Bn6yIJB0.js → run-serve-BqeXtf8P.js} +9 -7
  14. package/dist/run-serve-BqeXtf8P.js.map +1 -0
  15. package/dist/{run-tui-BtjaOXRh.js → run-tui-CiB7TbYv.js} +18 -13
  16. package/dist/run-tui-CiB7TbYv.js.map +1 -0
  17. package/dist/{state-DKCPy105.js → state-C1g_B8zR.js} +398 -201
  18. package/dist/state-C1g_B8zR.js.map +1 -0
  19. package/dist/web.d.ts +17335 -0
  20. package/dist/web.js +5715 -0
  21. package/dist/web.js.map +1 -0
  22. package/examples/comfy-cloud/ace-step-t2a.cflow.ts +1 -0
  23. package/examples/comfy-cloud/anima-t2i.cflow.ts +2 -3
  24. package/examples/comfy-cloud/boogu-i2i.cflow.ts +2 -5
  25. package/examples/comfy-cloud/capybara-i2i.cflow.ts +2 -2
  26. package/examples/comfy-cloud/capybara-i2v.cflow.ts +1 -0
  27. package/examples/comfy-cloud/capybara-t2i.cflow.ts +2 -2
  28. package/examples/comfy-cloud/chatterbox-t2a.cflow.ts +1 -0
  29. package/examples/comfy-cloud/chroma-t2i.cflow.ts +2 -5
  30. package/examples/comfy-cloud/ernie-t2i.cflow.ts +2 -3
  31. package/examples/comfy-cloud/firered-i2i.cflow.ts +2 -2
  32. package/examples/comfy-cloud/flux1-i2i.cflow.ts +2 -2
  33. package/examples/comfy-cloud/flux1-t2i.cflow.ts +2 -2
  34. package/examples/comfy-cloud/flux2-i2i.cflow.ts +2 -5
  35. package/examples/comfy-cloud/flux2-t2i.cflow.ts +2 -5
  36. package/examples/comfy-cloud/hidream-i2i.cflow.ts +2 -5
  37. package/examples/comfy-cloud/hidream-t2i.cflow.ts +2 -2
  38. package/examples/comfy-cloud/hunyuan-video-i2v.cflow.ts +1 -0
  39. package/examples/comfy-cloud/hunyuan-video-t2v.cflow.ts +1 -0
  40. package/examples/comfy-cloud/ideogram4-t2i.cflow.ts +2 -3
  41. package/examples/comfy-cloud/kandinsky5-i2v.cflow.ts +1 -0
  42. package/examples/comfy-cloud/kandinsky5-t2i.cflow.ts +2 -2
  43. package/examples/comfy-cloud/kandinsky5-t2v.cflow.ts +1 -0
  44. package/examples/comfy-cloud/krea2-t2i.cflow.ts +2 -3
  45. package/examples/comfy-cloud/lens-t2i.cflow.ts +2 -3
  46. package/examples/comfy-cloud/longcat-i2i.cflow.ts +2 -2
  47. package/examples/comfy-cloud/longcat-t2i.cflow.ts +2 -5
  48. package/examples/comfy-cloud/ltxv-i2v.cflow.ts +1 -0
  49. package/examples/comfy-cloud/ltxv-t2v.cflow.ts +1 -0
  50. package/examples/comfy-cloud/newbie-t2i.cflow.ts +2 -5
  51. package/examples/comfy-cloud/omnigen2-i2i.cflow.ts +2 -5
  52. package/examples/comfy-cloud/omnigen2-t2i.cflow.ts +2 -5
  53. package/examples/comfy-cloud/ovis-t2i.cflow.ts +2 -5
  54. package/examples/comfy-cloud/pixeldit-t2i.cflow.ts +2 -5
  55. package/examples/comfy-cloud/qwen-image-i2i.cflow.ts +2 -2
  56. package/examples/comfy-cloud/qwen-image-t2i.cflow.ts +2 -2
  57. package/examples/comfy-cloud/sd35-t2i.cflow.ts +2 -2
  58. package/examples/comfy-cloud/sdk.d.ts +13251 -11458
  59. package/examples/comfy-cloud/sdxl-t2i.cflow.ts +2 -2
  60. package/examples/comfy-cloud/stable-audio-t2a.cflow.ts +1 -0
  61. package/examples/comfy-cloud/svd-i2v.cflow.ts +1 -0
  62. package/examples/comfy-cloud/wan21-i2v.cflow.ts +1 -0
  63. package/examples/comfy-cloud/wan21-t2v.cflow.ts +1 -0
  64. package/examples/comfy-cloud/wan22-5b-t2v.cflow.ts +1 -0
  65. package/examples/comfy-cloud/wan22-i2v.cflow.ts +1 -0
  66. package/examples/comfy-cloud/wan22-t2v.cflow.ts +1 -0
  67. package/examples/comfy-cloud/z-image-t2i.cflow.ts +2 -5
  68. package/examples/rvion/01-txt2img.cflow.ts +5 -3
  69. package/examples/rvion/02-img2img-upload.cflow.ts +5 -4
  70. package/examples/rvion/04-krea2-turbo-t2i.cflow.ts +6 -7
  71. package/examples/rvion/05-comfy-cloud.cflow.ts +4 -2
  72. package/examples/rvion/06-qwen-image-edit.cflow.ts +2 -3
  73. package/examples/web/example.ts +78 -0
  74. package/examples/web/index.html +77 -0
  75. package/examples/web/serve.ts +42 -0
  76. package/examples/web/tsconfig.json +15 -0
  77. package/package.json +8 -2
  78. package/src/cli/serve/ServeApp.ts +9 -6
  79. package/src/cli/tui/state/ExecSt.ts +14 -2
  80. package/src/coreExports.ts +118 -0
  81. package/src/host/ComfyHost.ts +56 -24
  82. package/src/host/ResilientWebsocket.ts +93 -47
  83. package/src/host/hostUrl.ts +2 -1
  84. package/src/host/loraManagerApi.ts +6 -7
  85. package/src/index.ts +8 -107
  86. package/src/manager/loaders/step2_custom-node-list-loader.ts +4 -4
  87. package/src/manager/loaders/step3_extension-node-map-loader.ts +3 -3
  88. package/src/manager/loaders/step4_model-list-loader.ts +7 -7
  89. package/src/manager/loaders/step5_alter-list-loader.ts +2 -2
  90. package/src/manager/loaders/step6_github-stats-loader.ts +2 -2
  91. package/src/runner/ComfyExecution.ts +168 -77
  92. package/src/runner/ComfyWorkflow.ts +25 -3
  93. package/src/runner/ComfyWsApi.ts +6 -0
  94. package/src/runner/MediaImage.ts +73 -38
  95. package/src/runner/ephemeral.ts +21 -0
  96. package/src/runner/outputPath.ts +2 -2
  97. package/src/sdk-generator/ComfySchema.ts +2 -2
  98. package/src/sdk-generator/_pythonModuleToNamespace.ts +3 -0
  99. package/src/state.ts +13 -9
  100. package/src/storage/ComfyStorage.ts +144 -0
  101. package/src/storage/nodeStorage.ts +9 -0
  102. package/src/types/index.ts +6 -2
  103. package/src/utils/downloadFile.ts +11 -69
  104. package/src/utils/hashArrayBuffer.ts +3 -4
  105. package/src/utils/lazySharp.ts +25 -0
  106. package/src/utils/sha1.ts +69 -0
  107. package/src/vars/ComfyVars.ts +5 -6
  108. package/src/vars/DefinedWorkflow.ts +3 -1
  109. package/src/vars/loraKeywords.ts +6 -6
  110. package/src/web.ts +13 -0
  111. package/dist/DefinedWorkflow-gpknV-5f.js.map +0 -1
  112. package/dist/run-serve-Bn6yIJB0.js.map +0 -1
  113. package/dist/run-tui-BtjaOXRh.js.map +0 -1
  114. package/dist/state-DKCPy105.js.map +0 -1
  115. package/src/utils/writeFile.ts +0 -16
@@ -1,6 +1,7 @@
1
1
  // ace-step t2a on Comfy Cloud — ACE-Step v1 3.5B text to song: style tags + lyrics to a full mp3 track
2
2
  // source template: audio_ace_step_1_t2a_song.json (official workflow-templates)
3
3
  // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // note: audio outputs PERSIST on the host (upstream ships no websocket saver for audio — image examples stream ephemerally)
4
5
  // run directly: bun examples/comfy-cloud/ace-step-t2a.cflow.ts ["prompt"] [seed]
5
6
  import { v } from 'comfy-ts'
6
7
  import { cloudHost, requireCloudKey } from './cloudHost.ts'
@@ -37,9 +37,8 @@ export const animaT2i = host.defineWorkflow({
37
37
  scheduler: 'simple',
38
38
  denoise: 1,
39
39
  })
40
- b.SaveImage({
40
+ b.SaveImageWebsocket({
41
41
  images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'qwen_image_vae.safetensors' }) }),
42
- filename_prefix: 'comfy-ts-zoo/anima-t2i',
43
42
  })
44
43
  },
45
44
  })
@@ -51,7 +50,7 @@ if (import.meta.main) {
51
50
  requireCloudKey()
52
51
  if (process.argv[2]) animaT2i.vars.prompt.set(process.argv[2])
53
52
  if (process.argv[3]) animaT2i.vars.seed.set(Number(process.argv[3]))
54
- const execution = await animaT2i.run({ log: true })
53
+ const execution = await animaT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/anima-t2i' } })
55
54
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
56
55
  host.disconnect()
57
56
  }
@@ -56,10 +56,7 @@ export const booguI2i = host.defineWorkflow({
56
56
  noise_seed: vars.seed,
57
57
  cfg: vars.cfg,
58
58
  })
59
- b.SaveImage({
60
- images: b.VAEDecode({ samples: sampled.outputs.output, vae }),
61
- filename_prefix: 'comfy-ts-zoo/boogu-i2i',
62
- })
59
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples: sampled.outputs.output, vae }) })
63
60
  },
64
61
  })
65
62
 
@@ -70,7 +67,7 @@ if (import.meta.main) {
70
67
  requireCloudKey()
71
68
  if (process.argv[2]) booguI2i.vars.image.set(process.argv[2])
72
69
  if (process.argv[3]) booguI2i.vars.prompt.set(process.argv[3])
73
- const execution = await booguI2i.run({ log: true })
70
+ const execution = await booguI2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/boogu-i2i' } })
74
71
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
75
72
  host.disconnect()
76
73
  }
@@ -68,7 +68,7 @@ export const capybaraI2i = host.defineWorkflow({
68
68
  scheduler: 'simple',
69
69
  denoise: 1,
70
70
  })
71
- b.SaveImage({ images: b.VAEDecode({ samples, vae }), filename_prefix: 'comfy-ts-zoo/capybara-i2i' })
71
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
72
72
  },
73
73
  })
74
74
 
@@ -79,7 +79,7 @@ if (import.meta.main) {
79
79
  requireCloudKey()
80
80
  if (process.argv[2]) capybaraI2i.vars.image.set(process.argv[2])
81
81
  if (process.argv[3]) capybaraI2i.vars.prompt.set(process.argv[3])
82
- const execution = await capybaraI2i.run({ log: true })
82
+ const execution = await capybaraI2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/capybara-i2i' } })
83
83
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
84
84
  host.disconnect()
85
85
  }
@@ -1,6 +1,7 @@
1
1
  // capybara i2v on Comfy Cloud — Capybara v0.1 image to video (HunyuanVideo 1.5 arch), ~3s @ 24fps
2
2
  // source template: video_capybara_v0_1_image_to_video.json (official workflow-templates)
3
3
  // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // note: video outputs PERSIST on the host (upstream ships no websocket saver for video — image examples stream ephemerally)
4
5
  // run directly: bun examples/comfy-cloud/capybara-i2v.cflow.ts [path/to/image.png] ["prompt"]
5
6
  import { asAbsolutePath, exampleImagePath, MediaImage, v } from 'comfy-ts'
6
7
  import { cloudHost, requireCloudKey } from './cloudHost.ts'
@@ -50,7 +50,7 @@ export const capybaraT2i = host.defineWorkflow({
50
50
  scheduler: 'simple',
51
51
  denoise: 1,
52
52
  })
53
- b.SaveImage({ images: b.VAEDecode({ samples, vae }), filename_prefix: 'comfy-ts-zoo/capybara-t2i' })
53
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
54
54
  },
55
55
  })
56
56
 
@@ -61,7 +61,7 @@ if (import.meta.main) {
61
61
  requireCloudKey()
62
62
  if (process.argv[2]) capybaraT2i.vars.prompt.set(process.argv[2])
63
63
  if (process.argv[3]) capybaraT2i.vars.seed.set(Number(process.argv[3]))
64
- const execution = await capybaraT2i.run({ log: true })
64
+ const execution = await capybaraT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/capybara-t2i' } })
65
65
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
66
66
  host.disconnect()
67
67
  }
@@ -1,6 +1,7 @@
1
1
  // chatterbox t2a on Comfy Cloud — Chatterbox Multilingual TTS: text to speech in 23 languages, mp3 out
2
2
  // source template: audio-chatterbox_tts_multilingual.json (official workflow-templates)
3
3
  // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // note: audio outputs PERSIST on the host (upstream ships no websocket saver for audio — image examples stream ephemerally)
4
5
  // run directly: bun examples/comfy-cloud/chatterbox-t2a.cflow.ts ["text"] [seed]
5
6
  import { v } from 'comfy-ts'
6
7
  import { cloudHost, requireCloudKey } from './cloudHost.ts'
@@ -42,10 +42,7 @@ export const chromaT2i = host.defineWorkflow({
42
42
  scheduler: 'beta',
43
43
  denoise: 1,
44
44
  })
45
- b.SaveImage({
46
- images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'ae.safetensors' }) }),
47
- filename_prefix: 'comfy-ts-zoo/chroma-t2i',
48
- })
45
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'ae.safetensors' }) }) })
49
46
  },
50
47
  })
51
48
 
@@ -56,7 +53,7 @@ if (import.meta.main) {
56
53
  requireCloudKey()
57
54
  if (process.argv[2]) chromaT2i.vars.prompt.set(process.argv[2])
58
55
  if (process.argv[3]) chromaT2i.vars.seed.set(Number(process.argv[3]))
59
- const execution = await chromaT2i.run({ log: true })
56
+ const execution = await chromaT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/chroma-t2i' } })
60
57
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
61
58
  host.disconnect()
62
59
  }
@@ -39,9 +39,8 @@ export const ernieT2i = host.defineWorkflow({
39
39
  scheduler: 'simple',
40
40
  denoise: 1,
41
41
  })
42
- b.SaveImage({
42
+ b.SaveImageWebsocket({
43
43
  images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'flux2-vae.safetensors' }) }),
44
- filename_prefix: 'comfy-ts-zoo/ernie-t2i',
45
44
  })
46
45
  },
47
46
  })
@@ -53,7 +52,7 @@ if (import.meta.main) {
53
52
  requireCloudKey()
54
53
  if (process.argv[2]) ernieT2i.vars.prompt.set(process.argv[2])
55
54
  if (process.argv[3]) ernieT2i.vars.seed.set(Number(process.argv[3]))
56
- const execution = await ernieT2i.run({ log: true })
55
+ const execution = await ernieT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/ernie-t2i' } })
57
56
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
58
57
  host.disconnect()
59
58
  }
@@ -57,7 +57,7 @@ export const fireredI2i = host.defineWorkflow({
57
57
  scheduler: 'simple',
58
58
  denoise: 1,
59
59
  })
60
- b.SaveImage({ images: b.VAEDecode({ samples, vae }), filename_prefix: 'comfy-ts-zoo/firered-i2i' })
60
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
61
61
  },
62
62
  })
63
63
 
@@ -68,7 +68,7 @@ if (import.meta.main) {
68
68
  requireCloudKey()
69
69
  if (process.argv[2]) fireredI2i.vars.image.set(process.argv[2])
70
70
  if (process.argv[3]) fireredI2i.vars.prompt.set(process.argv[3])
71
- const execution = await fireredI2i.run({ log: true })
71
+ const execution = await fireredI2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/firered-i2i' } })
72
72
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
73
73
  host.disconnect()
74
74
  }
@@ -59,7 +59,7 @@ export const flux1I2i = host.defineWorkflow({
59
59
  scheduler: 'simple',
60
60
  denoise: 1,
61
61
  })
62
- b.SaveImage({ images: b.VAEDecode({ samples, vae }), filename_prefix: 'comfy-ts-zoo/flux1-i2i' })
62
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
63
63
  },
64
64
  })
65
65
 
@@ -70,7 +70,7 @@ if (import.meta.main) {
70
70
  requireCloudKey()
71
71
  if (process.argv[2]) flux1I2i.vars.image.set(process.argv[2])
72
72
  if (process.argv[3]) flux1I2i.vars.prompt.set(process.argv[3])
73
- const execution = await flux1I2i.run({ log: true })
73
+ const execution = await flux1I2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/flux1-i2i' } })
74
74
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
75
75
  host.disconnect()
76
76
  }
@@ -46,7 +46,7 @@ export const flux1T2i = host.defineWorkflow({
46
46
  scheduler: 'simple',
47
47
  denoise: 1,
48
48
  })
49
- b.SaveImage({ images: b.VAEDecode({ samples, vae }), filename_prefix: 'comfy-ts-zoo/flux1-t2i' })
49
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
50
50
  },
51
51
  })
52
52
 
@@ -57,7 +57,7 @@ if (import.meta.main) {
57
57
  requireCloudKey()
58
58
  if (process.argv[2]) flux1T2i.vars.prompt.set(process.argv[2])
59
59
  if (process.argv[3]) flux1T2i.vars.seed.set(Number(process.argv[3]))
60
- const execution = await flux1T2i.run({ log: true })
60
+ const execution = await flux1T2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/flux1-t2i' } })
61
61
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
62
62
  host.disconnect()
63
63
  }
@@ -58,10 +58,7 @@ export const flux2I2i = host.defineWorkflow({
58
58
  batch_size: 1,
59
59
  }),
60
60
  })
61
- b.SaveImage({
62
- images: b.VAEDecode({ samples: samples.outputs.output, vae }),
63
- filename_prefix: 'comfy-ts-zoo/flux2-i2i',
64
- })
61
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples: samples.outputs.output, vae }) })
65
62
  },
66
63
  })
67
64
 
@@ -74,7 +71,7 @@ if (import.meta.main) {
74
71
  if (process.argv[3]) flux2I2i.vars.prompt.set(process.argv[3])
75
72
  if (process.argv[4]) flux2I2i.vars.seed.set(Number(process.argv[4]))
76
73
 
77
- const execution = await flux2I2i.run({ log: true })
74
+ const execution = await flux2I2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/flux2-i2i' } })
78
75
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
79
76
  host.disconnect()
80
77
  }
@@ -36,10 +36,7 @@ export const flux2T2i = host.defineWorkflow({
36
36
  sigmas: b.Flux2Scheduler({ steps: vars.steps, width: vars.size.width, height: vars.size.height }),
37
37
  latent_image: b.EmptyFlux2LatentImage({ width: vars.size.width, height: vars.size.height, batch_size: 1 }),
38
38
  })
39
- b.SaveImage({
40
- images: b.VAEDecode({ samples: samples.outputs.output, vae }),
41
- filename_prefix: 'comfy-ts-zoo/flux2-t2i',
42
- })
39
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples: samples.outputs.output, vae }) })
43
40
  },
44
41
  })
45
42
 
@@ -51,7 +48,7 @@ if (import.meta.main) {
51
48
  if (process.argv[2]) flux2T2i.vars.prompt.set(process.argv[2])
52
49
  if (process.argv[3]) flux2T2i.vars.seed.set(Number(process.argv[3]))
53
50
 
54
- const execution = await flux2T2i.run({ log: true })
51
+ const execution = await flux2T2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/flux2-t2i' } })
55
52
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
56
53
  host.disconnect()
57
54
  }
@@ -69,10 +69,7 @@ export const hidreamI2i = host.defineWorkflow({
69
69
  sigmas: b.BasicScheduler({ model, scheduler: 'simple', steps: vars.steps, denoise: 1 }),
70
70
  latent_image: cond.outputs.latent,
71
71
  })
72
- b.SaveImage({
73
- images: b.VAEDecode({ samples: samples.outputs.output, vae }),
74
- filename_prefix: 'comfy-ts-zoo/hidream-i2i',
75
- })
72
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples: samples.outputs.output, vae }) })
76
73
  },
77
74
  })
78
75
 
@@ -83,7 +80,7 @@ if (import.meta.main) {
83
80
  requireCloudKey()
84
81
  if (process.argv[2]) hidreamI2i.vars.image.set(process.argv[2])
85
82
  if (process.argv[3]) hidreamI2i.vars.prompt.set(process.argv[3])
86
- const execution = await hidreamI2i.run({ log: true })
83
+ const execution = await hidreamI2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/hidream-i2i' } })
87
84
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
88
85
  host.disconnect()
89
86
  }
@@ -48,7 +48,7 @@ export const hidreamT2i = host.defineWorkflow({
48
48
  scheduler: 'normal',
49
49
  denoise: 1,
50
50
  })
51
- b.SaveImage({ images: b.VAEDecode({ samples, vae }), filename_prefix: 'comfy-ts-zoo/hidream-t2i' })
51
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
52
52
  },
53
53
  })
54
54
 
@@ -59,7 +59,7 @@ if (import.meta.main) {
59
59
  requireCloudKey()
60
60
  if (process.argv[2]) hidreamT2i.vars.prompt.set(process.argv[2])
61
61
  if (process.argv[3]) hidreamT2i.vars.seed.set(Number(process.argv[3]))
62
- const execution = await hidreamT2i.run({ log: true })
62
+ const execution = await hidreamT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/hidream-t2i' } })
63
63
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
64
64
  host.disconnect()
65
65
  }
@@ -1,6 +1,7 @@
1
1
  // hunyuan-video i2v on Comfy Cloud — HunyuanVideo 1.5 720p image to video, 5s @ 24fps from a start image
2
2
  // source template: video_hunyuan_video_1.5_720p_i2v.json (official workflow-templates)
3
3
  // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // note: video outputs PERSIST on the host (upstream ships no websocket saver for video — image examples stream ephemerally)
4
5
  // run directly: bun examples/comfy-cloud/hunyuan-video-i2v.cflow.ts [path/to/image.png] ["prompt"]
5
6
  import { asAbsolutePath, exampleImagePath, MediaImage, v } from 'comfy-ts'
6
7
  import { cloudHost, requireCloudKey } from './cloudHost.ts'
@@ -1,6 +1,7 @@
1
1
  // hunyuan-video t2v on Comfy Cloud — HunyuanVideo 1.5 720p text to video, 5s @ 24fps
2
2
  // source template: video_hunyuan_video_1.5_720p_t2v.json (official workflow-templates)
3
3
  // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // note: video outputs PERSIST on the host (upstream ships no websocket saver for video — image examples stream ephemerally)
4
5
  // run directly: bun examples/comfy-cloud/hunyuan-video-t2v.cflow.ts ["prompt"] [seed]
5
6
  import { v } from 'comfy-ts'
6
7
  import { cloudHost, requireCloudKey } from './cloudHost.ts'
@@ -57,12 +57,11 @@ export const ideogram4T2i = host.defineWorkflow({
57
57
  }),
58
58
  latent_image: b.EmptyFlux2LatentImage({ width: vars.size.width, height: vars.size.height, batch_size: 1 }),
59
59
  })
60
- b.SaveImage({
60
+ b.SaveImageWebsocket({
61
61
  images: b.VAEDecode({
62
62
  samples: samples.outputs.output,
63
63
  vae: b.VAELoader({ vae_name: 'flux2-vae.safetensors' }),
64
64
  }),
65
- filename_prefix: 'comfy-ts-zoo/ideogram4-t2i',
66
65
  })
67
66
  },
68
67
  })
@@ -74,7 +73,7 @@ if (import.meta.main) {
74
73
  requireCloudKey()
75
74
  if (process.argv[2]) ideogram4T2i.vars.prompt.set(process.argv[2])
76
75
  if (process.argv[3]) ideogram4T2i.vars.seed.set(Number(process.argv[3]))
77
- const execution = await ideogram4T2i.run({ log: true })
76
+ const execution = await ideogram4T2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/ideogram4-t2i' } })
78
77
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
79
78
  host.disconnect()
80
79
  }
@@ -1,6 +1,7 @@
1
1
  // kandinsky5 i2v on Comfy Cloud — Kandinsky 5.0 Lite image to video, 5s @ 24fps from a start image
2
2
  // source template: video_kandinsky5_i2v.json (official workflow-templates)
3
3
  // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // note: video outputs PERSIST on the host (upstream ships no websocket saver for video — image examples stream ephemerally)
4
5
  // run directly: bun examples/comfy-cloud/kandinsky5-i2v.cflow.ts [path/to/image.png] ["prompt"]
5
6
  import { asAbsolutePath, exampleImagePath, MediaImage, v } from 'comfy-ts'
6
7
  import { cloudHost, requireCloudKey } from './cloudHost.ts'
@@ -43,7 +43,7 @@ export const kandinsky5T2i = host.defineWorkflow({
43
43
  scheduler: 'simple',
44
44
  denoise: 1,
45
45
  })
46
- b.SaveImage({ images: b.VAEDecode({ samples, vae }), filename_prefix: 'comfy-ts-zoo/kandinsky5-t2i' })
46
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
47
47
  },
48
48
  })
49
49
 
@@ -54,7 +54,7 @@ if (import.meta.main) {
54
54
  requireCloudKey()
55
55
  if (process.argv[2]) kandinsky5T2i.vars.prompt.set(process.argv[2])
56
56
  if (process.argv[3]) kandinsky5T2i.vars.seed.set(Number(process.argv[3]))
57
- const execution = await kandinsky5T2i.run({ log: true })
57
+ const execution = await kandinsky5T2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/kandinsky5-t2i' } })
58
58
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
59
59
  host.disconnect()
60
60
  }
@@ -1,6 +1,7 @@
1
1
  // kandinsky5 t2v on Comfy Cloud — Kandinsky 5.0 Lite text to video, 5s @ 24fps (hunyuan video VAE)
2
2
  // source template: video_kandinsky5_t2v.json (official workflow-templates)
3
3
  // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // note: video outputs PERSIST on the host (upstream ships no websocket saver for video — image examples stream ephemerally)
4
5
  // run directly: bun examples/comfy-cloud/kandinsky5-t2v.cflow.ts ["prompt"] [seed]
5
6
  import { v } from 'comfy-ts'
6
7
  import { cloudHost, requireCloudKey } from './cloudHost.ts'
@@ -39,9 +39,8 @@ export const krea2T2i = host.defineWorkflow({
39
39
  scheduler: 'simple',
40
40
  denoise: 1,
41
41
  })
42
- b.SaveImage({
42
+ b.SaveImageWebsocket({
43
43
  images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'qwen_image_vae.safetensors' }) }),
44
- filename_prefix: 'comfy-ts-zoo/krea2-t2i',
45
44
  })
46
45
  },
47
46
  })
@@ -53,7 +52,7 @@ if (import.meta.main) {
53
52
  requireCloudKey()
54
53
  if (process.argv[2]) krea2T2i.vars.prompt.set(process.argv[2])
55
54
  if (process.argv[3]) krea2T2i.vars.seed.set(Number(process.argv[3]))
56
- const execution = await krea2T2i.run({ log: true })
55
+ const execution = await krea2T2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/krea2-t2i' } })
57
56
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
58
57
  host.disconnect()
59
58
  }
@@ -39,12 +39,11 @@ export const lensT2i = host.defineWorkflow({
39
39
  noise_seed: vars.seed,
40
40
  cfg: 1,
41
41
  })
42
- b.SaveImage({
42
+ b.SaveImageWebsocket({
43
43
  images: b.VAEDecode({
44
44
  samples: samples.outputs.output,
45
45
  vae: b.VAELoader({ vae_name: 'flux2-vae.safetensors' }),
46
46
  }),
47
- filename_prefix: 'comfy-ts-zoo/lens-t2i',
48
47
  })
49
48
  },
50
49
  })
@@ -56,7 +55,7 @@ if (import.meta.main) {
56
55
  requireCloudKey()
57
56
  if (process.argv[2]) lensT2i.vars.prompt.set(process.argv[2])
58
57
  if (process.argv[3]) lensT2i.vars.seed.set(Number(process.argv[3]))
59
- const execution = await lensT2i.run({ log: true })
58
+ const execution = await lensT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/lens-t2i' } })
60
59
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
61
60
  host.disconnect()
62
61
  }
@@ -57,7 +57,7 @@ export const longcatI2i = host.defineWorkflow({
57
57
  scheduler: 'simple',
58
58
  denoise: 1,
59
59
  })
60
- b.SaveImage({ images: b.VAEDecode({ samples, vae }), filename_prefix: 'comfy-ts-zoo/longcat-i2i' })
60
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
61
61
  },
62
62
  })
63
63
 
@@ -68,7 +68,7 @@ if (import.meta.main) {
68
68
  requireCloudKey()
69
69
  if (process.argv[2]) longcatI2i.vars.image.set(process.argv[2])
70
70
  if (process.argv[3]) longcatI2i.vars.prompt.set(process.argv[3])
71
- const execution = await longcatI2i.run({ log: true })
71
+ const execution = await longcatI2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/longcat-i2i' } })
72
72
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
73
73
  host.disconnect()
74
74
  }
@@ -45,10 +45,7 @@ export const longcatT2i = host.defineWorkflow({
45
45
  scheduler: 'simple',
46
46
  denoise: 1,
47
47
  })
48
- b.SaveImage({
49
- images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'ae.safetensors' }) }),
50
- filename_prefix: 'comfy-ts-zoo/longcat-t2i',
51
- })
48
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'ae.safetensors' }) }) })
52
49
  },
53
50
  })
54
51
 
@@ -59,7 +56,7 @@ if (import.meta.main) {
59
56
  requireCloudKey()
60
57
  if (process.argv[2]) longcatT2i.vars.prompt.set(process.argv[2])
61
58
  if (process.argv[3]) longcatT2i.vars.seed.set(Number(process.argv[3]))
62
- const execution = await longcatT2i.run({ log: true })
59
+ const execution = await longcatT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/longcat-t2i' } })
63
60
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
64
61
  host.disconnect()
65
62
  }
@@ -1,6 +1,7 @@
1
1
  // ltxv i2v on Comfy Cloud — LTX-Video 2b (v0.9.5) image to video: a start image drives the first frame
2
2
  // source template: ltxv_image_to_video.json (official workflow-templates)
3
3
  // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // note: video outputs PERSIST on the host (upstream ships no websocket saver for video — image examples stream ephemerally)
4
5
  // run directly: bun examples/comfy-cloud/ltxv-i2v.cflow.ts [path/to/image.png] ["prompt"]
5
6
  import { asAbsolutePath, exampleImagePath, MediaImage, v } from 'comfy-ts'
6
7
  import { cloudHost, requireCloudKey } from './cloudHost.ts'
@@ -1,6 +1,7 @@
1
1
  // ltxv t2v on Comfy Cloud — LTX-Video 2b (v0.9) text to video, 97 frames @ 24fps ≈ 4s
2
2
  // source template: ltxv_text_to_video.json (official workflow-templates)
3
3
  // needs COMFY_CLOUD_API_KEY (https://cloud.comfy.org, paid tiers)
4
+ // note: video outputs PERSIST on the host (upstream ships no websocket saver for video — image examples stream ephemerally)
4
5
  // run directly: bun examples/comfy-cloud/ltxv-t2v.cflow.ts ["prompt"] [seed]
5
6
  import { v } from 'comfy-ts'
6
7
  import { cloudHost, requireCloudKey } from './cloudHost.ts'
@@ -47,10 +47,7 @@ export const newbieT2i = host.defineWorkflow({
47
47
  scheduler: 'simple',
48
48
  denoise: 1,
49
49
  })
50
- b.SaveImage({
51
- images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'ae.safetensors' }) }),
52
- filename_prefix: 'comfy-ts-zoo/newbie-t2i',
53
- })
50
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'ae.safetensors' }) }) })
54
51
  },
55
52
  })
56
53
 
@@ -61,7 +58,7 @@ if (import.meta.main) {
61
58
  requireCloudKey()
62
59
  if (process.argv[2]) newbieT2i.vars.prompt.set(process.argv[2])
63
60
  if (process.argv[3]) newbieT2i.vars.seed.set(Number(process.argv[3]))
64
- const execution = await newbieT2i.run({ log: true })
61
+ const execution = await newbieT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/newbie-t2i' } })
65
62
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
66
63
  host.disconnect()
67
64
  }
@@ -64,10 +64,7 @@ export const omnigen2I2i = host.defineWorkflow({
64
64
  batch_size: 1,
65
65
  }),
66
66
  })
67
- b.SaveImage({
68
- images: b.VAEDecode({ samples: samples.outputs.output, vae }),
69
- filename_prefix: 'comfy-ts-zoo/omnigen2-i2i',
70
- })
67
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples: samples.outputs.output, vae }) })
71
68
  },
72
69
  })
73
70
 
@@ -80,7 +77,7 @@ if (import.meta.main) {
80
77
  if (process.argv[3]) omnigen2I2i.vars.prompt.set(process.argv[3])
81
78
  if (process.argv[4]) omnigen2I2i.vars.seed.set(Number(process.argv[4]))
82
79
 
83
- const execution = await omnigen2I2i.run({ log: true })
80
+ const execution = await omnigen2I2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/omnigen2-i2i' } })
84
81
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
85
82
  host.disconnect()
86
83
  }
@@ -41,10 +41,7 @@ export const omnigen2T2i = host.defineWorkflow({
41
41
  sigmas: b.BasicScheduler({ model, scheduler: 'simple', steps: vars.steps, denoise: 1 }),
42
42
  latent_image: b.EmptySD3LatentImage({ width: vars.size.width, height: vars.size.height, batch_size: 1 }),
43
43
  })
44
- b.SaveImage({
45
- images: b.VAEDecode({ samples: samples.outputs.output, vae }),
46
- filename_prefix: 'comfy-ts-zoo/omnigen2-t2i',
47
- })
44
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples: samples.outputs.output, vae }) })
48
45
  },
49
46
  })
50
47
 
@@ -56,7 +53,7 @@ if (import.meta.main) {
56
53
  if (process.argv[2]) omnigen2T2i.vars.prompt.set(process.argv[2])
57
54
  if (process.argv[3]) omnigen2T2i.vars.seed.set(Number(process.argv[3]))
58
55
 
59
- const execution = await omnigen2T2i.run({ log: true })
56
+ const execution = await omnigen2T2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/omnigen2-t2i' } })
60
57
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
61
58
  host.disconnect()
62
59
  }
@@ -36,10 +36,7 @@ export const ovisT2i = host.defineWorkflow({
36
36
  scheduler: 'simple',
37
37
  denoise: 1,
38
38
  })
39
- b.SaveImage({
40
- images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'ae.safetensors' }) }),
41
- filename_prefix: 'comfy-ts-zoo/ovis-t2i',
42
- })
39
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'ae.safetensors' }) }) })
43
40
  },
44
41
  })
45
42
 
@@ -50,7 +47,7 @@ if (import.meta.main) {
50
47
  requireCloudKey()
51
48
  if (process.argv[2]) ovisT2i.vars.prompt.set(process.argv[2])
52
49
  if (process.argv[3]) ovisT2i.vars.seed.set(Number(process.argv[3]))
53
- const execution = await ovisT2i.run({ log: true })
50
+ const execution = await ovisT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/ovis-t2i' } })
54
51
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
55
52
  host.disconnect()
56
53
  }
@@ -43,10 +43,7 @@ export const pixelditT2i = host.defineWorkflow({
43
43
  scheduler: 'simple',
44
44
  denoise: 1,
45
45
  })
46
- b.SaveImage({
47
- images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'pixel_space' }) }),
48
- filename_prefix: 'comfy-ts-zoo/pixeldit-t2i',
49
- })
46
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae: b.VAELoader({ vae_name: 'pixel_space' }) }) })
50
47
  },
51
48
  })
52
49
 
@@ -57,7 +54,7 @@ if (import.meta.main) {
57
54
  requireCloudKey()
58
55
  if (process.argv[2]) pixelditT2i.vars.prompt.set(process.argv[2])
59
56
  if (process.argv[3]) pixelditT2i.vars.seed.set(Number(process.argv[3]))
60
- const execution = await pixelditT2i.run({ log: true })
57
+ const execution = await pixelditT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/pixeldit-t2i' } })
61
58
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
62
59
  host.disconnect()
63
60
  }
@@ -52,7 +52,7 @@ export const qwenImageI2i = host.defineWorkflow({
52
52
  scheduler: 'simple',
53
53
  denoise: 1,
54
54
  })
55
- b.SaveImage({ images: b.VAEDecode({ samples, vae }), filename_prefix: 'comfy-ts-zoo/qwen-image-i2i' })
55
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
56
56
  },
57
57
  })
58
58
 
@@ -63,7 +63,7 @@ if (import.meta.main) {
63
63
  requireCloudKey()
64
64
  if (process.argv[2]) qwenImageI2i.vars.image.set(process.argv[2])
65
65
  if (process.argv[3]) qwenImageI2i.vars.prompt.set(process.argv[3])
66
- const execution = await qwenImageI2i.run({ log: true })
66
+ const execution = await qwenImageI2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/qwen-image-i2i' } })
67
67
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
68
68
  host.disconnect()
69
69
  }
@@ -38,7 +38,7 @@ export const qwenImageT2i = host.defineWorkflow({
38
38
  scheduler: 'simple',
39
39
  denoise: 1,
40
40
  })
41
- b.SaveImage({ images: b.VAEDecode({ samples, vae }), filename_prefix: 'comfy-ts-zoo/qwen-image-t2i' })
41
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae }) })
42
42
  },
43
43
  })
44
44
 
@@ -49,7 +49,7 @@ if (import.meta.main) {
49
49
  requireCloudKey()
50
50
  if (process.argv[2]) qwenImageT2i.vars.prompt.set(process.argv[2])
51
51
  if (process.argv[3]) qwenImageT2i.vars.seed.set(Number(process.argv[3]))
52
- const execution = await qwenImageT2i.run({ log: true })
52
+ const execution = await qwenImageT2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/qwen-image-t2i' } })
53
53
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
54
54
  host.disconnect()
55
55
  }
@@ -31,7 +31,7 @@ export const sd35T2i = host.defineWorkflow({
31
31
  scheduler: 'sgm_uniform',
32
32
  denoise: 1,
33
33
  })
34
- b.SaveImage({ images: b.VAEDecode({ samples, vae: ckpt }), filename_prefix: 'comfy-ts-zoo/sd35-t2i' })
34
+ b.SaveImageWebsocket({ images: b.VAEDecode({ samples, vae: ckpt }) })
35
35
  },
36
36
  })
37
37
 
@@ -42,7 +42,7 @@ if (import.meta.main) {
42
42
  requireCloudKey()
43
43
  if (process.argv[2]) sd35T2i.vars.prompt.set(process.argv[2])
44
44
  if (process.argv[3]) sd35T2i.vars.seed.set(Number(process.argv[3]))
45
- const execution = await sd35T2i.run({ log: true })
45
+ const execution = await sd35T2i.run({ log: true, save: { prefix: 'comfy-ts-zoo/sd35-t2i' } })
46
46
  for (const img of execution.images) console.log(`🟢 ${img.absPath}`)
47
47
  host.disconnect()
48
48
  }