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.
- package/dist/chunk-6mgjbrp6.js +579 -0
- package/dist/chunk-6mgjbrp6.js.map +17 -0
- package/dist/chunk-6tsg7fm5.js +1876 -0
- package/dist/chunk-6tsg7fm5.js.map +31 -0
- package/dist/chunk-dvxjvwe7.js +2593 -0
- package/dist/chunk-dvxjvwe7.js.map +29 -0
- package/dist/chunk-dw0t1nye.js +457 -0
- package/dist/chunk-dw0t1nye.js.map +16 -0
- package/dist/chunk-he70ewwx.js +444 -0
- package/dist/chunk-he70ewwx.js.map +13 -0
- package/dist/chunk-n22qz0j1.js +6663 -0
- package/dist/chunk-n22qz0j1.js.map +95 -0
- package/dist/chunk-n35nffm8.js +4777 -0
- package/dist/chunk-n35nffm8.js.map +51 -0
- package/dist/cli/serve/hostProtocol.d.cts +74 -0
- package/dist/cli/serve/hostProtocol.d.ts +74 -0
- package/dist/cli/tui-env.d.cts +2 -0
- package/dist/cli/tui-env.d.ts +2 -0
- package/dist/cli.js +494 -485
- package/dist/cli.js.map +16 -1
- package/dist/coreExports.d.cts +45 -0
- package/dist/coreExports.d.ts +45 -0
- package/dist/errors/InvalidPromptError.d.cts +10 -0
- package/dist/errors/InvalidPromptError.d.ts +10 -0
- package/dist/exampleAssets.d.cts +24 -0
- package/dist/exampleAssets.d.ts +24 -0
- package/dist/graph/ComfyNode.d.cts +109 -0
- package/dist/graph/ComfyNode.d.ts +109 -0
- package/dist/graph/ComfyNodeID.d.cts +15 -0
- package/dist/graph/ComfyNodeID.d.ts +15 -0
- package/dist/graph/ComfyNodeOutput.d.cts +21 -0
- package/dist/graph/ComfyNodeOutput.d.ts +21 -0
- package/dist/graph/NodeSlotSize.d.cts +4 -0
- package/dist/graph/NodeSlotSize.d.ts +4 -0
- package/dist/graph/autoValue.d.cts +16 -0
- package/dist/graph/autoValue.d.ts +16 -0
- package/dist/host/ComfyHost.d.cts +383 -0
- package/dist/host/ComfyHost.d.ts +383 -0
- package/dist/host/ComfyInstallType.d.cts +11 -0
- package/dist/host/ComfyInstallType.d.ts +11 -0
- package/dist/host/ComfyManager.d.cts +152 -0
- package/dist/host/ComfyManager.d.ts +152 -0
- package/dist/host/ComfyUploader.d.cts +42 -0
- package/dist/host/ComfyUploader.d.ts +42 -0
- package/dist/host/ComfyWorkflowBuilder.d.cts +19 -0
- package/dist/host/ComfyWorkflowBuilder.d.ts +19 -0
- package/dist/host/Requirements.d.cts +43 -0
- package/dist/host/Requirements.d.ts +43 -0
- package/dist/host/ResilientWebsocket.d.cts +122 -0
- package/dist/host/ResilientWebsocket.d.ts +122 -0
- package/dist/host/hostFile.d.cts +23 -0
- package/dist/host/hostFile.d.ts +23 -0
- package/dist/host/hostUrl.d.cts +22 -0
- package/dist/host/hostUrl.d.ts +22 -0
- package/dist/host/leastBusy.d.cts +9 -0
- package/dist/host/leastBusy.d.ts +9 -0
- package/dist/host/loraInfoCache.d.cts +110 -0
- package/dist/host/loraInfoCache.d.ts +110 -0
- package/dist/host/loraManagerApi.d.cts +106 -0
- package/dist/host/loraManagerApi.d.ts +106 -0
- package/dist/host/previewMethod.d.cts +5 -0
- package/dist/host/previewMethod.d.ts +5 -0
- package/dist/host/schemaDrift.d.cts +54 -0
- package/dist/host/schemaDrift.d.ts +54 -0
- package/dist/image-utils/_getPngMetadata.d.cts +5 -0
- package/dist/image-utils/_getPngMetadata.d.ts +5 -0
- package/dist/index.cjs +8197 -8509
- package/dist/index.cjs.map +124 -1
- package/dist/index.d.cts +4 -19116
- package/dist/index.d.ts +4 -19116
- package/dist/index.js +8129 -8390
- package/dist/index.js.map +124 -1
- package/dist/litegraph/CanonicalWorkflow.d.cts +75 -0
- package/dist/litegraph/CanonicalWorkflow.d.ts +75 -0
- package/dist/litegraph/LiteGraphGroup.d.cts +17 -0
- package/dist/litegraph/LiteGraphGroup.d.ts +17 -0
- package/dist/litegraph/LiteGraphJSON.d.cts +242 -0
- package/dist/litegraph/LiteGraphJSON.d.ts +242 -0
- package/dist/litegraph/LiteGraphLink.d.cts +48 -0
- package/dist/litegraph/LiteGraphLink.d.ts +48 -0
- package/dist/litegraph/LiteGraphLinkID.d.cts +6 -0
- package/dist/litegraph/LiteGraphLinkID.d.ts +6 -0
- package/dist/litegraph/LiteGraphNode.d.cts +76 -0
- package/dist/litegraph/LiteGraphNode.d.ts +76 -0
- package/dist/litegraph/LiteGraphNodeInput.d.cts +25 -0
- package/dist/litegraph/LiteGraphNodeInput.d.ts +25 -0
- package/dist/litegraph/LiteGraphNodeOutput.d.cts +20 -0
- package/dist/litegraph/LiteGraphNodeOutput.d.ts +20 -0
- package/dist/litegraph/LiteGraphSlotIndex.d.cts +6 -0
- package/dist/litegraph/LiteGraphSlotIndex.d.ts +6 -0
- package/dist/litegraph/LiteGraphSubgraphDef.d.cts +174 -0
- package/dist/litegraph/LiteGraphSubgraphDef.d.ts +174 -0
- package/dist/litegraph/convertFlowToLiteGraphJSON.d.cts +12 -0
- package/dist/litegraph/convertFlowToLiteGraphJSON.d.ts +12 -0
- package/dist/litegraph/expandSubgraphs.d.cts +27 -0
- package/dist/litegraph/expandSubgraphs.d.ts +27 -0
- package/dist/litegraph/normalizeWorkflow.d.cts +21 -0
- package/dist/litegraph/normalizeWorkflow.d.ts +21 -0
- package/dist/manager/ComfyRegistry.d.cts +54 -0
- package/dist/manager/ComfyRegistry.d.ts +54 -0
- package/dist/manager/generated/KnownComfyCustomNodeName.d.cts +1 -0
- package/dist/manager/generated/KnownComfyCustomNodeName.d.ts +1 -0
- package/dist/manager/generated/KnownComfyPluginTitle.d.cts +12109 -0
- package/dist/manager/generated/KnownComfyPluginTitle.d.ts +12109 -0
- package/dist/manager/generated/KnownComfyPluginURL.d.cts +1 -0
- package/dist/manager/generated/KnownComfyPluginURL.d.ts +1 -0
- package/dist/manager/generated/KnownModel_Base.d.cts +2 -0
- package/dist/manager/generated/KnownModel_Base.d.ts +2 -0
- package/dist/manager/generated/KnownModel_Name.d.cts +2842 -0
- package/dist/manager/generated/KnownModel_Name.d.ts +2842 -0
- package/dist/manager/generated/KnownModel_SavePath.d.cts +2 -0
- package/dist/manager/generated/KnownModel_SavePath.d.ts +2 -0
- package/dist/manager/generated/KnownModel_Type.d.cts +2 -0
- package/dist/manager/generated/KnownModel_Type.d.ts +2 -0
- package/dist/manager/installedView.d.cts +65 -0
- package/dist/manager/installedView.d.ts +65 -0
- package/dist/manager/json/custom-node-list.extra.d.cts +2 -0
- package/dist/manager/json/custom-node-list.extra.d.ts +2 -0
- package/dist/manager/json/model-list.extra.d.cts +2 -0
- package/dist/manager/json/model-list.extra.d.ts +2 -0
- package/dist/manager/loaders/parseReport.d.cts +24 -0
- package/dist/manager/loaders/parseReport.d.ts +24 -0
- package/dist/manager/loaders/step1_downloadComfyManagerJSONs.d.cts +1 -0
- package/dist/manager/loaders/step1_downloadComfyManagerJSONs.d.ts +1 -0
- package/dist/manager/loaders/step2_custom-node-list-loader.d.cts +2 -0
- package/dist/manager/loaders/step2_custom-node-list-loader.d.ts +2 -0
- package/dist/manager/loaders/step3_extension-node-map-loader.d.cts +2 -0
- package/dist/manager/loaders/step3_extension-node-map-loader.d.ts +2 -0
- package/dist/manager/loaders/step4_model-list-loader.d.cts +2 -0
- package/dist/manager/loaders/step4_model-list-loader.d.ts +2 -0
- package/dist/manager/loaders/step5_alter-list-loader.d.cts +2 -0
- package/dist/manager/loaders/step5_alter-list-loader.d.ts +2 -0
- package/dist/manager/loaders/step6_github-stats-loader.d.cts +2 -0
- package/dist/manager/loaders/step6_github-stats-loader.d.ts +2 -0
- package/dist/manager/types/ComfyManagerAPIFetchPolicy.d.cts +7 -0
- package/dist/manager/types/ComfyManagerAPIFetchPolicy.d.ts +7 -0
- package/dist/manager/types/ComfyManagerAPIModelList.d.cts +10 -0
- package/dist/manager/types/ComfyManagerAPIModelList.d.ts +10 -0
- package/dist/manager/types/ComfyManagerAPIPluginList.d.cts +33 -0
- package/dist/manager/types/ComfyManagerAPIPluginList.d.ts +33 -0
- package/dist/manager/types/ComfyManagerAlterInfo.d.cts +12 -0
- package/dist/manager/types/ComfyManagerAlterInfo.d.ts +12 -0
- package/dist/manager/types/ComfyManagerFileModelInfo.d.cts +10 -0
- package/dist/manager/types/ComfyManagerFileModelInfo.d.ts +10 -0
- package/dist/manager/types/ComfyManagerFilePluginContent.d.cts +11 -0
- package/dist/manager/types/ComfyManagerFilePluginContent.d.ts +11 -0
- package/dist/manager/types/ComfyManagerFilePluginList.d.cts +5 -0
- package/dist/manager/types/ComfyManagerFilePluginList.d.ts +5 -0
- package/dist/manager/types/ComfyManagerGithubStats.d.cts +7 -0
- package/dist/manager/types/ComfyManagerGithubStats.d.ts +7 -0
- package/dist/manager/types/ComfyManagerModelInfo.d.cts +12 -0
- package/dist/manager/types/ComfyManagerModelInfo.d.ts +12 -0
- package/dist/manager/types/ComfyManagerPluginContentMetadata.d.cts +10 -0
- package/dist/manager/types/ComfyManagerPluginContentMetadata.d.ts +10 -0
- package/dist/manager/types/ComfyManagerPluginEnums.d.cts +5 -0
- package/dist/manager/types/ComfyManagerPluginEnums.d.ts +5 -0
- package/dist/manager/types/ComfyManagerPluginInfo.d.cts +54 -0
- package/dist/manager/types/ComfyManagerPluginInfo.d.ts +54 -0
- package/dist/promptEnhancers.d.cts +22 -0
- package/dist/promptEnhancers.d.ts +22 -0
- package/dist/runner/ComfyExecution.d.cts +230 -0
- package/dist/runner/ComfyExecution.d.ts +230 -0
- package/dist/runner/ComfyExecutionStatus.d.cts +1 -0
- package/dist/runner/ComfyExecutionStatus.d.ts +1 -0
- package/dist/runner/ComfyWorkflow.d.cts +141 -0
- package/dist/runner/ComfyWorkflow.d.ts +141 -0
- package/dist/runner/ComfyWorkflowLayout.d.cts +17 -0
- package/dist/runner/ComfyWorkflowLayout.d.ts +17 -0
- package/dist/runner/ComfyWsApi.d.cts +2174 -0
- package/dist/runner/ComfyWsApi.d.ts +2174 -0
- package/dist/runner/MediaImage.d.cts +127 -0
- package/dist/runner/MediaImage.d.ts +127 -0
- package/dist/runner/comfyOrgApiKey.d.cts +21 -0
- package/dist/runner/comfyOrgApiKey.d.ts +21 -0
- package/dist/runner/describePromptRejection.d.cts +1 -0
- package/dist/runner/describePromptRejection.d.ts +1 -0
- package/dist/runner/ephemeral.d.cts +10 -0
- package/dist/runner/ephemeral.d.ts +10 -0
- package/dist/runner/historyReplay.d.cts +13 -0
- package/dist/runner/historyReplay.d.ts +13 -0
- package/dist/runner/mediaKinds.d.cts +7 -0
- package/dist/runner/mediaKinds.d.ts +7 -0
- package/dist/runner/outputPath.d.cts +40 -0
- package/dist/runner/outputPath.d.ts +40 -0
- package/dist/runner/outputs3d.d.cts +3 -0
- package/dist/runner/outputs3d.d.ts +3 -0
- package/dist/runner/wsBinaryFrame.d.cts +25 -0
- package/dist/runner/wsBinaryFrame.d.ts +25 -0
- package/dist/sdk-generator/ComfyNodeSchema.d.cts +25 -0
- package/dist/sdk-generator/ComfyNodeSchema.d.ts +25 -0
- package/dist/sdk-generator/ComfySchema.d.cts +74 -0
- package/dist/sdk-generator/ComfySchema.d.ts +74 -0
- package/dist/sdk-generator/ComfyUIObjectInfoTypes.d.cts +3072 -0
- package/dist/sdk-generator/ComfyUIObjectInfoTypes.d.ts +3072 -0
- package/dist/sdk-generator/Primitives.d.cts +12 -0
- package/dist/sdk-generator/Primitives.d.ts +12 -0
- package/dist/sdk-generator/_getUnionNameBasedOnFirstFoundEnumName.d.cts +2 -0
- package/dist/sdk-generator/_getUnionNameBasedOnFirstFoundEnumName.d.ts +2 -0
- package/dist/sdk-generator/_pythonModuleToNamespace.d.cts +1 -0
- package/dist/sdk-generator/_pythonModuleToNamespace.d.ts +1 -0
- package/dist/sdk-generator/_toQualifiedNodeKey.d.cts +1 -0
- package/dist/sdk-generator/_toQualifiedNodeKey.d.ts +1 -0
- package/dist/sdk-generator/comfy-api-json.d.cts +16 -0
- package/dist/sdk-generator/comfy-api-json.d.ts +16 -0
- package/dist/sdk-generator/comfyui-sdk-codegen.d.cts +23 -0
- package/dist/sdk-generator/comfyui-sdk-codegen.d.ts +23 -0
- package/dist/sdk-generator/comfyui-types.d.cts +55 -0
- package/dist/sdk-generator/comfyui-types.d.ts +55 -0
- package/dist/sdk-generator/inputWidgetKind.d.cts +80 -0
- package/dist/sdk-generator/inputWidgetKind.d.ts +80 -0
- package/dist/sdk-generator/litegraphToApiRequestPayload.d.cts +41 -0
- package/dist/sdk-generator/litegraphToApiRequestPayload.d.ts +41 -0
- package/dist/serve-web.js +51 -51
- package/dist/ssh-host-manager/ssh-config-manager.d.cts +17 -0
- package/dist/ssh-host-manager/ssh-config-manager.d.ts +17 -0
- package/dist/state.d.cts +80 -0
- package/dist/state.d.ts +80 -0
- package/dist/storage/ComfyStorage.d.cts +55 -0
- package/dist/storage/ComfyStorage.d.ts +55 -0
- package/dist/storage/nodeStorage.d.cts +2 -0
- package/dist/storage/nodeStorage.d.ts +2 -0
- package/dist/types/comfy-sdk.d.cts +85 -0
- package/dist/types/comfy-sdk.d.ts +85 -0
- package/dist/types/index.d.cts +65 -0
- package/dist/types/index.d.ts +65 -0
- package/dist/utils/CodeBuffer.d.cts +20 -0
- package/dist/utils/CodeBuffer.d.ts +20 -0
- package/dist/utils/ComfyColors.d.cts +14 -0
- package/dist/utils/ComfyColors.d.ts +14 -0
- package/dist/utils/ansi.d.cts +22 -0
- package/dist/utils/ansi.d.ts +22 -0
- package/dist/utils/bang.d.cts +9 -0
- package/dist/utils/bang.d.ts +9 -0
- package/dist/utils/deepCopyNaive.d.cts +1 -0
- package/dist/utils/deepCopyNaive.d.ts +1 -0
- package/dist/utils/downloadFile.d.cts +2 -0
- package/dist/utils/downloadFile.d.ts +2 -0
- package/dist/utils/escapeJSKey.d.cts +2 -0
- package/dist/utils/escapeJSKey.d.ts +2 -0
- package/dist/utils/exhaust.d.cts +1 -0
- package/dist/utils/exhaust.d.ts +1 -0
- package/dist/utils/extractErrorMessage.d.cts +2 -0
- package/dist/utils/extractErrorMessage.d.ts +2 -0
- package/dist/utils/githubRegexes.d.cts +2 -0
- package/dist/utils/githubRegexes.d.ts +2 -0
- package/dist/utils/hashArrayBuffer.d.cts +1 -0
- package/dist/utils/hashArrayBuffer.d.ts +1 -0
- package/dist/utils/isRecord.d.cts +2 -0
- package/dist/utils/isRecord.d.ts +2 -0
- package/dist/utils/lazySharp.d.cts +3 -0
- package/dist/utils/lazySharp.d.ts +3 -0
- package/dist/utils/log.d.cts +4 -0
- package/dist/utils/log.d.ts +4 -0
- package/dist/utils/loraTag.d.cts +8 -0
- package/dist/utils/loraTag.d.ts +8 -0
- package/dist/utils/matchesRegex.d.cts +2 -0
- package/dist/utils/matchesRegex.d.ts +2 -0
- package/dist/utils/printArkResultInConsole.d.cts +2 -0
- package/dist/utils/printArkResultInConsole.d.ts +2 -0
- package/dist/utils/safeName.d.cts +6 -0
- package/dist/utils/safeName.d.ts +6 -0
- package/dist/utils/sha1.d.cts +2 -0
- package/dist/utils/sha1.d.ts +2 -0
- package/dist/utils/softValidate.d.cts +2 -0
- package/dist/utils/softValidate.d.ts +2 -0
- package/dist/utils/stringifyReadable.d.cts +1 -0
- package/dist/utils/stringifyReadable.d.ts +1 -0
- package/dist/utils/toposort.d.cts +3 -0
- package/dist/utils/toposort.d.ts +3 -0
- package/dist/vars/ComfyVars.d.cts +607 -0
- package/dist/vars/ComfyVars.d.ts +607 -0
- package/dist/vars/DefinedWorkflow.d.cts +104 -0
- package/dist/vars/DefinedWorkflow.d.ts +104 -0
- package/dist/vars/lanes.d.cts +81 -0
- package/dist/vars/lanes.d.ts +81 -0
- package/dist/vars/loraEntry.d.cts +26 -0
- package/dist/vars/loraEntry.d.ts +26 -0
- package/dist/vars/loraKeywords.d.cts +19 -0
- package/dist/vars/loraKeywords.d.ts +19 -0
- package/dist/vars/outputWidgets.d.cts +33 -0
- package/dist/vars/outputWidgets.d.ts +33 -0
- package/dist/vars/presets.d.cts +9 -0
- package/dist/vars/presets.d.ts +9 -0
- package/dist/vars/promptSyntax.d.cts +98 -0
- package/dist/vars/promptSyntax.d.ts +98 -0
- package/dist/web.d.cts +2 -0
- package/dist/web.d.ts +2 -19160
- package/dist/web.js +8040 -8292
- package/dist/web.js.map +119 -1
- package/examples/depth-explorer/web/tsconfig.json +1 -2
- package/examples/upscale-explorer/web/tsconfig.json +1 -2
- package/examples/web/tsconfig.json +1 -4
- package/examples/world-explorer/web/tsconfig.json +1 -2
- package/package.json +27 -32
- package/src/cli/serve/web/components/SideMenu.tsx +1 -1
- package/src/cli/serve/web/components/controls/LorasControl.tsx +2 -0
- package/src/cli/serve/web/components/controls/RichSelect.tsx +1 -0
- package/src/cli/serve/web/state/RunSt.poll.test.ts +2 -1
- package/src/cli/serve/web/tsconfig.json +1 -2
- package/src/cli/serve/web/widgets/RelightWidget.tsx +1 -0
- package/src/cli/tui/state/HostSt.ts +1 -1
- package/src/host/loraManagerApi.ts +8 -3
- package/src/runner/ComfyExecution.ts +3 -1
- package/src/runner/ComfyWsApi.ts +2 -1
- package/src/storage/ComfyStorage.ts +5 -4
- package/src/types/comfy-sdk.ts +1 -0
- package/src/utils/ansi.ts +1 -0
- package/dist/ServeApp-fsHtW5zG.js +0 -2689
- package/dist/ServeApp-fsHtW5zG.js.map +0 -1
- package/dist/exampleAssets-DZynSkZm.js +0 -6674
- package/dist/exampleAssets-DZynSkZm.js.map +0 -1
- package/dist/findDefinedWorkflow-qyqFea7q.js +0 -625
- package/dist/findDefinedWorkflow-qyqFea7q.js.map +0 -1
- package/dist/run-run-Cn2JzKlE.js +0 -449
- package/dist/run-run-Cn2JzKlE.js.map +0 -1
- package/dist/run-serve-BhGegaCI.js +0 -464
- package/dist/run-serve-BhGegaCI.js.map +0 -1
- package/dist/run-tui-CrM4ijkH.js +0 -4569
- package/dist/run-tui-CrM4ijkH.js.map +0 -1
- package/dist/schemaDrift-BGYJZGMD.js +0 -2225
- package/dist/schemaDrift-BGYJZGMD.js.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComfyNodeSchemaJSON } from './ComfyUIObjectInfoTypes.cjs';
|
|
2
|
+
export declare const ComfyPrimitiveMapping: {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const ComfyPrimitives: string[];
|
|
6
|
+
/**
|
|
7
|
+
* when a litegraph node has an input entry with a widget marker, the
|
|
8
|
+
* serialized TYPE string decides how many widgets_values it consumed in that era
|
|
9
|
+
*/
|
|
10
|
+
export declare const howManyWidgetValuesForThisInputType: (type: string, nameInComfy: string) => number;
|
|
11
|
+
export declare const ComfyDefaultNodeWhenUnknown_Name: string;
|
|
12
|
+
export declare const ComfyDefaultNodeWhenUnknown_Schema: ComfyNodeSchemaJSON;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComfyNodeSchemaJSON } from './ComfyUIObjectInfoTypes.js';
|
|
2
|
+
export declare const ComfyPrimitiveMapping: {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const ComfyPrimitives: string[];
|
|
6
|
+
/**
|
|
7
|
+
* when a litegraph node has an input entry with a widget marker, the
|
|
8
|
+
* serialized TYPE string decides how many widgets_values it consumed in that era
|
|
9
|
+
*/
|
|
10
|
+
export declare const howManyWidgetValuesForThisInputType: (type: string, nameInComfy: string) => number;
|
|
11
|
+
export declare const ComfyDefaultNodeWhenUnknown_Name: string;
|
|
12
|
+
export declare const ComfyDefaultNodeWhenUnknown_Schema: ComfyNodeSchemaJSON;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function pythonModuleToPrefix(pythonModule: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function pythonModuleToPrefix(pythonModule: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toQualifiedNodeKey: (pythonModule: string, nameInComfy: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toQualifiedNodeKey: (pythonModule: string, nameInComfy: string) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* the graph format comfyUI server takes as input
|
|
3
|
+
*
|
|
4
|
+
* !! Hasn't been updated in a while; may be out of date !!
|
|
5
|
+
*/
|
|
6
|
+
export type ComfyApiJson = {
|
|
7
|
+
[nodeUID: string]: ComfyApiNodeJson;
|
|
8
|
+
};
|
|
9
|
+
export type ComfyApiNodeJson = {
|
|
10
|
+
inputs: {
|
|
11
|
+
[key: string]: [string, number] | string | number | boolean | null | {
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
class_type: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* the graph format comfyUI server takes as input
|
|
3
|
+
*
|
|
4
|
+
* !! Hasn't been updated in a while; may be out of date !!
|
|
5
|
+
*/
|
|
6
|
+
export type ComfyApiJson = {
|
|
7
|
+
[nodeUID: string]: ComfyApiNodeJson;
|
|
8
|
+
};
|
|
9
|
+
export type ComfyApiNodeJson = {
|
|
10
|
+
inputs: {
|
|
11
|
+
[key: string]: [string, number] | string | number | boolean | null | {
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
class_type: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComfySchema } from './ComfySchema.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* convert a host id to the namespace name it gets inside the global `Comfy` namespace
|
|
4
|
+
* e.g. 'windows-1' -> 'Windows1', 'my_cloud.instance' -> 'MyCloudInstance'
|
|
5
|
+
*/
|
|
6
|
+
export declare function hostIdToNamespace(hostId: string): string;
|
|
7
|
+
export type CodegenOptions = {
|
|
8
|
+
/** host id; drives both the `Comfy.Hosts` registry key and the namespace name */
|
|
9
|
+
hostId: string;
|
|
10
|
+
/** module to import runtime-facing types from (default: 'comfy-ts') */
|
|
11
|
+
packageName?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* emit the typed SDK for one host:
|
|
15
|
+
*
|
|
16
|
+
* declare global {
|
|
17
|
+
* namespace Comfy {
|
|
18
|
+
* namespace <HostNs> { IN / OUT / Node / Builder / Slots / Accepts / Union / ... }
|
|
19
|
+
* interface Hosts { '<host-id>': <HostNs>.Sdk }
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
23
|
+
export declare function codegenSDK(this: ComfySchema, opts: CodegenOptions): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComfySchema } from './ComfySchema.js';
|
|
2
|
+
/**
|
|
3
|
+
* convert a host id to the namespace name it gets inside the global `Comfy` namespace
|
|
4
|
+
* e.g. 'windows-1' -> 'Windows1', 'my_cloud.instance' -> 'MyCloudInstance'
|
|
5
|
+
*/
|
|
6
|
+
export declare function hostIdToNamespace(hostId: string): string;
|
|
7
|
+
export type CodegenOptions = {
|
|
8
|
+
/** host id; drives both the `Comfy.Hosts` registry key and the namespace name */
|
|
9
|
+
hostId: string;
|
|
10
|
+
/** module to import runtime-facing types from (default: 'comfy-ts') */
|
|
11
|
+
packageName?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* emit the typed SDK for one host:
|
|
15
|
+
*
|
|
16
|
+
* declare global {
|
|
17
|
+
* namespace Comfy {
|
|
18
|
+
* namespace <HostNs> { IN / OUT / Node / Builder / Slots / Accepts / Union / ... }
|
|
19
|
+
* interface Hosts { '<host-id>': <HostNs>.Sdk }
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
23
|
+
export declare function codegenSDK(this: ComfySchema, opts: CodegenOptions): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Branded } from '../types/index.cjs';
|
|
2
|
+
import type { ComfyInputOpts } from './ComfyUIObjectInfoTypes.cjs';
|
|
3
|
+
export type ComfyUnionHash = string;
|
|
4
|
+
export type ComfyUnionName = string;
|
|
5
|
+
export type ComfyUnionValue = string | boolean | number;
|
|
6
|
+
export type ComfyPythonModule = string;
|
|
7
|
+
export type NodeNameInComfy = string;
|
|
8
|
+
export type QualifiedNodeKey = string;
|
|
9
|
+
/**
|
|
10
|
+
* the textual name of a slot type (slot = input or output of a node),
|
|
11
|
+
* e.g. 'MODEL', 'IMAGE', 'E_CkptName'.
|
|
12
|
+
* Branded string — internals never depend on the global Comfy namespace
|
|
13
|
+
* (that would break host encapsulation: slot types are per-host).
|
|
14
|
+
*/
|
|
15
|
+
export type ComfyNodeSlotTypeName = Branded<string, {
|
|
16
|
+
SlotTypeName: true;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const asComfyNodeSlotTypeName: (x: string) => ComfyNodeSlotTypeName;
|
|
19
|
+
/** a fully-qualified slot name, e.g. 'LoadImage.image' or 'KSampler.LATENT.OUT' */
|
|
20
|
+
export type ComfyNodeSlotName = Branded<string, {
|
|
21
|
+
SlotName: true;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const asComfyNodeSlotName: (x: string) => ComfyNodeSlotName;
|
|
24
|
+
export type EmbeddingName = Branded<string, {
|
|
25
|
+
Embedding: true;
|
|
26
|
+
}>;
|
|
27
|
+
export type NodeInputExt = {
|
|
28
|
+
slotName: ComfyNodeSlotName;
|
|
29
|
+
nameInComfy: string;
|
|
30
|
+
nameInComfyEscaped: string;
|
|
31
|
+
typeName: ComfyNodeSlotTypeName;
|
|
32
|
+
opts?: ComfyInputOpts;
|
|
33
|
+
isPrimitive: boolean;
|
|
34
|
+
isEnum: boolean;
|
|
35
|
+
required: boolean;
|
|
36
|
+
index: number;
|
|
37
|
+
};
|
|
38
|
+
export type NodeOutputExt = {
|
|
39
|
+
slotName: ComfyNodeSlotName;
|
|
40
|
+
typeName: ComfyNodeSlotTypeName;
|
|
41
|
+
outKey: string;
|
|
42
|
+
nameInComfy: string;
|
|
43
|
+
isPrimitive: boolean;
|
|
44
|
+
};
|
|
45
|
+
export type ComfyUnionInfo = {
|
|
46
|
+
hash: ComfyUnionHash;
|
|
47
|
+
unionName: ComfyUnionName;
|
|
48
|
+
values: ComfyUnionValue[];
|
|
49
|
+
enumNames: ComfyNodeSlotName[];
|
|
50
|
+
};
|
|
51
|
+
/** an image file name as known by the host (hash-named upload or existing input) */
|
|
52
|
+
export type ComfyImageName = Branded<string, {
|
|
53
|
+
ComfyImageName: true;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const asComfyImageName: (x: string) => ComfyImageName;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Branded } from '../types/index.js';
|
|
2
|
+
import type { ComfyInputOpts } from './ComfyUIObjectInfoTypes.js';
|
|
3
|
+
export type ComfyUnionHash = string;
|
|
4
|
+
export type ComfyUnionName = string;
|
|
5
|
+
export type ComfyUnionValue = string | boolean | number;
|
|
6
|
+
export type ComfyPythonModule = string;
|
|
7
|
+
export type NodeNameInComfy = string;
|
|
8
|
+
export type QualifiedNodeKey = string;
|
|
9
|
+
/**
|
|
10
|
+
* the textual name of a slot type (slot = input or output of a node),
|
|
11
|
+
* e.g. 'MODEL', 'IMAGE', 'E_CkptName'.
|
|
12
|
+
* Branded string — internals never depend on the global Comfy namespace
|
|
13
|
+
* (that would break host encapsulation: slot types are per-host).
|
|
14
|
+
*/
|
|
15
|
+
export type ComfyNodeSlotTypeName = Branded<string, {
|
|
16
|
+
SlotTypeName: true;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const asComfyNodeSlotTypeName: (x: string) => ComfyNodeSlotTypeName;
|
|
19
|
+
/** a fully-qualified slot name, e.g. 'LoadImage.image' or 'KSampler.LATENT.OUT' */
|
|
20
|
+
export type ComfyNodeSlotName = Branded<string, {
|
|
21
|
+
SlotName: true;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const asComfyNodeSlotName: (x: string) => ComfyNodeSlotName;
|
|
24
|
+
export type EmbeddingName = Branded<string, {
|
|
25
|
+
Embedding: true;
|
|
26
|
+
}>;
|
|
27
|
+
export type NodeInputExt = {
|
|
28
|
+
slotName: ComfyNodeSlotName;
|
|
29
|
+
nameInComfy: string;
|
|
30
|
+
nameInComfyEscaped: string;
|
|
31
|
+
typeName: ComfyNodeSlotTypeName;
|
|
32
|
+
opts?: ComfyInputOpts;
|
|
33
|
+
isPrimitive: boolean;
|
|
34
|
+
isEnum: boolean;
|
|
35
|
+
required: boolean;
|
|
36
|
+
index: number;
|
|
37
|
+
};
|
|
38
|
+
export type NodeOutputExt = {
|
|
39
|
+
slotName: ComfyNodeSlotName;
|
|
40
|
+
typeName: ComfyNodeSlotTypeName;
|
|
41
|
+
outKey: string;
|
|
42
|
+
nameInComfy: string;
|
|
43
|
+
isPrimitive: boolean;
|
|
44
|
+
};
|
|
45
|
+
export type ComfyUnionInfo = {
|
|
46
|
+
hash: ComfyUnionHash;
|
|
47
|
+
unionName: ComfyUnionName;
|
|
48
|
+
values: ComfyUnionValue[];
|
|
49
|
+
enumNames: ComfyNodeSlotName[];
|
|
50
|
+
};
|
|
51
|
+
/** an image file name as known by the host (hash-named upload or existing input) */
|
|
52
|
+
export type ComfyImageName = Branded<string, {
|
|
53
|
+
ComfyImageName: true;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const asComfyImageName: (x: string) => ComfyImageName;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { NodeInputExt } from './comfyui-types.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* Widget-ness of a schema input, decided from its CONFIG — never from a
|
|
4
|
+
* type-name whitelist (2026 object_info spells widget inputs as arbitrary
|
|
5
|
+
* strings backed by a frontend widget registry we cannot mirror; every
|
|
6
|
+
* registry spelling carries a config signal instead). Signal precedence and
|
|
7
|
+
* their upstream anchors: agent/architecture.md "Widget-ness is decided from
|
|
8
|
+
* the input CONFIG".
|
|
9
|
+
*/
|
|
10
|
+
export type InputWidgetKind = {
|
|
11
|
+
kind: 'slot';
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'widget';
|
|
14
|
+
/** total widgets_values entries this input's run occupies: prefix buttons + value + control phantom */
|
|
15
|
+
consumes: number;
|
|
16
|
+
strictValues: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* serialized values the frontend addWidget()s BEFORE the real value
|
|
19
|
+
* (button widgets, creation order). Import reads the value at
|
|
20
|
+
* `offset + prefixValues.length`; export writes these literals first
|
|
21
|
+
* so a round-trip through the ComfyUI editor keeps positional
|
|
22
|
+
* alignment. Empty for every config-signalled widget.
|
|
23
|
+
*/
|
|
24
|
+
prefixValues: readonly unknown[];
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'dynamic-combo';
|
|
27
|
+
options: DynamicComboOption[];
|
|
28
|
+
defaultKey: string;
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'dynamic-container';
|
|
31
|
+
instanceNames: string[];
|
|
32
|
+
requiredCount: number;
|
|
33
|
+
}
|
|
34
|
+
/** widget rows: prompt keys `<decl>.<row>.<field>`, saved run `[count, …row field runs]` (architecture.md, dynamic group) */
|
|
35
|
+
| {
|
|
36
|
+
kind: 'dynamic-group';
|
|
37
|
+
fields: RawInputSpecEntry[];
|
|
38
|
+
min: number;
|
|
39
|
+
max: number;
|
|
40
|
+
};
|
|
41
|
+
/** one raw `[type, opts]` input entry as spelled in object_info (dynamic-combo branches arrive in this raw form) */
|
|
42
|
+
export type RawInputSpecEntry = {
|
|
43
|
+
name: string;
|
|
44
|
+
type: string | readonly unknown[];
|
|
45
|
+
opts: unknown;
|
|
46
|
+
required: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type DynamicComboOption = {
|
|
49
|
+
key: string;
|
|
50
|
+
inputs: RawInputSpecEntry[];
|
|
51
|
+
};
|
|
52
|
+
export declare const isRecord: (x: unknown) => x is Record<string, unknown>;
|
|
53
|
+
/**
|
|
54
|
+
* the single template sub-input's slot type of an autogrow container
|
|
55
|
+
* (`'IMAGE'` for TextEncodeBooguEdit.images). null when opts are not an
|
|
56
|
+
* autogrow template or the template has several sub-inputs (corpus-absent
|
|
57
|
+
* 2026-07-30, 27/27 single on the cloud catalog) — then codegen emits no
|
|
58
|
+
* typed instance keys and the container stays builderBase territory.
|
|
59
|
+
*/
|
|
60
|
+
export declare const containerInstanceSlotType: (opts: unknown) => string | null;
|
|
61
|
+
export declare const classifyWidgetInput: (p: {
|
|
62
|
+
name: string;
|
|
63
|
+
type: string | readonly unknown[];
|
|
64
|
+
opts: unknown;
|
|
65
|
+
/** true when type is a generated `E_*` union name (parsed 2024-era enum) */
|
|
66
|
+
isEnumUnion?: boolean;
|
|
67
|
+
}) => InputWidgetKind;
|
|
68
|
+
export declare const classifySchemaInput: (input: NodeInputExt) => InputWidgetKind;
|
|
69
|
+
/**
|
|
70
|
+
* what ComfyUI's frontend gives a widget created with no serialized value
|
|
71
|
+
* (`getWidgetDefaultValue` semantics), used when a positional array is
|
|
72
|
+
* shorter than the schema's widget list. `null` for custom widgets — the
|
|
73
|
+
* backend accepts an explicit null but errors on an ABSENT required key.
|
|
74
|
+
*/
|
|
75
|
+
export declare const defaultValueForWidget: (p: {
|
|
76
|
+
type: string;
|
|
77
|
+
opts: unknown;
|
|
78
|
+
/** resolved values when the type is a generated E_ union or an inline enum array */
|
|
79
|
+
enumValues?: readonly (string | boolean | number)[];
|
|
80
|
+
}) => unknown;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { NodeInputExt } from './comfyui-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Widget-ness of a schema input, decided from its CONFIG — never from a
|
|
4
|
+
* type-name whitelist (2026 object_info spells widget inputs as arbitrary
|
|
5
|
+
* strings backed by a frontend widget registry we cannot mirror; every
|
|
6
|
+
* registry spelling carries a config signal instead). Signal precedence and
|
|
7
|
+
* their upstream anchors: agent/architecture.md "Widget-ness is decided from
|
|
8
|
+
* the input CONFIG".
|
|
9
|
+
*/
|
|
10
|
+
export type InputWidgetKind = {
|
|
11
|
+
kind: 'slot';
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'widget';
|
|
14
|
+
/** total widgets_values entries this input's run occupies: prefix buttons + value + control phantom */
|
|
15
|
+
consumes: number;
|
|
16
|
+
strictValues: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* serialized values the frontend addWidget()s BEFORE the real value
|
|
19
|
+
* (button widgets, creation order). Import reads the value at
|
|
20
|
+
* `offset + prefixValues.length`; export writes these literals first
|
|
21
|
+
* so a round-trip through the ComfyUI editor keeps positional
|
|
22
|
+
* alignment. Empty for every config-signalled widget.
|
|
23
|
+
*/
|
|
24
|
+
prefixValues: readonly unknown[];
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'dynamic-combo';
|
|
27
|
+
options: DynamicComboOption[];
|
|
28
|
+
defaultKey: string;
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'dynamic-container';
|
|
31
|
+
instanceNames: string[];
|
|
32
|
+
requiredCount: number;
|
|
33
|
+
}
|
|
34
|
+
/** widget rows: prompt keys `<decl>.<row>.<field>`, saved run `[count, …row field runs]` (architecture.md, dynamic group) */
|
|
35
|
+
| {
|
|
36
|
+
kind: 'dynamic-group';
|
|
37
|
+
fields: RawInputSpecEntry[];
|
|
38
|
+
min: number;
|
|
39
|
+
max: number;
|
|
40
|
+
};
|
|
41
|
+
/** one raw `[type, opts]` input entry as spelled in object_info (dynamic-combo branches arrive in this raw form) */
|
|
42
|
+
export type RawInputSpecEntry = {
|
|
43
|
+
name: string;
|
|
44
|
+
type: string | readonly unknown[];
|
|
45
|
+
opts: unknown;
|
|
46
|
+
required: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type DynamicComboOption = {
|
|
49
|
+
key: string;
|
|
50
|
+
inputs: RawInputSpecEntry[];
|
|
51
|
+
};
|
|
52
|
+
export declare const isRecord: (x: unknown) => x is Record<string, unknown>;
|
|
53
|
+
/**
|
|
54
|
+
* the single template sub-input's slot type of an autogrow container
|
|
55
|
+
* (`'IMAGE'` for TextEncodeBooguEdit.images). null when opts are not an
|
|
56
|
+
* autogrow template or the template has several sub-inputs (corpus-absent
|
|
57
|
+
* 2026-07-30, 27/27 single on the cloud catalog) — then codegen emits no
|
|
58
|
+
* typed instance keys and the container stays builderBase territory.
|
|
59
|
+
*/
|
|
60
|
+
export declare const containerInstanceSlotType: (opts: unknown) => string | null;
|
|
61
|
+
export declare const classifyWidgetInput: (p: {
|
|
62
|
+
name: string;
|
|
63
|
+
type: string | readonly unknown[];
|
|
64
|
+
opts: unknown;
|
|
65
|
+
/** true when type is a generated `E_*` union name (parsed 2024-era enum) */
|
|
66
|
+
isEnumUnion?: boolean;
|
|
67
|
+
}) => InputWidgetKind;
|
|
68
|
+
export declare const classifySchemaInput: (input: NodeInputExt) => InputWidgetKind;
|
|
69
|
+
/**
|
|
70
|
+
* what ComfyUI's frontend gives a widget created with no serialized value
|
|
71
|
+
* (`getWidgetDefaultValue` semantics), used when a positional array is
|
|
72
|
+
* shorter than the schema's widget list. `null` for custom widgets — the
|
|
73
|
+
* backend accepts an explicit null but errors on an ABSENT required key.
|
|
74
|
+
*/
|
|
75
|
+
export declare const defaultValueForWidget: (p: {
|
|
76
|
+
type: string;
|
|
77
|
+
opts: unknown;
|
|
78
|
+
/** resolved values when the type is a generated E_ union or an inline enum array */
|
|
79
|
+
enumValues?: readonly (string | boolean | number)[];
|
|
80
|
+
}) => unknown;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CanonicalWorkflow } from '../litegraph/CanonicalWorkflow.cjs';
|
|
2
|
+
import type { ComfySchema } from './ComfySchema.cjs';
|
|
3
|
+
import type { ComfyApiJson } from './comfy-api-json.cjs';
|
|
4
|
+
export type WorkflowConvertErrorCode = 'unknown-node' | 'missing-widget-value' | 'invalid-widget-value' | 'unknown-dynamic-combo-option' | 'dangling-link' | 'missing-required-input' | 'unsupported-feature';
|
|
5
|
+
/** a canonical workflow the converter cannot turn into a prompt — the code NAMES the feature that failed */
|
|
6
|
+
export declare class WorkflowConvertError extends Error {
|
|
7
|
+
code: WorkflowConvertErrorCode;
|
|
8
|
+
node?: {
|
|
9
|
+
id: number;
|
|
10
|
+
type: string;
|
|
11
|
+
} | undefined;
|
|
12
|
+
constructor(code: WorkflowConvertErrorCode, message: string, node?: {
|
|
13
|
+
id: number;
|
|
14
|
+
type: string;
|
|
15
|
+
} | undefined);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* convert a normalized workflow (CanonicalWorkflow — see parseWorkflowJson)
|
|
19
|
+
* into the api.json (prompt format) ComfyUI's POST /prompt takes.
|
|
20
|
+
* Handles: muted nodes (skipped, consumers resolve unconnected), bypassed
|
|
21
|
+
* nodes (mode 4: link resolution walks through to the first type-matching
|
|
22
|
+
* input), Note/MarkdownNote/Reroute/PrimitiveNode virtual nodes (reroutes
|
|
23
|
+
* unwrapped, primitives inlined into their consumers), widget values both
|
|
24
|
+
* positional (with the phantom `control_after_generate` offset after seeds)
|
|
25
|
+
* and named (object-form widgets_values + subgraph promotion overrides —
|
|
26
|
+
* named wins, but a live link wins over both). Widget-ness is decided from
|
|
27
|
+
* the input CONFIG (inputWidgetKind.ts): V3 string-spelled widget types
|
|
28
|
+
* (COMBO options, dynamic combos, autogrow containers, socketless customs)
|
|
29
|
+
* and 2024-era enums go through ONE classifier; a positional array shorter
|
|
30
|
+
* than the schema's widget list fills schema defaults, never throws
|
|
31
|
+
* (agent/architecture.md owns both decisions).
|
|
32
|
+
*/
|
|
33
|
+
export declare const convertLiteGraphToPrompt: (
|
|
34
|
+
/** the ComfySchema object (to look for references/definitions) */
|
|
35
|
+
schema: ComfySchema,
|
|
36
|
+
/** the normalized litegraph document */
|
|
37
|
+
workflow: CanonicalWorkflow, opts?: {
|
|
38
|
+
verbose?: boolean;
|
|
39
|
+
}) => ComfyApiJson;
|
|
40
|
+
/** alias cause I keep forgetting about this */
|
|
41
|
+
export declare const convertWorkflowToPrompt: typeof convertLiteGraphToPrompt;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CanonicalWorkflow } from '../litegraph/CanonicalWorkflow.js';
|
|
2
|
+
import type { ComfySchema } from './ComfySchema.js';
|
|
3
|
+
import type { ComfyApiJson } from './comfy-api-json.js';
|
|
4
|
+
export type WorkflowConvertErrorCode = 'unknown-node' | 'missing-widget-value' | 'invalid-widget-value' | 'unknown-dynamic-combo-option' | 'dangling-link' | 'missing-required-input' | 'unsupported-feature';
|
|
5
|
+
/** a canonical workflow the converter cannot turn into a prompt — the code NAMES the feature that failed */
|
|
6
|
+
export declare class WorkflowConvertError extends Error {
|
|
7
|
+
code: WorkflowConvertErrorCode;
|
|
8
|
+
node?: {
|
|
9
|
+
id: number;
|
|
10
|
+
type: string;
|
|
11
|
+
} | undefined;
|
|
12
|
+
constructor(code: WorkflowConvertErrorCode, message: string, node?: {
|
|
13
|
+
id: number;
|
|
14
|
+
type: string;
|
|
15
|
+
} | undefined);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* convert a normalized workflow (CanonicalWorkflow — see parseWorkflowJson)
|
|
19
|
+
* into the api.json (prompt format) ComfyUI's POST /prompt takes.
|
|
20
|
+
* Handles: muted nodes (skipped, consumers resolve unconnected), bypassed
|
|
21
|
+
* nodes (mode 4: link resolution walks through to the first type-matching
|
|
22
|
+
* input), Note/MarkdownNote/Reroute/PrimitiveNode virtual nodes (reroutes
|
|
23
|
+
* unwrapped, primitives inlined into their consumers), widget values both
|
|
24
|
+
* positional (with the phantom `control_after_generate` offset after seeds)
|
|
25
|
+
* and named (object-form widgets_values + subgraph promotion overrides —
|
|
26
|
+
* named wins, but a live link wins over both). Widget-ness is decided from
|
|
27
|
+
* the input CONFIG (inputWidgetKind.ts): V3 string-spelled widget types
|
|
28
|
+
* (COMBO options, dynamic combos, autogrow containers, socketless customs)
|
|
29
|
+
* and 2024-era enums go through ONE classifier; a positional array shorter
|
|
30
|
+
* than the schema's widget list fills schema defaults, never throws
|
|
31
|
+
* (agent/architecture.md owns both decisions).
|
|
32
|
+
*/
|
|
33
|
+
export declare const convertLiteGraphToPrompt: (
|
|
34
|
+
/** the ComfySchema object (to look for references/definitions) */
|
|
35
|
+
schema: ComfySchema,
|
|
36
|
+
/** the normalized litegraph document */
|
|
37
|
+
workflow: CanonicalWorkflow, opts?: {
|
|
38
|
+
verbose?: boolean;
|
|
39
|
+
}) => ComfyApiJson;
|
|
40
|
+
/** alias cause I keep forgetting about this */
|
|
41
|
+
export declare const convertWorkflowToPrompt: typeof convertLiteGraphToPrompt;
|