comfy-ts 2.24.0 → 2.25.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 (321) hide show
  1. package/dist/chunk-6mgjbrp6.js +579 -0
  2. package/dist/chunk-6mgjbrp6.js.map +17 -0
  3. package/dist/chunk-6tsg7fm5.js +1876 -0
  4. package/dist/chunk-6tsg7fm5.js.map +31 -0
  5. package/dist/chunk-dvxjvwe7.js +2593 -0
  6. package/dist/chunk-dvxjvwe7.js.map +29 -0
  7. package/dist/chunk-dw0t1nye.js +457 -0
  8. package/dist/chunk-dw0t1nye.js.map +16 -0
  9. package/dist/chunk-he70ewwx.js +444 -0
  10. package/dist/chunk-he70ewwx.js.map +13 -0
  11. package/dist/chunk-n22qz0j1.js +6663 -0
  12. package/dist/chunk-n22qz0j1.js.map +95 -0
  13. package/dist/chunk-n35nffm8.js +4777 -0
  14. package/dist/chunk-n35nffm8.js.map +51 -0
  15. package/dist/cli/serve/hostProtocol.d.cts +74 -0
  16. package/dist/cli/serve/hostProtocol.d.ts +74 -0
  17. package/dist/cli/tui-env.d.cts +2 -0
  18. package/dist/cli/tui-env.d.ts +2 -0
  19. package/dist/cli.js +494 -485
  20. package/dist/cli.js.map +16 -1
  21. package/dist/coreExports.d.cts +45 -0
  22. package/dist/coreExports.d.ts +45 -0
  23. package/dist/errors/InvalidPromptError.d.cts +10 -0
  24. package/dist/errors/InvalidPromptError.d.ts +10 -0
  25. package/dist/exampleAssets.d.cts +24 -0
  26. package/dist/exampleAssets.d.ts +24 -0
  27. package/dist/graph/ComfyNode.d.cts +109 -0
  28. package/dist/graph/ComfyNode.d.ts +109 -0
  29. package/dist/graph/ComfyNodeID.d.cts +15 -0
  30. package/dist/graph/ComfyNodeID.d.ts +15 -0
  31. package/dist/graph/ComfyNodeOutput.d.cts +21 -0
  32. package/dist/graph/ComfyNodeOutput.d.ts +21 -0
  33. package/dist/graph/NodeSlotSize.d.cts +4 -0
  34. package/dist/graph/NodeSlotSize.d.ts +4 -0
  35. package/dist/graph/autoValue.d.cts +16 -0
  36. package/dist/graph/autoValue.d.ts +16 -0
  37. package/dist/host/ComfyHost.d.cts +383 -0
  38. package/dist/host/ComfyHost.d.ts +383 -0
  39. package/dist/host/ComfyInstallType.d.cts +11 -0
  40. package/dist/host/ComfyInstallType.d.ts +11 -0
  41. package/dist/host/ComfyManager.d.cts +152 -0
  42. package/dist/host/ComfyManager.d.ts +152 -0
  43. package/dist/host/ComfyUploader.d.cts +42 -0
  44. package/dist/host/ComfyUploader.d.ts +42 -0
  45. package/dist/host/ComfyWorkflowBuilder.d.cts +19 -0
  46. package/dist/host/ComfyWorkflowBuilder.d.ts +19 -0
  47. package/dist/host/Requirements.d.cts +43 -0
  48. package/dist/host/Requirements.d.ts +43 -0
  49. package/dist/host/ResilientWebsocket.d.cts +122 -0
  50. package/dist/host/ResilientWebsocket.d.ts +122 -0
  51. package/dist/host/hostFile.d.cts +23 -0
  52. package/dist/host/hostFile.d.ts +23 -0
  53. package/dist/host/hostUrl.d.cts +22 -0
  54. package/dist/host/hostUrl.d.ts +22 -0
  55. package/dist/host/leastBusy.d.cts +9 -0
  56. package/dist/host/leastBusy.d.ts +9 -0
  57. package/dist/host/loraInfoCache.d.cts +110 -0
  58. package/dist/host/loraInfoCache.d.ts +110 -0
  59. package/dist/host/loraManagerApi.d.cts +106 -0
  60. package/dist/host/loraManagerApi.d.ts +106 -0
  61. package/dist/host/previewMethod.d.cts +5 -0
  62. package/dist/host/previewMethod.d.ts +5 -0
  63. package/dist/host/schemaDrift.d.cts +54 -0
  64. package/dist/host/schemaDrift.d.ts +54 -0
  65. package/dist/image-utils/_getPngMetadata.d.cts +5 -0
  66. package/dist/image-utils/_getPngMetadata.d.ts +5 -0
  67. package/dist/index.cjs +8197 -8509
  68. package/dist/index.cjs.map +124 -1
  69. package/dist/index.d.cts +4 -19116
  70. package/dist/index.d.ts +4 -19116
  71. package/dist/index.js +8129 -8390
  72. package/dist/index.js.map +124 -1
  73. package/dist/litegraph/CanonicalWorkflow.d.cts +75 -0
  74. package/dist/litegraph/CanonicalWorkflow.d.ts +75 -0
  75. package/dist/litegraph/LiteGraphGroup.d.cts +17 -0
  76. package/dist/litegraph/LiteGraphGroup.d.ts +17 -0
  77. package/dist/litegraph/LiteGraphJSON.d.cts +242 -0
  78. package/dist/litegraph/LiteGraphJSON.d.ts +242 -0
  79. package/dist/litegraph/LiteGraphLink.d.cts +48 -0
  80. package/dist/litegraph/LiteGraphLink.d.ts +48 -0
  81. package/dist/litegraph/LiteGraphLinkID.d.cts +6 -0
  82. package/dist/litegraph/LiteGraphLinkID.d.ts +6 -0
  83. package/dist/litegraph/LiteGraphNode.d.cts +76 -0
  84. package/dist/litegraph/LiteGraphNode.d.ts +76 -0
  85. package/dist/litegraph/LiteGraphNodeInput.d.cts +25 -0
  86. package/dist/litegraph/LiteGraphNodeInput.d.ts +25 -0
  87. package/dist/litegraph/LiteGraphNodeOutput.d.cts +20 -0
  88. package/dist/litegraph/LiteGraphNodeOutput.d.ts +20 -0
  89. package/dist/litegraph/LiteGraphSlotIndex.d.cts +6 -0
  90. package/dist/litegraph/LiteGraphSlotIndex.d.ts +6 -0
  91. package/dist/litegraph/LiteGraphSubgraphDef.d.cts +174 -0
  92. package/dist/litegraph/LiteGraphSubgraphDef.d.ts +174 -0
  93. package/dist/litegraph/convertFlowToLiteGraphJSON.d.cts +12 -0
  94. package/dist/litegraph/convertFlowToLiteGraphJSON.d.ts +12 -0
  95. package/dist/litegraph/expandSubgraphs.d.cts +27 -0
  96. package/dist/litegraph/expandSubgraphs.d.ts +27 -0
  97. package/dist/litegraph/normalizeWorkflow.d.cts +21 -0
  98. package/dist/litegraph/normalizeWorkflow.d.ts +21 -0
  99. package/dist/manager/ComfyRegistry.d.cts +54 -0
  100. package/dist/manager/ComfyRegistry.d.ts +54 -0
  101. package/dist/manager/generated/KnownComfyCustomNodeName.d.cts +1 -0
  102. package/dist/manager/generated/KnownComfyCustomNodeName.d.ts +1 -0
  103. package/dist/manager/generated/KnownComfyPluginTitle.d.cts +12109 -0
  104. package/dist/manager/generated/KnownComfyPluginTitle.d.ts +12109 -0
  105. package/dist/manager/generated/KnownComfyPluginURL.d.cts +1 -0
  106. package/dist/manager/generated/KnownComfyPluginURL.d.ts +1 -0
  107. package/dist/manager/generated/KnownModel_Base.d.cts +2 -0
  108. package/dist/manager/generated/KnownModel_Base.d.ts +2 -0
  109. package/dist/manager/generated/KnownModel_Name.d.cts +2842 -0
  110. package/dist/manager/generated/KnownModel_Name.d.ts +2842 -0
  111. package/dist/manager/generated/KnownModel_SavePath.d.cts +2 -0
  112. package/dist/manager/generated/KnownModel_SavePath.d.ts +2 -0
  113. package/dist/manager/generated/KnownModel_Type.d.cts +2 -0
  114. package/dist/manager/generated/KnownModel_Type.d.ts +2 -0
  115. package/dist/manager/installedView.d.cts +65 -0
  116. package/dist/manager/installedView.d.ts +65 -0
  117. package/dist/manager/json/custom-node-list.extra.d.cts +2 -0
  118. package/dist/manager/json/custom-node-list.extra.d.ts +2 -0
  119. package/dist/manager/json/model-list.extra.d.cts +2 -0
  120. package/dist/manager/json/model-list.extra.d.ts +2 -0
  121. package/dist/manager/loaders/parseReport.d.cts +24 -0
  122. package/dist/manager/loaders/parseReport.d.ts +24 -0
  123. package/dist/manager/loaders/step1_downloadComfyManagerJSONs.d.cts +1 -0
  124. package/dist/manager/loaders/step1_downloadComfyManagerJSONs.d.ts +1 -0
  125. package/dist/manager/loaders/step2_custom-node-list-loader.d.cts +2 -0
  126. package/dist/manager/loaders/step2_custom-node-list-loader.d.ts +2 -0
  127. package/dist/manager/loaders/step3_extension-node-map-loader.d.cts +2 -0
  128. package/dist/manager/loaders/step3_extension-node-map-loader.d.ts +2 -0
  129. package/dist/manager/loaders/step4_model-list-loader.d.cts +2 -0
  130. package/dist/manager/loaders/step4_model-list-loader.d.ts +2 -0
  131. package/dist/manager/loaders/step5_alter-list-loader.d.cts +2 -0
  132. package/dist/manager/loaders/step5_alter-list-loader.d.ts +2 -0
  133. package/dist/manager/loaders/step6_github-stats-loader.d.cts +2 -0
  134. package/dist/manager/loaders/step6_github-stats-loader.d.ts +2 -0
  135. package/dist/manager/types/ComfyManagerAPIFetchPolicy.d.cts +7 -0
  136. package/dist/manager/types/ComfyManagerAPIFetchPolicy.d.ts +7 -0
  137. package/dist/manager/types/ComfyManagerAPIModelList.d.cts +10 -0
  138. package/dist/manager/types/ComfyManagerAPIModelList.d.ts +10 -0
  139. package/dist/manager/types/ComfyManagerAPIPluginList.d.cts +33 -0
  140. package/dist/manager/types/ComfyManagerAPIPluginList.d.ts +33 -0
  141. package/dist/manager/types/ComfyManagerAlterInfo.d.cts +12 -0
  142. package/dist/manager/types/ComfyManagerAlterInfo.d.ts +12 -0
  143. package/dist/manager/types/ComfyManagerFileModelInfo.d.cts +10 -0
  144. package/dist/manager/types/ComfyManagerFileModelInfo.d.ts +10 -0
  145. package/dist/manager/types/ComfyManagerFilePluginContent.d.cts +11 -0
  146. package/dist/manager/types/ComfyManagerFilePluginContent.d.ts +11 -0
  147. package/dist/manager/types/ComfyManagerFilePluginList.d.cts +5 -0
  148. package/dist/manager/types/ComfyManagerFilePluginList.d.ts +5 -0
  149. package/dist/manager/types/ComfyManagerGithubStats.d.cts +7 -0
  150. package/dist/manager/types/ComfyManagerGithubStats.d.ts +7 -0
  151. package/dist/manager/types/ComfyManagerModelInfo.d.cts +12 -0
  152. package/dist/manager/types/ComfyManagerModelInfo.d.ts +12 -0
  153. package/dist/manager/types/ComfyManagerPluginContentMetadata.d.cts +10 -0
  154. package/dist/manager/types/ComfyManagerPluginContentMetadata.d.ts +10 -0
  155. package/dist/manager/types/ComfyManagerPluginEnums.d.cts +5 -0
  156. package/dist/manager/types/ComfyManagerPluginEnums.d.ts +5 -0
  157. package/dist/manager/types/ComfyManagerPluginInfo.d.cts +54 -0
  158. package/dist/manager/types/ComfyManagerPluginInfo.d.ts +54 -0
  159. package/dist/promptEnhancers.d.cts +22 -0
  160. package/dist/promptEnhancers.d.ts +22 -0
  161. package/dist/runner/ComfyExecution.d.cts +230 -0
  162. package/dist/runner/ComfyExecution.d.ts +230 -0
  163. package/dist/runner/ComfyExecutionStatus.d.cts +1 -0
  164. package/dist/runner/ComfyExecutionStatus.d.ts +1 -0
  165. package/dist/runner/ComfyWorkflow.d.cts +141 -0
  166. package/dist/runner/ComfyWorkflow.d.ts +141 -0
  167. package/dist/runner/ComfyWorkflowLayout.d.cts +17 -0
  168. package/dist/runner/ComfyWorkflowLayout.d.ts +17 -0
  169. package/dist/runner/ComfyWsApi.d.cts +2174 -0
  170. package/dist/runner/ComfyWsApi.d.ts +2174 -0
  171. package/dist/runner/MediaImage.d.cts +127 -0
  172. package/dist/runner/MediaImage.d.ts +127 -0
  173. package/dist/runner/comfyOrgApiKey.d.cts +21 -0
  174. package/dist/runner/comfyOrgApiKey.d.ts +21 -0
  175. package/dist/runner/describePromptRejection.d.cts +1 -0
  176. package/dist/runner/describePromptRejection.d.ts +1 -0
  177. package/dist/runner/ephemeral.d.cts +10 -0
  178. package/dist/runner/ephemeral.d.ts +10 -0
  179. package/dist/runner/historyReplay.d.cts +13 -0
  180. package/dist/runner/historyReplay.d.ts +13 -0
  181. package/dist/runner/mediaKinds.d.cts +7 -0
  182. package/dist/runner/mediaKinds.d.ts +7 -0
  183. package/dist/runner/outputPath.d.cts +40 -0
  184. package/dist/runner/outputPath.d.ts +40 -0
  185. package/dist/runner/outputs3d.d.cts +3 -0
  186. package/dist/runner/outputs3d.d.ts +3 -0
  187. package/dist/runner/wsBinaryFrame.d.cts +25 -0
  188. package/dist/runner/wsBinaryFrame.d.ts +25 -0
  189. package/dist/sdk-generator/ComfyNodeSchema.d.cts +25 -0
  190. package/dist/sdk-generator/ComfyNodeSchema.d.ts +25 -0
  191. package/dist/sdk-generator/ComfySchema.d.cts +74 -0
  192. package/dist/sdk-generator/ComfySchema.d.ts +74 -0
  193. package/dist/sdk-generator/ComfyUIObjectInfoTypes.d.cts +3072 -0
  194. package/dist/sdk-generator/ComfyUIObjectInfoTypes.d.ts +3072 -0
  195. package/dist/sdk-generator/Primitives.d.cts +12 -0
  196. package/dist/sdk-generator/Primitives.d.ts +12 -0
  197. package/dist/sdk-generator/_getUnionNameBasedOnFirstFoundEnumName.d.cts +2 -0
  198. package/dist/sdk-generator/_getUnionNameBasedOnFirstFoundEnumName.d.ts +2 -0
  199. package/dist/sdk-generator/_pythonModuleToNamespace.d.cts +1 -0
  200. package/dist/sdk-generator/_pythonModuleToNamespace.d.ts +1 -0
  201. package/dist/sdk-generator/_toQualifiedNodeKey.d.cts +1 -0
  202. package/dist/sdk-generator/_toQualifiedNodeKey.d.ts +1 -0
  203. package/dist/sdk-generator/comfy-api-json.d.cts +16 -0
  204. package/dist/sdk-generator/comfy-api-json.d.ts +16 -0
  205. package/dist/sdk-generator/comfyui-sdk-codegen.d.cts +23 -0
  206. package/dist/sdk-generator/comfyui-sdk-codegen.d.ts +23 -0
  207. package/dist/sdk-generator/comfyui-types.d.cts +55 -0
  208. package/dist/sdk-generator/comfyui-types.d.ts +55 -0
  209. package/dist/sdk-generator/inputWidgetKind.d.cts +80 -0
  210. package/dist/sdk-generator/inputWidgetKind.d.ts +80 -0
  211. package/dist/sdk-generator/litegraphToApiRequestPayload.d.cts +41 -0
  212. package/dist/sdk-generator/litegraphToApiRequestPayload.d.ts +41 -0
  213. package/dist/serve-web.js +51 -51
  214. package/dist/ssh-host-manager/ssh-config-manager.d.cts +17 -0
  215. package/dist/ssh-host-manager/ssh-config-manager.d.ts +17 -0
  216. package/dist/state.d.cts +80 -0
  217. package/dist/state.d.ts +80 -0
  218. package/dist/storage/ComfyStorage.d.cts +55 -0
  219. package/dist/storage/ComfyStorage.d.ts +55 -0
  220. package/dist/storage/nodeStorage.d.cts +2 -0
  221. package/dist/storage/nodeStorage.d.ts +2 -0
  222. package/dist/types/comfy-sdk.d.cts +85 -0
  223. package/dist/types/comfy-sdk.d.ts +85 -0
  224. package/dist/types/index.d.cts +65 -0
  225. package/dist/types/index.d.ts +65 -0
  226. package/dist/utils/CodeBuffer.d.cts +20 -0
  227. package/dist/utils/CodeBuffer.d.ts +20 -0
  228. package/dist/utils/ComfyColors.d.cts +14 -0
  229. package/dist/utils/ComfyColors.d.ts +14 -0
  230. package/dist/utils/ansi.d.cts +22 -0
  231. package/dist/utils/ansi.d.ts +22 -0
  232. package/dist/utils/bang.d.cts +9 -0
  233. package/dist/utils/bang.d.ts +9 -0
  234. package/dist/utils/deepCopyNaive.d.cts +1 -0
  235. package/dist/utils/deepCopyNaive.d.ts +1 -0
  236. package/dist/utils/downloadFile.d.cts +2 -0
  237. package/dist/utils/downloadFile.d.ts +2 -0
  238. package/dist/utils/escapeJSKey.d.cts +2 -0
  239. package/dist/utils/escapeJSKey.d.ts +2 -0
  240. package/dist/utils/exhaust.d.cts +1 -0
  241. package/dist/utils/exhaust.d.ts +1 -0
  242. package/dist/utils/extractErrorMessage.d.cts +2 -0
  243. package/dist/utils/extractErrorMessage.d.ts +2 -0
  244. package/dist/utils/githubRegexes.d.cts +2 -0
  245. package/dist/utils/githubRegexes.d.ts +2 -0
  246. package/dist/utils/hashArrayBuffer.d.cts +1 -0
  247. package/dist/utils/hashArrayBuffer.d.ts +1 -0
  248. package/dist/utils/isRecord.d.cts +2 -0
  249. package/dist/utils/isRecord.d.ts +2 -0
  250. package/dist/utils/lazySharp.d.cts +3 -0
  251. package/dist/utils/lazySharp.d.ts +3 -0
  252. package/dist/utils/log.d.cts +4 -0
  253. package/dist/utils/log.d.ts +4 -0
  254. package/dist/utils/loraTag.d.cts +8 -0
  255. package/dist/utils/loraTag.d.ts +8 -0
  256. package/dist/utils/matchesRegex.d.cts +2 -0
  257. package/dist/utils/matchesRegex.d.ts +2 -0
  258. package/dist/utils/printArkResultInConsole.d.cts +2 -0
  259. package/dist/utils/printArkResultInConsole.d.ts +2 -0
  260. package/dist/utils/safeName.d.cts +6 -0
  261. package/dist/utils/safeName.d.ts +6 -0
  262. package/dist/utils/sha1.d.cts +2 -0
  263. package/dist/utils/sha1.d.ts +2 -0
  264. package/dist/utils/softValidate.d.cts +2 -0
  265. package/dist/utils/softValidate.d.ts +2 -0
  266. package/dist/utils/stringifyReadable.d.cts +1 -0
  267. package/dist/utils/stringifyReadable.d.ts +1 -0
  268. package/dist/utils/toposort.d.cts +3 -0
  269. package/dist/utils/toposort.d.ts +3 -0
  270. package/dist/vars/ComfyVars.d.cts +607 -0
  271. package/dist/vars/ComfyVars.d.ts +607 -0
  272. package/dist/vars/DefinedWorkflow.d.cts +104 -0
  273. package/dist/vars/DefinedWorkflow.d.ts +104 -0
  274. package/dist/vars/lanes.d.cts +81 -0
  275. package/dist/vars/lanes.d.ts +81 -0
  276. package/dist/vars/loraEntry.d.cts +26 -0
  277. package/dist/vars/loraEntry.d.ts +26 -0
  278. package/dist/vars/loraKeywords.d.cts +19 -0
  279. package/dist/vars/loraKeywords.d.ts +19 -0
  280. package/dist/vars/outputWidgets.d.cts +33 -0
  281. package/dist/vars/outputWidgets.d.ts +33 -0
  282. package/dist/vars/presets.d.cts +9 -0
  283. package/dist/vars/presets.d.ts +9 -0
  284. package/dist/vars/promptSyntax.d.cts +98 -0
  285. package/dist/vars/promptSyntax.d.ts +98 -0
  286. package/dist/web.d.cts +2 -0
  287. package/dist/web.d.ts +2 -19160
  288. package/dist/web.js +8040 -8292
  289. package/dist/web.js.map +119 -1
  290. package/examples/depth-explorer/web/tsconfig.json +1 -2
  291. package/examples/upscale-explorer/web/tsconfig.json +1 -2
  292. package/examples/web/tsconfig.json +1 -4
  293. package/examples/world-explorer/web/tsconfig.json +1 -2
  294. package/package.json +27 -32
  295. package/src/cli/serve/web/components/SideMenu.tsx +1 -1
  296. package/src/cli/serve/web/components/controls/LorasControl.tsx +2 -0
  297. package/src/cli/serve/web/components/controls/RichSelect.tsx +1 -0
  298. package/src/cli/serve/web/state/RunSt.poll.test.ts +2 -1
  299. package/src/cli/serve/web/tsconfig.json +1 -2
  300. package/src/cli/serve/web/widgets/RelightWidget.tsx +1 -0
  301. package/src/cli/tui/state/HostSt.ts +1 -1
  302. package/src/host/loraManagerApi.ts +8 -3
  303. package/src/runner/ComfyExecution.ts +3 -1
  304. package/src/runner/ComfyWsApi.ts +2 -1
  305. package/src/storage/ComfyStorage.ts +5 -4
  306. package/src/types/comfy-sdk.ts +1 -0
  307. package/src/utils/ansi.ts +1 -0
  308. package/dist/ServeApp-fsHtW5zG.js +0 -2689
  309. package/dist/ServeApp-fsHtW5zG.js.map +0 -1
  310. package/dist/exampleAssets-DZynSkZm.js +0 -6674
  311. package/dist/exampleAssets-DZynSkZm.js.map +0 -1
  312. package/dist/findDefinedWorkflow-qyqFea7q.js +0 -625
  313. package/dist/findDefinedWorkflow-qyqFea7q.js.map +0 -1
  314. package/dist/run-run-Cn2JzKlE.js +0 -449
  315. package/dist/run-run-Cn2JzKlE.js.map +0 -1
  316. package/dist/run-serve-BhGegaCI.js +0 -464
  317. package/dist/run-serve-BhGegaCI.js.map +0 -1
  318. package/dist/run-tui-CrM4ijkH.js +0 -4569
  319. package/dist/run-tui-CrM4ijkH.js.map +0 -1
  320. package/dist/schemaDrift-BGYJZGMD.js +0 -2225
  321. package/dist/schemaDrift-BGYJZGMD.js.map +0 -1
