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,104 @@
1
+ import type { ComfyHost } from '../host/ComfyHost.cjs';
2
+ import type { ComfyExecution } from '../runner/ComfyExecution.cjs';
3
+ import type { ComfyWorkflow, RunSettings } from '../runner/ComfyWorkflow.cjs';
4
+ import type { SdkForHost } from '../types/comfy-sdk.cjs';
5
+ import type { LorasInput } from './lanes.cjs';
6
+ import type { OutputWidget } from './outputWidgets.cjs';
7
+ import { type AnyVar, type ChoiceVar, type LorasVar, type ModelVarOpts, type OptionalChoiceVar, v, type VarsSpec, type VarValues } from './ComfyVars.cjs';
8
+ /** the host's generated lora-name union (plain string when no sdk is generated) */
9
+ export type LoraNameOf<ID extends string> = 'E_LoraName' extends keyof SdkForHost<ID>['Union'] ? SdkForHost<ID>['Union']['E_LoraName'] & string : string;
10
+ /**
11
+ * the `v` handed to a vars LAMBDA: the global factory, host-typed —
12
+ * `v.loras(regex)` yields the host's lora-name union (resolved via bindHost)
13
+ */
14
+ export type BoundVars<ID extends string> = Omit<typeof v, 'loras' | 'model'> & {
15
+ loras(options: RegExp, initial?: LorasInput<LoraNameOf<ID>>, label?: string): LorasVar<LoraNameOf<ID>>;
16
+ loras<T extends string>(options: readonly T[], initial?: LorasInput<T>, label?: string): LorasVar<T>;
17
+ /** the host's file list for one loader input: the slot autocompletes, the value is its union */
18
+ model: ModelFactory<SdkForHost<ID>['Slots']>;
19
+ };
20
+ /** `v.model` typed by a host's slot table S (`Slots`): its own interface, so the host id's
21
+ * variance stays measurable (inlined into BoundVars, ComfyHost<ID> stopped being a ComfyHost<string>) */
22
+ export interface ModelFactory<S> {
23
+ <K extends keyof S & string>(slot: K, opts: ModelVarOpts<S[K] & string> & {
24
+ default: S[K] & string;
25
+ }): ChoiceVar<S[K] & string>;
26
+ <K extends keyof S & string>(slot: K, opts: ModelVarOpts<S[K] & string> & {
27
+ default: null;
28
+ }): OptionalChoiceVar<S[K] & string>;
29
+ }
30
+ /** every `Node.input` slot of the host's generated sdk (any string without one) */
31
+ export type SlotNameOf<ID extends string> = keyof SdkForHost<ID>['Slots'] & string;
32
+ /** the value union of one slot, strings only (a loader file list) */
33
+ export type SlotValueOf<ID extends string, K extends string> = K extends keyof SdkForHost<ID>['Slots'] ? SdkForHost<ID>['Slots'][K] & string : string;
34
+ export type DefineWorkflowSpec<ID extends string, V extends VarsSpec> = {
35
+ /** short id; also names the workflow instances */
36
+ id?: string;
37
+ /** optional TUI tree color (ink color name or hex); unset = the tree's
38
+ * per-family palette (first `-` word of the module basename) */
39
+ color?: string;
40
+ /** the tweakable knobs; drivers (scripts, TUI) edit these between runs.
41
+ * A LAMBDA gives cross-referencing vars a scope (loras + prompt with
42
+ * loraKeywordsFrom created inline) — resolved ONCE at define time, and it
43
+ * RECEIVES the host-typed `v` (no import needed) */
44
+ vars: V | ((v: BoundVars<ID>) => V);
45
+ /** builds the graph from the CURRENT var values; re-executed on every run().
46
+ * may be async (e.g. image uploads through the wf param) */
47
+ build: (b: SdkForHost<ID>['Builder'], vars: VarValues<V>, wf: ComfyWorkflow<ID>) => void | Promise<void>;
48
+ /** named texts computed from the CURRENT var values, the same `vars` build receives, shown
49
+ * live while the vars are edited (the serve panel: a foldable block under generate). Use the
50
+ * function build uses, so a preview is what the run sends, never a paraphrase of it */
51
+ previews?: Record<string, (vars: VarValues<V>) => string>;
52
+ /** free search tags for the serve omnibox, added to the ones read from the graph
53
+ * (`image`, `audio`, `video`, `text`, `llm`, `edit`) */
54
+ tags?: string[];
55
+ /** built-in web panel widgets drawn over a run's outputs (`widget.relight(...)`), each role
56
+ * naming the `tag` of a save node. The CLI and the TUI ignore them */
57
+ widgets?: OutputWidget[];
58
+ };
59
+ /**
60
+ * a re-runnable workflow definition: `build` re-executes per run with the
61
+ * current var values, so every run gets a fresh, deterministic graph.
62
+ */
63
+ export declare class DefinedWorkflow<ID extends string = string, V extends VarsSpec = VarsSpec> {
64
+ host: ComfyHost<ID>;
65
+ spec: DefineWorkflowSpec<ID, V>;
66
+ /** spec.vars resolved once (may be given as a thunk) — the SAME instances for the workflow's lifetime */
67
+ readonly vars: V;
68
+ constructor(host: ComfyHost<ID>, spec: DefineWorkflowSpec<ID, V>);
69
+ /** every preview for the current var values. A preview that throws, or vars that cannot be
70
+ * read yet (an image var still empty), give a line saying so instead of failing the others */
71
+ computePreviews(): Record<string, string>;
72
+ /** [name, var] pairs, for drivers that enumerate the knobs */
73
+ entries(): [string, AnyVar][];
74
+ /** the workflow built by the latest run() (null before the first run) */
75
+ lastWorkflow: ComfyWorkflow<ID> | null;
76
+ /** the latest execution (null before the first run) */
77
+ lastExecution: ComfyExecution | null;
78
+ /**
79
+ * build a fresh graph from the CURRENT var values (no send). `p.advance`
80
+ * (set by run()) fires each var's afterRun() right after snapshotting the
81
+ * values — atomically, before any await — so the graph uses this run's seed
82
+ * while the var moves to the next (queued runs get distinct seeds; a bare
83
+ * build() for copy/export never advances). `p.host` substitutes the host
84
+ * the graph is built against (TUI host override): node/model availability
85
+ * there surfaces as workflow.problems / server validation, by design.
86
+ * `p.dry` builds a graph only to read it: nothing is uploaded, lastWorkflow is left alone.
87
+ * `p.values` builds from a snapshot taken earlier (run() takes it at the call).
88
+ */
89
+ build(p?: {
90
+ advance?: boolean;
91
+ host?: ComfyHost;
92
+ dry?: boolean;
93
+ values?: VarValues<V>;
94
+ }): Promise<ComfyWorkflow<ID>>;
95
+ /** the current var values; `advance` then moves each var to its next run (the seed) */
96
+ private snapshot;
97
+ /** build a fresh graph from the var values AT THE CALL, send it, wait for outputs:
98
+ * set a var, call run(), set it again, and each run keeps its own values.
99
+ * connects first (idempotent) — modules can import offline from the schema cache.
100
+ * `settings.host` runs against THAT host instead of the defining one. */
101
+ run(settings?: RunSettings & {
102
+ host?: ComfyHost;
103
+ }): Promise<ComfyExecution>;
104
+ }
@@ -0,0 +1,104 @@
1
+ import type { ComfyHost } from '../host/ComfyHost.js';
2
+ import type { ComfyExecution } from '../runner/ComfyExecution.js';
3
+ import type { ComfyWorkflow, RunSettings } from '../runner/ComfyWorkflow.js';
4
+ import type { SdkForHost } from '../types/comfy-sdk.js';
5
+ import type { LorasInput } from './lanes.js';
6
+ import type { OutputWidget } from './outputWidgets.js';
7
+ import { type AnyVar, type ChoiceVar, type LorasVar, type ModelVarOpts, type OptionalChoiceVar, v, type VarsSpec, type VarValues } from './ComfyVars.js';
8
+ /** the host's generated lora-name union (plain string when no sdk is generated) */
9
+ export type LoraNameOf<ID extends string> = 'E_LoraName' extends keyof SdkForHost<ID>['Union'] ? SdkForHost<ID>['Union']['E_LoraName'] & string : string;
10
+ /**
11
+ * the `v` handed to a vars LAMBDA: the global factory, host-typed —
12
+ * `v.loras(regex)` yields the host's lora-name union (resolved via bindHost)
13
+ */
14
+ export type BoundVars<ID extends string> = Omit<typeof v, 'loras' | 'model'> & {
15
+ loras(options: RegExp, initial?: LorasInput<LoraNameOf<ID>>, label?: string): LorasVar<LoraNameOf<ID>>;
16
+ loras<T extends string>(options: readonly T[], initial?: LorasInput<T>, label?: string): LorasVar<T>;
17
+ /** the host's file list for one loader input: the slot autocompletes, the value is its union */
18
+ model: ModelFactory<SdkForHost<ID>['Slots']>;
19
+ };
20
+ /** `v.model` typed by a host's slot table S (`Slots`): its own interface, so the host id's
21
+ * variance stays measurable (inlined into BoundVars, ComfyHost<ID> stopped being a ComfyHost<string>) */
22
+ export interface ModelFactory<S> {
23
+ <K extends keyof S & string>(slot: K, opts: ModelVarOpts<S[K] & string> & {
24
+ default: S[K] & string;
25
+ }): ChoiceVar<S[K] & string>;
26
+ <K extends keyof S & string>(slot: K, opts: ModelVarOpts<S[K] & string> & {
27
+ default: null;
28
+ }): OptionalChoiceVar<S[K] & string>;
29
+ }
30
+ /** every `Node.input` slot of the host's generated sdk (any string without one) */
31
+ export type SlotNameOf<ID extends string> = keyof SdkForHost<ID>['Slots'] & string;
32
+ /** the value union of one slot, strings only (a loader file list) */
33
+ export type SlotValueOf<ID extends string, K extends string> = K extends keyof SdkForHost<ID>['Slots'] ? SdkForHost<ID>['Slots'][K] & string : string;
34
+ export type DefineWorkflowSpec<ID extends string, V extends VarsSpec> = {
35
+ /** short id; also names the workflow instances */
36
+ id?: string;
37
+ /** optional TUI tree color (ink color name or hex); unset = the tree's
38
+ * per-family palette (first `-` word of the module basename) */
39
+ color?: string;
40
+ /** the tweakable knobs; drivers (scripts, TUI) edit these between runs.
41
+ * A LAMBDA gives cross-referencing vars a scope (loras + prompt with
42
+ * loraKeywordsFrom created inline) — resolved ONCE at define time, and it
43
+ * RECEIVES the host-typed `v` (no import needed) */
44
+ vars: V | ((v: BoundVars<ID>) => V);
45
+ /** builds the graph from the CURRENT var values; re-executed on every run().
46
+ * may be async (e.g. image uploads through the wf param) */
47
+ build: (b: SdkForHost<ID>['Builder'], vars: VarValues<V>, wf: ComfyWorkflow<ID>) => void | Promise<void>;
48
+ /** named texts computed from the CURRENT var values, the same `vars` build receives, shown
49
+ * live while the vars are edited (the serve panel: a foldable block under generate). Use the
50
+ * function build uses, so a preview is what the run sends, never a paraphrase of it */
51
+ previews?: Record<string, (vars: VarValues<V>) => string>;
52
+ /** free search tags for the serve omnibox, added to the ones read from the graph
53
+ * (`image`, `audio`, `video`, `text`, `llm`, `edit`) */
54
+ tags?: string[];
55
+ /** built-in web panel widgets drawn over a run's outputs (`widget.relight(...)`), each role
56
+ * naming the `tag` of a save node. The CLI and the TUI ignore them */
57
+ widgets?: OutputWidget[];
58
+ };
59
+ /**
60
+ * a re-runnable workflow definition: `build` re-executes per run with the
61
+ * current var values, so every run gets a fresh, deterministic graph.
62
+ */
63
+ export declare class DefinedWorkflow<ID extends string = string, V extends VarsSpec = VarsSpec> {
64
+ host: ComfyHost<ID>;
65
+ spec: DefineWorkflowSpec<ID, V>;
66
+ /** spec.vars resolved once (may be given as a thunk) — the SAME instances for the workflow's lifetime */
67
+ readonly vars: V;
68
+ constructor(host: ComfyHost<ID>, spec: DefineWorkflowSpec<ID, V>);
69
+ /** every preview for the current var values. A preview that throws, or vars that cannot be
70
+ * read yet (an image var still empty), give a line saying so instead of failing the others */
71
+ computePreviews(): Record<string, string>;
72
+ /** [name, var] pairs, for drivers that enumerate the knobs */
73
+ entries(): [string, AnyVar][];
74
+ /** the workflow built by the latest run() (null before the first run) */
75
+ lastWorkflow: ComfyWorkflow<ID> | null;
76
+ /** the latest execution (null before the first run) */
77
+ lastExecution: ComfyExecution | null;
78
+ /**
79
+ * build a fresh graph from the CURRENT var values (no send). `p.advance`
80
+ * (set by run()) fires each var's afterRun() right after snapshotting the
81
+ * values — atomically, before any await — so the graph uses this run's seed
82
+ * while the var moves to the next (queued runs get distinct seeds; a bare
83
+ * build() for copy/export never advances). `p.host` substitutes the host
84
+ * the graph is built against (TUI host override): node/model availability
85
+ * there surfaces as workflow.problems / server validation, by design.
86
+ * `p.dry` builds a graph only to read it: nothing is uploaded, lastWorkflow is left alone.
87
+ * `p.values` builds from a snapshot taken earlier (run() takes it at the call).
88
+ */
89
+ build(p?: {
90
+ advance?: boolean;
91
+ host?: ComfyHost;
92
+ dry?: boolean;
93
+ values?: VarValues<V>;
94
+ }): Promise<ComfyWorkflow<ID>>;
95
+ /** the current var values; `advance` then moves each var to its next run (the seed) */
96
+ private snapshot;
97
+ /** build a fresh graph from the var values AT THE CALL, send it, wait for outputs:
98
+ * set a var, call run(), set it again, and each run keeps its own values.
99
+ * connects first (idempotent) — modules can import offline from the schema cache.
100
+ * `settings.host` runs against THAT host instead of the defining one. */
101
+ run(settings?: RunSettings & {
102
+ host?: ComfyHost;
103
+ }): Promise<ComfyExecution>;
104
+ }
@@ -0,0 +1,81 @@
1
+ import { type LoraStrength } from './loraEntry.cjs';
2
+ export type PromptLane = {
3
+ name: string;
4
+ prompt: string;
5
+ active: boolean;
6
+ };
7
+ export type PromptLanes = {
8
+ lanes: PromptLane[];
9
+ };
10
+ export type PromptInput = string | PromptLanes;
11
+ export type LoraRecord<T extends string = string> = Partial<Record<T, LoraStrength>>;
12
+ export type LoraLane<T extends string = string> = {
13
+ name: string;
14
+ active: boolean;
15
+ loras: LoraRecord<T>;
16
+ };
17
+ export type LoraLanes<T extends string = string> = {
18
+ lanes: LoraLane<T>[];
19
+ };
20
+ /** a lora file is never named `lanes` (options end in .safetensors), so the plain record and the
21
+ * lanes object can never be mistaken for each other */
22
+ export type LorasInput<T extends string = string> = LoraRecord<T> | LoraLanes<T>;
23
+ export declare const FIRST_LANE = "main";
24
+ export declare function isPromptLane(v: unknown): v is PromptLane;
25
+ export declare function isPromptLanes(v: unknown): v is PromptLanes;
26
+ export declare function isPromptInput(v: unknown): v is PromptInput;
27
+ /** the text the build reads: the active lanes joined in order, one line break between them, so
28
+ * `//` and `- ` lines keep working inside every lane */
29
+ export declare function promptText(v: PromptInput): string;
30
+ export declare function toPromptLanes(v: PromptInput): PromptLanes;
31
+ /** back to one string: only when it loses nothing (a single active lane) */
32
+ export declare function promptFromLanes(v: PromptLanes): string | null;
33
+ export declare function promptLanesToText(v: PromptLanes): string;
34
+ /** text before the first header lands in a lane named FIRST_LANE, so no typed line is lost */
35
+ export declare function promptLanesFromText(text: string): PromptLanes;
36
+ export declare function isLoraLane(v: unknown): v is LoraLane;
37
+ export declare function isLoraLanes<T extends string>(v: LorasInput<T>): v is LoraLanes<T>;
38
+ export declare function isLoraLanes(v: unknown): v is LoraLanes;
39
+ export declare function isLorasInput(v: unknown): v is LorasInput;
40
+ /** one record for the build: the active lanes in order. A lora in two active lanes keeps its
41
+ * FIRST setting, and `duplicates` names it so the caller can say so */
42
+ export declare function flattenLoras<T extends string>(v: LorasInput<T>): {
43
+ record: LoraRecord<T>;
44
+ duplicates: T[];
45
+ };
46
+ export declare function toLoraLanes<T extends string>(v: LorasInput<T>): LoraLanes<T>;
47
+ export declare function lorasFromLanes<T extends string>(v: LoraLanes<T>): LoraRecord<T> | null;
48
+ /** where a lora lives, so an edit lands in the lane that holds it: the first ACTIVE lane that
49
+ * has it (the one the build reads), else any lane, else -1 */
50
+ export declare function laneIndexOf<T extends string>(v: LoraLanes<T>, name: T): number;
51
+ /** rewrite one lora's setting wherever it lives (plain record, or its lane). `null` removes it.
52
+ * A lora in no lane yet lands in the first lane */
53
+ export declare function updateLora<T extends string>(v: LorasInput<T>, name: T, next: LoraStrength | null): LorasInput<T>;
54
+ type NamedLane = {
55
+ name: string;
56
+ active: boolean;
57
+ };
58
+ /** a name no other lane has: `lane 2`, `lane 3`… */
59
+ export declare function newLaneName(lanes: readonly NamedLane[]): string;
60
+ export declare function patchLane<L extends NamedLane>(lanes: readonly L[], ix: number, patch: Partial<L>): L[];
61
+ /** move a lane up (-1) or down (+1); out of range changes nothing */
62
+ export declare function moveLane<L>(lanes: readonly L[], ix: number, delta: number): L[];
63
+ export declare function removeLane<L>(lanes: readonly L[], ix: number): L[];
64
+ /** move one lora to another lane (or another slot of its own), before `beforeName` or last */
65
+ export declare function moveLoraToLane<T extends string>(v: LoraLanes<T>, p: {
66
+ from: number;
67
+ name: T;
68
+ to: number;
69
+ beforeName?: T;
70
+ }): LoraLanes<T>;
71
+ /** one lora's stored setting wherever it lives, inactive lanes included (the lane an edit
72
+ * would write to, `updateLora`), or undefined */
73
+ export declare function loraSetting<T extends string>(v: LorasInput<T>, name: T): LoraStrength | undefined;
74
+ /** every lora in the palette of either shape, each once, with whether the build runs it: a lora
75
+ * in an inactive lane, or paused, is there but not running */
76
+ export declare function paletteLoras<T extends string>(v: LorasInput<T>): {
77
+ name: T;
78
+ setting: LoraStrength;
79
+ running: boolean;
80
+ }[];
81
+ export {};
@@ -0,0 +1,81 @@
1
+ import { type LoraStrength } from './loraEntry.js';
2
+ export type PromptLane = {
3
+ name: string;
4
+ prompt: string;
5
+ active: boolean;
6
+ };
7
+ export type PromptLanes = {
8
+ lanes: PromptLane[];
9
+ };
10
+ export type PromptInput = string | PromptLanes;
11
+ export type LoraRecord<T extends string = string> = Partial<Record<T, LoraStrength>>;
12
+ export type LoraLane<T extends string = string> = {
13
+ name: string;
14
+ active: boolean;
15
+ loras: LoraRecord<T>;
16
+ };
17
+ export type LoraLanes<T extends string = string> = {
18
+ lanes: LoraLane<T>[];
19
+ };
20
+ /** a lora file is never named `lanes` (options end in .safetensors), so the plain record and the
21
+ * lanes object can never be mistaken for each other */
22
+ export type LorasInput<T extends string = string> = LoraRecord<T> | LoraLanes<T>;
23
+ export declare const FIRST_LANE = "main";
24
+ export declare function isPromptLane(v: unknown): v is PromptLane;
25
+ export declare function isPromptLanes(v: unknown): v is PromptLanes;
26
+ export declare function isPromptInput(v: unknown): v is PromptInput;
27
+ /** the text the build reads: the active lanes joined in order, one line break between them, so
28
+ * `//` and `- ` lines keep working inside every lane */
29
+ export declare function promptText(v: PromptInput): string;
30
+ export declare function toPromptLanes(v: PromptInput): PromptLanes;
31
+ /** back to one string: only when it loses nothing (a single active lane) */
32
+ export declare function promptFromLanes(v: PromptLanes): string | null;
33
+ export declare function promptLanesToText(v: PromptLanes): string;
34
+ /** text before the first header lands in a lane named FIRST_LANE, so no typed line is lost */
35
+ export declare function promptLanesFromText(text: string): PromptLanes;
36
+ export declare function isLoraLane(v: unknown): v is LoraLane;
37
+ export declare function isLoraLanes<T extends string>(v: LorasInput<T>): v is LoraLanes<T>;
38
+ export declare function isLoraLanes(v: unknown): v is LoraLanes;
39
+ export declare function isLorasInput(v: unknown): v is LorasInput;
40
+ /** one record for the build: the active lanes in order. A lora in two active lanes keeps its
41
+ * FIRST setting, and `duplicates` names it so the caller can say so */
42
+ export declare function flattenLoras<T extends string>(v: LorasInput<T>): {
43
+ record: LoraRecord<T>;
44
+ duplicates: T[];
45
+ };
46
+ export declare function toLoraLanes<T extends string>(v: LorasInput<T>): LoraLanes<T>;
47
+ export declare function lorasFromLanes<T extends string>(v: LoraLanes<T>): LoraRecord<T> | null;
48
+ /** where a lora lives, so an edit lands in the lane that holds it: the first ACTIVE lane that
49
+ * has it (the one the build reads), else any lane, else -1 */
50
+ export declare function laneIndexOf<T extends string>(v: LoraLanes<T>, name: T): number;
51
+ /** rewrite one lora's setting wherever it lives (plain record, or its lane). `null` removes it.
52
+ * A lora in no lane yet lands in the first lane */
53
+ export declare function updateLora<T extends string>(v: LorasInput<T>, name: T, next: LoraStrength | null): LorasInput<T>;
54
+ type NamedLane = {
55
+ name: string;
56
+ active: boolean;
57
+ };
58
+ /** a name no other lane has: `lane 2`, `lane 3`… */
59
+ export declare function newLaneName(lanes: readonly NamedLane[]): string;
60
+ export declare function patchLane<L extends NamedLane>(lanes: readonly L[], ix: number, patch: Partial<L>): L[];
61
+ /** move a lane up (-1) or down (+1); out of range changes nothing */
62
+ export declare function moveLane<L>(lanes: readonly L[], ix: number, delta: number): L[];
63
+ export declare function removeLane<L>(lanes: readonly L[], ix: number): L[];
64
+ /** move one lora to another lane (or another slot of its own), before `beforeName` or last */
65
+ export declare function moveLoraToLane<T extends string>(v: LoraLanes<T>, p: {
66
+ from: number;
67
+ name: T;
68
+ to: number;
69
+ beforeName?: T;
70
+ }): LoraLanes<T>;
71
+ /** one lora's stored setting wherever it lives, inactive lanes included (the lane an edit
72
+ * would write to, `updateLora`), or undefined */
73
+ export declare function loraSetting<T extends string>(v: LorasInput<T>, name: T): LoraStrength | undefined;
74
+ /** every lora in the palette of either shape, each once, with whether the build runs it: a lora
75
+ * in an inactive lane, or paused, is there but not running */
76
+ export declare function paletteLoras<T extends string>(v: LorasInput<T>): {
77
+ name: T;
78
+ setting: LoraStrength;
79
+ running: boolean;
80
+ }[];
81
+ export {};
@@ -0,0 +1,26 @@
1
+ export type LoraEntry = {
2
+ strength: [strengthModel: number, strengthClip: number];
3
+ off?: boolean;
4
+ mute?: string[];
5
+ };
6
+ export type LoraStrength = boolean | number | [strengthModel: number, strengthClip: number] | LoraEntry;
7
+ export declare function isLoraEntry(s: unknown): s is LoraEntry;
8
+ export declare function isLoraStrength(s: unknown): s is LoraStrength;
9
+ /** on = it runs */
10
+ export declare function loraIsOn(s: unknown): boolean;
11
+ /** in the palette = on, or paused in the palette form */
12
+ export declare function loraInPalette(s: unknown): boolean;
13
+ /** the strengths, whatever the spelling (1/1 when there is nothing to read) */
14
+ export declare function loraStrengths(s: unknown): [number, number];
15
+ export declare function loraMuted(s: unknown): string[];
16
+ /** a prompt keyword's parts, split at commas: each one can be left out on its own */
17
+ export declare function keywordParts(keyword: string): string[];
18
+ /** the keyword a lora adds to the prompt once its muted parts are left out ('' = nothing) */
19
+ export declare function keptKeyword(keyword: string, muted: readonly string[]): string;
20
+ /** rewrite one setting, keeping what the patch does not name. The result stays in the short
21
+ * spellings while nothing needs the palette form, so a plain draft reads as it always did */
22
+ export declare function withLora(s: unknown, patch: {
23
+ on?: boolean;
24
+ strength?: [number, number];
25
+ mute?: readonly string[];
26
+ }): LoraStrength;
@@ -0,0 +1,26 @@
1
+ export type LoraEntry = {
2
+ strength: [strengthModel: number, strengthClip: number];
3
+ off?: boolean;
4
+ mute?: string[];
5
+ };
6
+ export type LoraStrength = boolean | number | [strengthModel: number, strengthClip: number] | LoraEntry;
7
+ export declare function isLoraEntry(s: unknown): s is LoraEntry;
8
+ export declare function isLoraStrength(s: unknown): s is LoraStrength;
9
+ /** on = it runs */
10
+ export declare function loraIsOn(s: unknown): boolean;
11
+ /** in the palette = on, or paused in the palette form */
12
+ export declare function loraInPalette(s: unknown): boolean;
13
+ /** the strengths, whatever the spelling (1/1 when there is nothing to read) */
14
+ export declare function loraStrengths(s: unknown): [number, number];
15
+ export declare function loraMuted(s: unknown): string[];
16
+ /** a prompt keyword's parts, split at commas: each one can be left out on its own */
17
+ export declare function keywordParts(keyword: string): string[];
18
+ /** the keyword a lora adds to the prompt once its muted parts are left out ('' = nothing) */
19
+ export declare function keptKeyword(keyword: string, muted: readonly string[]): string;
20
+ /** rewrite one setting, keeping what the patch does not name. The result stays in the short
21
+ * spellings while nothing needs the palette form, so a plain draft reads as it always did */
22
+ export declare function withLora(s: unknown, patch: {
23
+ on?: boolean;
24
+ strength?: [number, number];
25
+ mute?: readonly string[];
26
+ }): LoraStrength;
@@ -0,0 +1,19 @@
1
+ /** the hand keyword when this lora HAS an entry (`''` included), else the mirror's trigger words */
2
+ export declare function getLoraKeyword(name: string, hostId?: string): string;
3
+ /** true when the keyword shown comes from the lora-manager mirror, not from ⌃K */
4
+ export declare function isLoraKeywordFromMirror(name: string, hostId?: string): boolean;
5
+ /** what `clearLoraKeywordOverride` would restore this lora to, `''` when nothing */
6
+ export declare function loraKeywordFromMirror(name: string, hostId?: string): string;
7
+ /**
8
+ * drop the hand entry entirely, so the mirror's trigger words apply again.
9
+ * The way BACK from an empty-string tombstone: without it, clearing a keyword on
10
+ * a lora that has trigger words was a one-way door only a text editor could undo.
11
+ */
12
+ export declare function clearLoraKeywordOverride(name: string): void;
13
+ /**
14
+ * empty keyword deletes the entry — EXCEPT when the mirror has trigger words for
15
+ * this lora: there `''` is stored as an explicit tombstone, the only way to say
16
+ * "inject nothing" about a lora civitai gave words to. Every set writes the file
17
+ * (tiny, rare).
18
+ */
19
+ export declare function setLoraKeyword(name: string, keyword: string, hostId?: string): void;
@@ -0,0 +1,19 @@
1
+ /** the hand keyword when this lora HAS an entry (`''` included), else the mirror's trigger words */
2
+ export declare function getLoraKeyword(name: string, hostId?: string): string;
3
+ /** true when the keyword shown comes from the lora-manager mirror, not from ⌃K */
4
+ export declare function isLoraKeywordFromMirror(name: string, hostId?: string): boolean;
5
+ /** what `clearLoraKeywordOverride` would restore this lora to, `''` when nothing */
6
+ export declare function loraKeywordFromMirror(name: string, hostId?: string): string;
7
+ /**
8
+ * drop the hand entry entirely, so the mirror's trigger words apply again.
9
+ * The way BACK from an empty-string tombstone: without it, clearing a keyword on
10
+ * a lora that has trigger words was a one-way door only a text editor could undo.
11
+ */
12
+ export declare function clearLoraKeywordOverride(name: string): void;
13
+ /**
14
+ * empty keyword deletes the entry — EXCEPT when the mirror has trigger words for
15
+ * this lora: there `''` is stored as an explicit tombstone, the only way to say
16
+ * "inject nothing" about a lora civitai gave words to. Every set writes the file
17
+ * (tiny, rare).
18
+ */
19
+ export declare function setLoraKeyword(name: string, keyword: string, hostId?: string): void;
@@ -0,0 +1,33 @@
1
+ /** the maps a relight widget reads, each the tag of one output image */
2
+ export type RelightRoles = {
3
+ /** the photo itself; the base colour when no albedo is given */
4
+ image: string;
5
+ /** near = white; places each pixel in 3D and casts the shadows */
6
+ depth?: string;
7
+ /** OpenGL convention (green up) */
8
+ normal?: string;
9
+ albedo?: string;
10
+ /** white = rough */
11
+ roughness?: string;
12
+ /** white = metal */
13
+ metalness?: string;
14
+ /** the non diffuse part of the light (reflections, highlights) */
15
+ specular?: string;
16
+ };
17
+ export type RelightWidget = {
18
+ kind: 'relight';
19
+ title?: string;
20
+ roles: RelightRoles;
21
+ };
22
+ export type OutputWidget = RelightWidget;
23
+ export type OutputWidgetKind = OutputWidget['kind'];
24
+ export declare const widget: {
25
+ /** a point light moved over the image in 3D: left/right, up/down, nearer/farther */
26
+ relight(roles: RelightRoles, opts?: {
27
+ title?: string;
28
+ }): RelightWidget;
29
+ };
30
+ /** the roles of a widget whose tag one of the images carries, as role → index in `images` */
31
+ export declare function resolveWidgetRoles(w: OutputWidget, images: {
32
+ tags?: string[];
33
+ }[]): Map<string, number>;
@@ -0,0 +1,33 @@
1
+ /** the maps a relight widget reads, each the tag of one output image */
2
+ export type RelightRoles = {
3
+ /** the photo itself; the base colour when no albedo is given */
4
+ image: string;
5
+ /** near = white; places each pixel in 3D and casts the shadows */
6
+ depth?: string;
7
+ /** OpenGL convention (green up) */
8
+ normal?: string;
9
+ albedo?: string;
10
+ /** white = rough */
11
+ roughness?: string;
12
+ /** white = metal */
13
+ metalness?: string;
14
+ /** the non diffuse part of the light (reflections, highlights) */
15
+ specular?: string;
16
+ };
17
+ export type RelightWidget = {
18
+ kind: 'relight';
19
+ title?: string;
20
+ roles: RelightRoles;
21
+ };
22
+ export type OutputWidget = RelightWidget;
23
+ export type OutputWidgetKind = OutputWidget['kind'];
24
+ export declare const widget: {
25
+ /** a point light moved over the image in 3D: left/right, up/down, nearer/farther */
26
+ relight(roles: RelightRoles, opts?: {
27
+ title?: string;
28
+ }): RelightWidget;
29
+ };
30
+ /** the roles of a widget whose tag one of the images carries, as role → index in `images` */
31
+ export declare function resolveWidgetRoles(w: OutputWidget, images: {
32
+ tags?: string[];
33
+ }[]): Map<string, number>;
@@ -0,0 +1,9 @@
1
+ export type VarPreset = {
2
+ label: string;
3
+ text: string;
4
+ };
5
+ /** authored shape: `{ 'terse one-liner': 'reply with one sentence…' }`. Key order is display order */
6
+ export type VarPresetSpec = Record<string, string>;
7
+ export declare function toPresetList(spec: VarPresetSpec | undefined): VarPreset[];
8
+ /** which preset the value still IS, or null once it was hand-edited (trailing whitespace ignored) */
9
+ export declare function activePresetLabel(presets: readonly VarPreset[], value: string): string | null;
@@ -0,0 +1,9 @@
1
+ export type VarPreset = {
2
+ label: string;
3
+ text: string;
4
+ };
5
+ /** authored shape: `{ 'terse one-liner': 'reply with one sentence…' }`. Key order is display order */
6
+ export type VarPresetSpec = Record<string, string>;
7
+ export declare function toPresetList(spec: VarPresetSpec | undefined): VarPreset[];
8
+ /** which preset the value still IS, or null once it was hand-edited (trailing whitespace ignored) */
9
+ export declare function activePresetLabel(presets: readonly VarPreset[], value: string): string | null;