@@ -0,0 +1,15 @@
1
+ import type { Maybe, Tagged } from '../types/index.cjs';
2
+ export type ComfyNodeId = Tagged<string, 'ComfyNodeId'>;
3
+ export declare const ComfyNodeId_ark: import("arktype/internal/variants/object.ts").ObjectType<ComfyNodeId, {}>;
4
+ export type ComfyNodeMetadata = {
5
+ id?: Maybe<ComfyNodeId>;
6
+ tag?: string;
7
+ /** list of tags;
8
+ * those tags will be copied to assets generated by this node.
9
+ * e.g. you can add tags to SaveImage or PreviewImage to automatically tag images they'll produce. */
10
+ tags?: string[];
11
+ /** If the node produces an image, image will be stored in an ImageStore with given name.
12
+ * ImageStore are useful for example to always have access to the image when re-running a workflow despite ComfyUI caching. */
13
+ storeAs?: string;
14
+ };
15
+ export declare const ComfyNodeMetadata_ark: import("arktype/internal/variants/object.ts").ObjectType<ComfyNodeMetadata, {}>;
@@ -0,0 +1,15 @@
1
+ import type { Maybe, Tagged } from '../types/index.js';
2
+ export type ComfyNodeId = Tagged<string, 'ComfyNodeId'>;
3
+ export declare const ComfyNodeId_ark: import("arktype/internal/variants/object.ts").ObjectType<ComfyNodeId, {}>;
4
+ export type ComfyNodeMetadata = {
5
+ id?: Maybe<ComfyNodeId>;
6
+ tag?: string;
7
+ /** list of tags;
8
+ * those tags will be copied to assets generated by this node.
9
+ * e.g. you can add tags to SaveImage or PreviewImage to automatically tag images they'll produce. */
10
+ tags?: string[];
11
+ /** If the node produces an image, image will be stored in an ImageStore with given name.
12
+ * ImageStore are useful for example to always have access to the image when re-running a workflow despite ComfyUI caching. */
13
+ storeAs?: string;
14
+ };
15
+ export declare const ComfyNodeMetadata_ark: import("arktype/internal/variants/object.ts").ObjectType<ComfyNodeMetadata, {}>;
@@ -0,0 +1,21 @@
1
+ import type { ComfyNode } from './ComfyNode.cjs';
2
+ export declare class ComfyNodeOutput<T extends string = string, Ix extends number = number> {
3
+ node: ComfyNode<object>;
4
+ slotIx: Ix;
5
+ type: T;
6
+ /**
7
+ * as of 2024-11-16, output slots have no name in comfy, only a type.
8
+ * Problem is that some nodes have multiple outputs of the same type.
9
+ * so subsequent outputs with a previous used name will be suffixed
10
+ * and have named like `output_2`, `output_3`, etc.
11
+ */
12
+ name: string;
13
+ constructor(node: ComfyNode<object>, slotIx: Ix, type: T,
14
+ /**
15
+ * as of 2024-11-16, output slots have no name in comfy, only a type.
16
+ * Problem is that some nodes have multiple outputs of the same type.
17
+ * so subsequent outputs with a previous used name will be suffixed
18
+ * and have named like `output_2`, `output_3`, etc.
19
+ */
20
+ name: string);
21
+ }
@@ -0,0 +1,21 @@
1
+ import type { ComfyNode } from './ComfyNode.js';
2
+ export declare class ComfyNodeOutput<T extends string = string, Ix extends number = number> {
3
+ node: ComfyNode<object>;
4
+ slotIx: Ix;
5
+ type: T;
6
+ /**
7
+ * as of 2024-11-16, output slots have no name in comfy, only a type.
8
+ * Problem is that some nodes have multiple outputs of the same type.
9
+ * so subsequent outputs with a previous used name will be suffixed
10
+ * and have named like `output_2`, `output_3`, etc.
11
+ */
12
+ name: string;
13
+ constructor(node: ComfyNode<object>, slotIx: Ix, type: T,
14
+ /**
15
+ * as of 2024-11-16, output slots have no name in comfy, only a type.
16
+ * Problem is that some nodes have multiple outputs of the same type.
17
+ * so subsequent outputs with a previous used name will be suffixed
18
+ * and have named like `output_2`, `output_3`, etc.
19
+ */
20
+ name: string);
21
+ }
@@ -0,0 +1,4 @@
1
+ export declare const nodeLineHeight: 20;
2
+ export declare const NodeTitleHeight: 20;
3
+ export declare const NodeSlotSize: 10;
4
+ export declare const NodeSlotVSep: 5;
@@ -0,0 +1,4 @@
1
+ export declare const nodeLineHeight: 20;
2
+ export declare const NodeTitleHeight: 20;
3
+ export declare const NodeSlotSize: 10;
4
+ export declare const NodeSlotVSep: 5;
@@ -0,0 +1,16 @@
1
+ import type { Branded } from '../types/index.cjs';
2
+ /**
3
+ * a fake value that is detected at serialization
4
+ * time to try to magically inject stuff
5
+ * */
6
+ export type AUTO = Branded<{
7
+ ___AUTO___: true;
8
+ }, {
9
+ AUTO: true;
10
+ }>;
11
+ /**
12
+ * you can use this as a placeholder anywhere in your graph
13
+ * comfy-ts wires the most recent output of a matching type at serialization time
14
+ */
15
+ export declare const auto: <T>() => T;
16
+ export declare const auto_: AUTO;
@@ -0,0 +1,16 @@
1
+ import type { Branded } from '../types/index.js';
2
+ /**
3
+ * a fake value that is detected at serialization
4
+ * time to try to magically inject stuff
5
+ * */
6
+ export type AUTO = Branded<{
7
+ ___AUTO___: true;
8
+ }, {
9
+ AUTO: true;
10
+ }>;
11
+ /**
12
+ * you can use this as a placeholder anywhere in your graph
13
+ * comfy-ts wires the most recent output of a matching type at serialization time
14
+ */
15
+ export declare const auto: <T>() => T;
16
+ export declare const auto_: AUTO;
@@ -0,0 +1,383 @@
1
+ import type { KnownComfyPluginTitle } from '../manager/generated/KnownComfyPluginTitle.cjs';
2
+ import type { KnownComfyPluginURL } from '../manager/generated/KnownComfyPluginURL.cjs';
3
+ import type { ComfyManagerPluginInfo } from '../manager/types/ComfyManagerPluginInfo.cjs';
4
+ import type { ComfyExecution } from '../runner/ComfyExecution.cjs';
5
+ import type { ComfyApiJson } from '../sdk-generator/comfy-api-json.cjs';
6
+ import { type PreviewMethod } from './previewMethod.cjs';
7
+ import { ComfyWorkflow } from '../runner/ComfyWorkflow.cjs';
8
+ import { type ComfyStatusData, type LogEntry, type PromptID, type PendingWsItem, type PromptRelated_WsMsg, type WsMsg } from '../runner/ComfyWsApi.cjs';
9
+ import { ComfySchema } from '../sdk-generator/ComfySchema.cjs';
10
+ import { type AbsolutePath, type Maybe, type number_Timestamp, type Tagged } from '../types/index.cjs';
11
+ import type { ComfyInstallType } from './ComfyInstallType.cjs';
12
+ import { ComfyManager } from './ComfyManager.cjs';
13
+ import { ComfyUploader } from './ComfyUploader.cjs';
14
+ import { type ParsedHostBase } from './hostUrl.cjs';
15
+ import type { Requirements } from './Requirements.cjs';
16
+ import { ResilientWebSocketClient, type WsMessageEvent } from './ResilientWebsocket.cjs';
17
+ import { DefinedWorkflow, type DefineWorkflowSpec } from '../vars/DefinedWorkflow.cjs';
18
+ import type { VarsSpec } from '../vars/ComfyVars.cjs';
19
+ import { type SchemaDrift } from './schemaDrift.cjs';
20
+ import type { ComfyOrgApiKeySource } from '../runner/comfyOrgApiKey.cjs';
21
+ export type ComfyHostID = Tagged<string, {
22
+ HostID: true;
23
+ }>;
24
+ export type ComfyHostData = {
25
+ id: string;
26
+ /** full base url as pasted from a provider (https://cloud.comfy.org,
27
+ * https://xxx.modal.run, http://192.168.1.5:8188/comfy).
28
+ * Exactly ONE of url OR the legacy host+port (+https?) spelling. */
29
+ url?: string;
30
+ host?: string;
31
+ port?: number;
32
+ https?: boolean;
33
+ /** sent as X-API-Key on every request AND the ws upgrade.
34
+ * NEVER persist the value: read it from an env var (e.g. COMFY_CLOUD_API_KEY) */
35
+ apiKey?: string;
36
+ /** the Comfy account key (platform.comfy.org) that paid partner API nodes bill to, sent as
37
+ * `extra_data.api_key_comfy_org` with a prompt that holds one. A thunk is read only when such
38
+ * a run starts. `RunSettings.comfyOrgApiKey` overrides it for one run; a cloud.comfy.org host
39
+ * falls back to its apiKey. NEVER persist the value (architecture.md, Partner API nodes) */
40
+ comfyOrgApiKey?: ComfyOrgApiKeySource;
41
+ /** default true. false = never write sdk.d.ts to .comfy-ts/hosts/<id>/ —
42
+ * schema updates stay in-memory. The comfy-cloud example sets false: its sdk
43
+ * home is the COMMITTED examples/comfy-cloud/sdk.d.ts (gen:sdk:cloud), and a
44
+ * second copy under .comfy-ts/hosts/ would double-declare the globals. */
45
+ sdkAutoWrite?: boolean;
46
+ /** extra headers merged into every request + the ws upgrade (Modal-style auth pairs) */
47
+ headers?: Record<string, string>;
48
+ installType?: ComfyInstallType;
49
+ onWsMessageAny?: (e: WsMessageEvent) => void;
50
+ onWsMessageArrayBuffer?: (e: ArrayBuffer) => void;
51
+ onWsMessageJSON?: (e: WsMsg) => void;
52
+ };
53
+ export type ConnectOptions = {
54
+ /** 'auto' (default): reuse cache when fresh · 'refresh': always fetch · 'cache': never fetch */
55
+ schema?: 'auto' | 'refresh' | 'cache';
56
+ /** max cache age for 'auto' (default 24h) */
57
+ maxAgeMs?: number;
58
+ /**
59
+ * deadline for the FIRST connect, default 30s. 0 or Infinity waits forever.
60
+ * A refused TCP connection is a ws CLOSE, not a dead transport, so without a
61
+ * deadline `connect()` sat in the 2s reconnect loop and never settled: scripts
62
+ * hung with no error and `comfy-ts serve` wedged the module behind its mutex.
63
+ * Reconnects AFTER a successful connect are untouched and still retry forever.
64
+ */
65
+ timeoutMs?: number;
66
+ };
67
+ /** the host answered a run check route, but not as ComfyUI does (no such route, another shape) */
68
+ export declare class HostRouteUnusableError extends Error {
69
+ /** name, not instanceof: the cli bundle and dist/index.js each define this class */
70
+ readonly name = "HostRouteUnusableError";
71
+ }
72
+ /** the host never came up within ConnectOptions.timeoutMs */
73
+ export declare class ComfyHostUnreachableError extends Error {
74
+ /** name, not instanceof: the cli bundle and dist/index.js each define this class */
75
+ readonly name = "ComfyHostUnreachableError";
76
+ }
77
+ type SchemaUpdateResult = Maybe<{
78
+ type: 'success';
79
+ } | {
80
+ type: 'error';
81
+ error: unknown;
82
+ }>;
83
+ type ServerLog = {
84
+ at: string;
85
+ content: string;
86
+ id: number;
87
+ };
88
+ /** auth failure with a SPECIFIC meaning (per the Comfy Cloud error table):
89
+ * 401 invalid/missing key · 402 insufficient credits · 429 subscription inactive
90
+ * (or plain rate limiting on non-cloud hosts). The key value never appears here. */
91
+ export declare class ComfyHostAuthError extends Error {
92
+ code: 401 | 402 | 429;
93
+ hostId: string;
94
+ constructor(code: 401 | 402 | 429, hostId: string, message: string);
95
+ }
96
+ type LatentPreview = {
97
+ promptID: Maybe<PromptID>;
98
+ receivedAt: number_Timestamp;
99
+ blob: Blob;
100
+ url: string;
101
+ };
102
+ export declare class ComfyHost<ID extends string = string> {
103
+ data: ComfyHostData & {
104
+ id: ID;
105
+ };
106
+ cacheFolder: AbsolutePath;
107
+ comfyJSONPath: AbsolutePath;
108
+ embeddingsPath: AbsolutePath;
109
+ sdkDTSPath: AbsolutePath;
110
+ /** the schema instance with all methods to interract with the host schema */
111
+ schema: ComfySchema;
112
+ uploader: ComfyUploader;
113
+ /** parsed ONCE from data (url-first, legacy host/port/https, or the address `gen` saved for
114
+ * the id alone): the url ground truth. Throws the noAddress text when there is none */
115
+ get base(): ParsedHostBase;
116
+ private _base;
117
+ /** why the id alone found no saved address; null when the host has one. An import stays safe
118
+ * (like a missing schema cache): the error is logged once, then thrown at first use */
119
+ noAddress: string | null;
120
+ /** `host:port` for labels, or a short note when there is no address; never throws */
121
+ get addressLabel(): string;
122
+ /** read again at each use until found: a `comfy-ts gen` run after the import (a TUI or a
123
+ * serve that stays up) makes the host usable without a restart */
124
+ private readSavedAddress;
125
+ constructor(data: ComfyHostData & {
126
+ id: ID;
127
+ });
128
+ /** false only when a requirement is known missing; an undecided one passes with a warning (manager.matchRequirements) */
129
+ matchRequirements: (requirements: Requirements[]) => boolean;
130
+ /** `missing` (known not installed, the only ones to queue for install) and `undecided` (the lists cannot say) */
131
+ checkRequirements: (requirements: Requirements[]) => {
132
+ missing: Requirements[];
133
+ undecided: Requirements[];
134
+ };
135
+ /** server sent by the comfy-manager plugin */
136
+ readonly serverLogs: ServerLog[];
137
+ /** if true, request ComfyUI to forward logs */
138
+ private wantLog;
139
+ /** maximum amount of logs to keep in memory */
140
+ readonly maxLogs: number;
141
+ /** last log id received */
142
+ private logId;
143
+ /** toggle server log forwarding so comfy-ts can */
144
+ toggleServerLogs: () => Promise<unknown>;
145
+ addLog: (content: string) => void;
146
+ /** root install of ComfyUI on the host filesystem */
147
+ get absolutePathToComfyUI(): Maybe<string>;
148
+ get manager(): ComfyManager;
149
+ installCustomNodeByFile: (customNodeFile: KnownComfyPluginURL) => Promise<boolean>;
150
+ installCustomNodeByTitle: (customNodeTitle: KnownComfyPluginTitle) => Promise<boolean>;
151
+ installCustomNode: (customNode: ComfyManagerPluginInfo) => Promise<boolean>;
152
+ getServerHostHTTP(): string;
153
+ getWSUrl: () => string;
154
+ /** extra headers + X-API-Key, for every http request AND the ws upgrade */
155
+ private authHeaders;
156
+ /** remembered /api-prefix verdict for this host; null until first probed */
157
+ private _apiPrefix;
158
+ /**
159
+ * the ONE http path to this host: joins basePath, injects X-API-Key + extra
160
+ * headers, prefers `/api<route>` (required by Comfy Cloud, canonical since
161
+ * custom nodes hijack bare routes) with a bare-route fallback on 404/405 for
162
+ * old local servers (winner memoized; the other spelling is still retried
163
+ * when the memo misses — mixed servers exist, e.g. /internal is bare-only).
164
+ * Auth failures throw a typed ComfyHostAuthError instead of generic noise.
165
+ * `p.apiPrefix: false` opts a route out of the prefix game entirely.
166
+ */
167
+ fetch: (route: string, init?: RequestInit, p?: {
168
+ apiPrefix?: boolean;
169
+ }) => Promise<Response>;
170
+ /**
171
+ * binary download path: Comfy Cloud answers `/api/view` with a 302 to a
172
+ * temporary signed URL. fetch only auto-strips Authorization/cookies on
173
+ * cross-origin redirects — a custom X-API-Key WOULD be forwarded to the
174
+ * storage host — so we follow the Location manually with a CLEAN fetch.
175
+ */
176
+ fetchFile: (route: string) => Promise<Response>;
177
+ private throwOnAuthError;
178
+ schemaRetrievalLogs: string[];
179
+ resetLog: () => void;
180
+ get isConnected(): boolean;
181
+ workflow: (p?: {
182
+ id?: string;
183
+ }) => ComfyWorkflow<ID>;
184
+ /**
185
+ * define a re-runnable workflow: `build` re-executes with the current var
186
+ * values on every run(). The standard contract for tweak & re-run drivers
187
+ * (scripts, the TUI).
188
+ */
189
+ defineWorkflow: <V extends VarsSpec>(spec: DefineWorkflowSpec<ID, V>) => DefinedWorkflow<ID, V>;
190
+ /**
191
+ * import a workflow.json (litegraph format) as a live, editable workflow.
192
+ * Accepts unknown: the JSON is ark-validated + normalized (parseWorkflowJson)
193
+ * before conversion — invalid documents throw WorkflowNormalizeError.
194
+ */
195
+ importWorkflowJson: (json: unknown, p?: {
196
+ id?: string;
197
+ }) => ComfyWorkflow<ID>;
198
+ /** import an api.json (ComfyUI prompt format) as a live, editable workflow */
199
+ importApiJson: (json: ComfyApiJson, p?: {
200
+ id?: string;
201
+ }) => ComfyWorkflow<ID>;
202
+ private _ready;
203
+ private _readyResolve;
204
+ private _readyReject;
205
+ private _schemaStrategy;
206
+ private _schemaMaxAgeMs;
207
+ /**
208
+ * open the websocket; resolves once connected AND the schema is loaded.
209
+ * Schema strategy:
210
+ * - 'auto' (default): reuse .comfy-ts/ cache when younger than maxAgeMs — fast starts
211
+ * - 'refresh': always fetch object_info + regen the sdk
212
+ * - 'cache': never fetch (throws when no cache exists)
213
+ */
214
+ connect: (p?: ConnectOptions) => Promise<void>;
215
+ private _connectTimer;
216
+ private clearConnectTimer;
217
+ /** close the websocket (e.g. to let a script exit) */
218
+ disconnect: () => void;
219
+ private markReady;
220
+ private markFailed;
221
+ private writeSDKToDisk;
222
+ private shouldUseSchemaCache;
223
+ /**
224
+ * will be created only after we've loaded cnfig file
225
+ * so we don't attempt to connect to some default server
226
+ * */
227
+ ws: Maybe<ResilientWebSocketClient>;
228
+ /** resolves once the server assigned us a session id (first ws 'status' message) */
229
+ private _sessionResolve;
230
+ private waitForSession;
231
+ private initWebsocket;
232
+ _isUpdatingSchema: boolean;
233
+ get isUpdatingSchema(): boolean;
234
+ set isUpdatingSchema(v: boolean);
235
+ schemaUpdateResult: SchemaUpdateResult;
236
+ private _schemaFromCache;
237
+ /** load the schema from .comfy-ts/hosts/<id>/ without connecting (offline workflows, fast starts).
238
+ * idempotent like connect(): N co-imported modules parse the ~4MB cache once.
239
+ * A MISSING cache degrades LOUDLY to the base types instead of failing the
240
+ * module import (a fresh consumer project has no cache yet — the bundled
241
+ * examples must still open in the TUI; run() fetches the real schema through
242
+ * connect() anyway). Not memoized in that case, so a later gen/connect retries. */
243
+ loadSchemaFromCache(): Promise<void>;
244
+ /** POST a JSON route through host.fetch (/api preferred, bare fallback) */
245
+ private postJSON_;
246
+ /** GET a json route for the run checks: an answer that is not json (a 404, a 405, a page) means the
247
+ * host has no such route, a HostRouteUnusableError; a network failure stays a plain error */
248
+ private fetchReconcileJSON_;
249
+ /** one prompt's `GET /history/<id>` reply, `{}` while the host has no entry for it */
250
+ fetchHistory: (promptId: PromptID) => Promise<unknown>;
251
+ /** the ids of the prompts waiting or running on this host, every client counted (`GET /queue`) */
252
+ fetchQueuedPromptIds: () => Promise<Set<string>>;
253
+ /** why runs on this host are never checked over http: its /queue or /history is not ComfyUI's
254
+ * (a cloud host). Null while both answered as ComfyUI does, or were never asked */
255
+ reconcileOff: string | null;
256
+ /** @internal a failed run check: true when it proved the host has no usable route (the checks then
257
+ * stop for good, said once), false for a passing failure the caller reports */
258
+ noteReconcileFailure(e: unknown): boolean;
259
+ /** fetchQueuedPromptIds, null when the queue did not answer (logged once per message) or has another
260
+ * shape: a run is then never declared lost */
261
+ fetchQueuedPromptIdsOrNull: () => Promise<Set<string> | null>;
262
+ private _loggedQueueProblems;
263
+ /** a check needs the WHOLE socket quiet this long, and the run itself too */
264
+ runSilenceMs: number;
265
+ /** the wait doubles after each check that ends no run, up to this; any ws message resets it */
266
+ runSilenceMaxMs: number;
267
+ private _silenceWaitMs;
268
+ private _lastCheckAt;
269
+ private _checking;
270
+ private _watchdog;
271
+ /** @internal a new run routes its ws messages here, and the watchdog watches it */
272
+ trackExecution(execution: ComfyExecution): void;
273
+ private stopWatchdog;
274
+ /** a socket that hears no broadcast and no event for a while is deaf, or the host runs one long
275
+ * quiet node: ask. A run queued behind a talking host is never asked about */
276
+ private watchdogTick;
277
+ /** @internal one queue read for all the runs, then the history of each run not in it. A run that
278
+ * ends from its history while the socket looked fine means the socket hears nothing: ComfyUI removes
279
+ * a session BY KEY when a socket's handler ends, so an old handler that ends after a reconnect evicts
280
+ * the new socket of the same session. A clean close lets the server end that handler first */
281
+ reconcileRuns(runs: ComfyExecution[], why: 'reconnect' | 'silence'): Promise<void>;
282
+ /** drop every PENDING prompt from the server queue (the running one keeps going) */
283
+ clearQueue: () => Promise<void>;
284
+ /** a repeat interrupt for the same running prompt inside this window reuses the first request */
285
+ interruptCoalesceMs: number;
286
+ private _lastInterrupt;
287
+ /** interrupt the CURRENTLY RUNNING prompt. A burst of /interrupt posts can make the ComfyUI
288
+ * python process quit, so repeats for the same prompt are coalesced into one request */
289
+ interrupt: () => Promise<void>;
290
+ /** delete ONE prompt's server history entry */
291
+ deleteHistory: (promptId: string) => Promise<void>;
292
+ /** wipe the server's WHOLE prompt history (every user of that server) */
293
+ clearHistory: () => Promise<void>;
294
+ /** the `--preview-method` this host was launched with, read from `GET /system_stats`.
295
+ * `'none'` (ComfyUI's default) means no live preview frame will ever arrive; null = the host
296
+ * does not publish its launch flags (a cloud host), so only a run can tell */
297
+ fetchPreviewMethod: () => Promise<PreviewMethod | null>;
298
+ /** jobs waiting or running on this host, every client counted (`GET /prompt`) */
299
+ fetchQueueSize: (p?: {
300
+ timeoutMs?: number;
301
+ }) => Promise<number>;
302
+ /** runs started through DefinedWorkflow.run() and not finished yet: counted from the call,
303
+ * before the prompt reaches the server queue, so runs started together spread out */
304
+ runsInFlight: number;
305
+ /** the server's recent console buffer (entries are write CHUNKS, not lines) */
306
+ fetchRawLogs: () => Promise<{
307
+ entries: LogEntry[];
308
+ }>;
309
+ /** (un)subscribe THIS session to ws 'logs' messages — per-sid server state,
310
+ * must be re-sent after every reconnect (see onSession) */
311
+ subscribeLogs: (p: {
312
+ enabled: boolean;
313
+ clientId: string;
314
+ }) => Promise<void>;
315
+ /** what changed on the host since this schema was loaded (src/host/schemaDrift.ts). `full: false`
316
+ * asks only the loaders the schema has, a few KB, so it can run on a timer. Throws when the host
317
+ * cannot be reached, which is itself the signal a caller watches for a restart */
318
+ checkSchemaDrift: (p: {
319
+ full: boolean;
320
+ }) => Promise<SchemaDrift>;
321
+ /** GET a JSON route through host.fetch (/api preferred, bare fallback) */
322
+ private fetchJSON_;
323
+ /** retrieve the comfy spec from the schema*/
324
+ fetchAndUpdateSchema: () => Promise<void>;
325
+ /** executions we started */
326
+ executions: Map<PromptID, ComfyExecution>;
327
+ /** buffer in case we receive packets out of order */
328
+ _pendingMsgs: Map<PromptID, PendingWsItem[]>;
329
+ /** the active prompt currently running on this host */
330
+ private activePromptID;
331
+ /** method to either execute or buffer the incoming message */
332
+ routeOrBuffer(prompt_id: PromptID, msg: PromptRelated_WsMsg): void;
333
+ /** the last raw preview frame; `latentPreview` decodes it only when read */
334
+ private _latentFrame;
335
+ private _latentPreview;
336
+ /** the latent image beeing generated, in case you want to display it. Built on read: a
337
+ * session that never reads it never decodes a frame nor holds an object url */
338
+ get latentPreview(): Maybe<LatentPreview>;
339
+ /** byte-level latent-preview hook (e.g. TUI live preview panel) */
340
+ onLatentPreview: Maybe<(p: {
341
+ bytes: Uint8Array;
342
+ mime: string;
343
+ promptID: Maybe<PromptID>;
344
+ }) => void>;
345
+ /** a node's live display text, as it produces it (`PromptServer.send_progress_text`) */
346
+ onProgressText: Maybe<(p: {
347
+ nodeId: string;
348
+ text: string;
349
+ promptID: Maybe<PromptID>;
350
+ }) => void>;
351
+ /** fires on every ws 'status' message (queue length lives there) */
352
+ onStatus: Maybe<(p: {
353
+ queueRemaining: number;
354
+ }) => void>;
355
+ /** fires when the server assigns a NEW session id (first connect AND every
356
+ * reconnect — per-sid server state like log subscriptions must be redone) */
357
+ onSession: Maybe<(sid: string) => void>;
358
+ /** fires on ws 'logs' messages (server console stream, see subscribeLogs) */
359
+ onLogs: Maybe<(p: {
360
+ entries: LogEntry[];
361
+ }) => void>;
362
+ /** the session assigned to us by the server */
363
+ comfySessionId: string; /** send by ComfyUI server */
364
+ /** event types we already complained about on this connection (one log per type, no
365
+ * spam); both sets clear when the server assigns a new session id */
366
+ private _unknownBinaryFrameTypes;
367
+ private _unknownWsEventTypes;
368
+ /** the socket opened and its first 'status' has not come yet */
369
+ private _socketIsNew;
370
+ /** handy to keep around */
371
+ status: ComfyStatusData['status'] | null;
372
+ /** last time ANY ws message arrived — proof-of-life for the TUI probe: a
373
+ * busy single-threaded ComfyUI stalls NEW connects while established
374
+ * sockets keep streaming (a half-open socket receives nothing, so this
375
+ * never revives one) */
376
+ lastWsMessageAt: number | null;
377
+ /** a type 1 or 4 frame. Parsed only when someone wants it, in this order (architecture.md,
378
+ * Live previews): the ws saver's output, the pre-registration buffer, the run's onPreview,
379
+ * the host hook. Nobody listening = the frame is kept by reference and never copied */
380
+ private onPreviewFrame;
381
+ onMessage(e: WsMessageEvent): void;
382
+ }
383
+ export {};