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,127 @@
|
|
|
1
|
+
import { type ImageMeta } from 'image-meta';
|
|
2
|
+
import type { Sharp } from 'sharp';
|
|
3
|
+
import type { ComfyHost } from '../host/ComfyHost.cjs';
|
|
4
|
+
import type { ComfyNodeMetadata } from '../graph/ComfyNodeID.cjs';
|
|
5
|
+
import type { ComfyApiNodeJson } from '../sdk-generator/comfy-api-json.cjs';
|
|
6
|
+
import { type AbsolutePath, type Maybe } from '../types/index.cjs';
|
|
7
|
+
import type { NodeOf } from '../types/comfy-sdk.cjs';
|
|
8
|
+
import type { ComfyImageName } from '../sdk-generator/comfyui-types.cjs';
|
|
9
|
+
import type { ComfyExecution } from './ComfyExecution.cjs';
|
|
10
|
+
import type { ComfyWorkflow } from './ComfyWorkflow.cjs';
|
|
11
|
+
import { type ComfyImageInfo } from './ComfyWsApi.cjs';
|
|
12
|
+
/** base64 image loader nodes we know how to wire, in preference order — each
|
|
13
|
+
* verified against a real object_info dump before entering the table */
|
|
14
|
+
export declare const BASE64_IMAGE_LOADERS: {
|
|
15
|
+
nameInComfy: string;
|
|
16
|
+
inputs: (b64: string) => ComfyApiNodeJson['inputs'];
|
|
17
|
+
}[];
|
|
18
|
+
export type MediaImageData = {
|
|
19
|
+
/** absent = in-memory image (ws output with local saving off) — the buffer is then required */
|
|
20
|
+
path?: Maybe<AbsolutePath>;
|
|
21
|
+
buffer?: Uint8Array;
|
|
22
|
+
execution?: ComfyExecution;
|
|
23
|
+
promptNodeID?: string | null;
|
|
24
|
+
comfyUIInfos?: ImageInfos_ComfyGenerated;
|
|
25
|
+
};
|
|
26
|
+
export type ImageInfos_ComfyGenerated = {
|
|
27
|
+
comfyHostHttpURL: string;
|
|
28
|
+
comfyImageInfo: ComfyImageInfo;
|
|
29
|
+
};
|
|
30
|
+
export declare const ImageInfos_ComfyGenerated_ark: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
31
|
+
comfyHostHttpURL: string;
|
|
32
|
+
comfyImageInfo: {
|
|
33
|
+
filename: string;
|
|
34
|
+
subfolder: string;
|
|
35
|
+
type: string;
|
|
36
|
+
};
|
|
37
|
+
}, {}>;
|
|
38
|
+
export declare class MediaImage {
|
|
39
|
+
/** null for in-memory images (local saving is opt-in — architecture.md item 14) */
|
|
40
|
+
absPath: AbsolutePath | null;
|
|
41
|
+
/** the execution this image came from (null when not generated via comfy-ts) */
|
|
42
|
+
execution: Maybe<ComfyExecution>;
|
|
43
|
+
/** return the workflow from which this image was generated */
|
|
44
|
+
get workflow(): ComfyWorkflow | undefined;
|
|
45
|
+
promptNodeID: Maybe<string>;
|
|
46
|
+
constructor(data: MediaImageData);
|
|
47
|
+
/** free-form labels; filled from ComfyNodeMetadata.tag(s) when generated via a prompt */
|
|
48
|
+
tags: string[];
|
|
49
|
+
/** the image as a Blob, e.g. to feed FormData uploads */
|
|
50
|
+
getAsBlob(): Blob;
|
|
51
|
+
/** return the image filename (in-memory images get a stable hash-derived name) */
|
|
52
|
+
get filename(): string;
|
|
53
|
+
get baseNameWithoutExtension(): string;
|
|
54
|
+
/**
|
|
55
|
+
* return file extension including dot
|
|
56
|
+
* e.g. `.png`, or `.webp`
|
|
57
|
+
* */
|
|
58
|
+
get extension(): string;
|
|
59
|
+
/** get the expected enum name (hash) */
|
|
60
|
+
get enumName(): ComfyImageName;
|
|
61
|
+
uploadAndReturnEnumName: (host: ComfyHost) => Promise<ComfyImageName>;
|
|
62
|
+
/** upload the media (hash-named, deduped) and load it in the given workflow as a `LoadImage` node */
|
|
63
|
+
loadInWorkflow_viaLoadImageNode: <WID extends string>(workflow: ComfyWorkflow<WID>) => Promise<NodeOf<WID, 'LoadImage'>>;
|
|
64
|
+
/** load an image as mask in a comfy workflow beeing created */
|
|
65
|
+
loadInWorkflowAsMask_viaLoadImageMask: <WID extends string>(
|
|
66
|
+
/** "alpha" | "blue" | "green" | "red" */
|
|
67
|
+
channel: 'alpha' | 'blue' | 'green' | 'red',
|
|
68
|
+
/** workflow to load image as mask into */
|
|
69
|
+
workflow: ComfyWorkflow<WID>) => Promise<NodeOf<WID, 'LoadImageMask'>>;
|
|
70
|
+
/** load this image into the workflow WITHOUT any server-side file: the
|
|
71
|
+
* image rides base64 inside the prompt JSON (architecture.md item 14 —
|
|
72
|
+
* the prompt still enters server history; `scrubHistory` covers that).
|
|
73
|
+
* Feature-detected against the host schema; no supported node = loud throw. */
|
|
74
|
+
loadInWorkflow_viaBase64Node: <WID extends string>(workflow: ComfyWorkflow<WID>) => NodeOf<WID, 'LoadImage'>;
|
|
75
|
+
/** return the json of the ComfyNode that led to this image */
|
|
76
|
+
get ComfyNode(): Maybe<ComfyApiNodeJson>;
|
|
77
|
+
/**
|
|
78
|
+
* return the metadata of the ComfyNode that led to this image
|
|
79
|
+
* null if not generated by comfy through a ComfyTS prompt
|
|
80
|
+
* null if no metadata associated in the node in ComfyTS
|
|
81
|
+
*/
|
|
82
|
+
get ComfyNodeMetadata(): Maybe<ComfyNodeMetadata>;
|
|
83
|
+
get width(): number | undefined;
|
|
84
|
+
get height(): number | undefined;
|
|
85
|
+
get width_orCrash(): number;
|
|
86
|
+
get height_orCrash(): number;
|
|
87
|
+
/**
|
|
88
|
+
* return the base64 url for this file, regardless of it's exact representation
|
|
89
|
+
* includes the prefix `data:image/<type>;base64,`
|
|
90
|
+
*/
|
|
91
|
+
getBase64Url(): string;
|
|
92
|
+
/**
|
|
93
|
+
* return the base64 url for this file, regardless of it's exact representation
|
|
94
|
+
* does not includes the prefix `data:image/png;base64,`
|
|
95
|
+
*/
|
|
96
|
+
getBase64Payload(): string;
|
|
97
|
+
/** return the ArrayBuffer for this file, regardless it's exact representation */
|
|
98
|
+
/** lazilly loaded, call recomputeMetadata to expire */
|
|
99
|
+
private _buffer;
|
|
100
|
+
get buffer(): Uint8Array;
|
|
101
|
+
/** no-op on in-memory images: the buffer is the only copy */
|
|
102
|
+
freeBuffer: () => void;
|
|
103
|
+
updateBuffer: (buff: Uint8Array) => void;
|
|
104
|
+
reloadBuffer: () => Uint8Array;
|
|
105
|
+
/** lazilly computed, call recomputeMetadata to expire */
|
|
106
|
+
private _metadata;
|
|
107
|
+
get metadata(): ImageMeta;
|
|
108
|
+
private _hash;
|
|
109
|
+
get hash(): string;
|
|
110
|
+
/**
|
|
111
|
+
* Modify the image directly (inplace) by passing it though a `Sharp` pipeline
|
|
112
|
+
* Sharp is a high performance image processing library.
|
|
113
|
+
*/
|
|
114
|
+
processWithSharp_inplace: (
|
|
115
|
+
/** processing function */
|
|
116
|
+
fn: (sharp: Sharp) => Sharp) => Promise<this>;
|
|
117
|
+
/**
|
|
118
|
+
* Allow to run an image though some `Sharp` pipeline to produce an other image.
|
|
119
|
+
* Sharp is a high performance image processing library.
|
|
120
|
+
* to modify the image directly (inplace), use `processWithSharp_inplace` instead.
|
|
121
|
+
*/
|
|
122
|
+
processWithSharp: (
|
|
123
|
+
/** processing function */
|
|
124
|
+
fn: (sharp: Sharp) => Sharp,
|
|
125
|
+
/** where to save the resulting image */
|
|
126
|
+
path?: AbsolutePath) => Promise<MediaImage>;
|
|
127
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type ImageMeta } from 'image-meta';
|
|
2
|
+
import type { Sharp } from 'sharp';
|
|
3
|
+
import type { ComfyHost } from '../host/ComfyHost.js';
|
|
4
|
+
import type { ComfyNodeMetadata } from '../graph/ComfyNodeID.js';
|
|
5
|
+
import type { ComfyApiNodeJson } from '../sdk-generator/comfy-api-json.js';
|
|
6
|
+
import { type AbsolutePath, type Maybe } from '../types/index.js';
|
|
7
|
+
import type { NodeOf } from '../types/comfy-sdk.js';
|
|
8
|
+
import type { ComfyImageName } from '../sdk-generator/comfyui-types.js';
|
|
9
|
+
import type { ComfyExecution } from './ComfyExecution.js';
|
|
10
|
+
import type { ComfyWorkflow } from './ComfyWorkflow.js';
|
|
11
|
+
import { type ComfyImageInfo } from './ComfyWsApi.js';
|
|
12
|
+
/** base64 image loader nodes we know how to wire, in preference order — each
|
|
13
|
+
* verified against a real object_info dump before entering the table */
|
|
14
|
+
export declare const BASE64_IMAGE_LOADERS: {
|
|
15
|
+
nameInComfy: string;
|
|
16
|
+
inputs: (b64: string) => ComfyApiNodeJson['inputs'];
|
|
17
|
+
}[];
|
|
18
|
+
export type MediaImageData = {
|
|
19
|
+
/** absent = in-memory image (ws output with local saving off) — the buffer is then required */
|
|
20
|
+
path?: Maybe<AbsolutePath>;
|
|
21
|
+
buffer?: Uint8Array;
|
|
22
|
+
execution?: ComfyExecution;
|
|
23
|
+
promptNodeID?: string | null;
|
|
24
|
+
comfyUIInfos?: ImageInfos_ComfyGenerated;
|
|
25
|
+
};
|
|
26
|
+
export type ImageInfos_ComfyGenerated = {
|
|
27
|
+
comfyHostHttpURL: string;
|
|
28
|
+
comfyImageInfo: ComfyImageInfo;
|
|
29
|
+
};
|
|
30
|
+
export declare const ImageInfos_ComfyGenerated_ark: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
31
|
+
comfyHostHttpURL: string;
|
|
32
|
+
comfyImageInfo: {
|
|
33
|
+
filename: string;
|
|
34
|
+
subfolder: string;
|
|
35
|
+
type: string;
|
|
36
|
+
};
|
|
37
|
+
}, {}>;
|
|
38
|
+
export declare class MediaImage {
|
|
39
|
+
/** null for in-memory images (local saving is opt-in — architecture.md item 14) */
|
|
40
|
+
absPath: AbsolutePath | null;
|
|
41
|
+
/** the execution this image came from (null when not generated via comfy-ts) */
|
|
42
|
+
execution: Maybe<ComfyExecution>;
|
|
43
|
+
/** return the workflow from which this image was generated */
|
|
44
|
+
get workflow(): ComfyWorkflow | undefined;
|
|
45
|
+
promptNodeID: Maybe<string>;
|
|
46
|
+
constructor(data: MediaImageData);
|
|
47
|
+
/** free-form labels; filled from ComfyNodeMetadata.tag(s) when generated via a prompt */
|
|
48
|
+
tags: string[];
|
|
49
|
+
/** the image as a Blob, e.g. to feed FormData uploads */
|
|
50
|
+
getAsBlob(): Blob;
|
|
51
|
+
/** return the image filename (in-memory images get a stable hash-derived name) */
|
|
52
|
+
get filename(): string;
|
|
53
|
+
get baseNameWithoutExtension(): string;
|
|
54
|
+
/**
|
|
55
|
+
* return file extension including dot
|
|
56
|
+
* e.g. `.png`, or `.webp`
|
|
57
|
+
* */
|
|
58
|
+
get extension(): string;
|
|
59
|
+
/** get the expected enum name (hash) */
|
|
60
|
+
get enumName(): ComfyImageName;
|
|
61
|
+
uploadAndReturnEnumName: (host: ComfyHost) => Promise<ComfyImageName>;
|
|
62
|
+
/** upload the media (hash-named, deduped) and load it in the given workflow as a `LoadImage` node */
|
|
63
|
+
loadInWorkflow_viaLoadImageNode: <WID extends string>(workflow: ComfyWorkflow<WID>) => Promise<NodeOf<WID, 'LoadImage'>>;
|
|
64
|
+
/** load an image as mask in a comfy workflow beeing created */
|
|
65
|
+
loadInWorkflowAsMask_viaLoadImageMask: <WID extends string>(
|
|
66
|
+
/** "alpha" | "blue" | "green" | "red" */
|
|
67
|
+
channel: 'alpha' | 'blue' | 'green' | 'red',
|
|
68
|
+
/** workflow to load image as mask into */
|
|
69
|
+
workflow: ComfyWorkflow<WID>) => Promise<NodeOf<WID, 'LoadImageMask'>>;
|
|
70
|
+
/** load this image into the workflow WITHOUT any server-side file: the
|
|
71
|
+
* image rides base64 inside the prompt JSON (architecture.md item 14 —
|
|
72
|
+
* the prompt still enters server history; `scrubHistory` covers that).
|
|
73
|
+
* Feature-detected against the host schema; no supported node = loud throw. */
|
|
74
|
+
loadInWorkflow_viaBase64Node: <WID extends string>(workflow: ComfyWorkflow<WID>) => NodeOf<WID, 'LoadImage'>;
|
|
75
|
+
/** return the json of the ComfyNode that led to this image */
|
|
76
|
+
get ComfyNode(): Maybe<ComfyApiNodeJson>;
|
|
77
|
+
/**
|
|
78
|
+
* return the metadata of the ComfyNode that led to this image
|
|
79
|
+
* null if not generated by comfy through a ComfyTS prompt
|
|
80
|
+
* null if no metadata associated in the node in ComfyTS
|
|
81
|
+
*/
|
|
82
|
+
get ComfyNodeMetadata(): Maybe<ComfyNodeMetadata>;
|
|
83
|
+
get width(): number | undefined;
|
|
84
|
+
get height(): number | undefined;
|
|
85
|
+
get width_orCrash(): number;
|
|
86
|
+
get height_orCrash(): number;
|
|
87
|
+
/**
|
|
88
|
+
* return the base64 url for this file, regardless of it's exact representation
|
|
89
|
+
* includes the prefix `data:image/<type>;base64,`
|
|
90
|
+
*/
|
|
91
|
+
getBase64Url(): string;
|
|
92
|
+
/**
|
|
93
|
+
* return the base64 url for this file, regardless of it's exact representation
|
|
94
|
+
* does not includes the prefix `data:image/png;base64,`
|
|
95
|
+
*/
|
|
96
|
+
getBase64Payload(): string;
|
|
97
|
+
/** return the ArrayBuffer for this file, regardless it's exact representation */
|
|
98
|
+
/** lazilly loaded, call recomputeMetadata to expire */
|
|
99
|
+
private _buffer;
|
|
100
|
+
get buffer(): Uint8Array;
|
|
101
|
+
/** no-op on in-memory images: the buffer is the only copy */
|
|
102
|
+
freeBuffer: () => void;
|
|
103
|
+
updateBuffer: (buff: Uint8Array) => void;
|
|
104
|
+
reloadBuffer: () => Uint8Array;
|
|
105
|
+
/** lazilly computed, call recomputeMetadata to expire */
|
|
106
|
+
private _metadata;
|
|
107
|
+
get metadata(): ImageMeta;
|
|
108
|
+
private _hash;
|
|
109
|
+
get hash(): string;
|
|
110
|
+
/**
|
|
111
|
+
* Modify the image directly (inplace) by passing it though a `Sharp` pipeline
|
|
112
|
+
* Sharp is a high performance image processing library.
|
|
113
|
+
*/
|
|
114
|
+
processWithSharp_inplace: (
|
|
115
|
+
/** processing function */
|
|
116
|
+
fn: (sharp: Sharp) => Sharp) => Promise<this>;
|
|
117
|
+
/**
|
|
118
|
+
* Allow to run an image though some `Sharp` pipeline to produce an other image.
|
|
119
|
+
* Sharp is a high performance image processing library.
|
|
120
|
+
* to modify the image directly (inplace), use `processWithSharp_inplace` instead.
|
|
121
|
+
*/
|
|
122
|
+
processWithSharp: (
|
|
123
|
+
/** processing function */
|
|
124
|
+
fn: (sharp: Sharp) => Sharp,
|
|
125
|
+
/** where to save the resulting image */
|
|
126
|
+
path?: AbsolutePath) => Promise<MediaImage>;
|
|
127
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComfySchema } from '../sdk-generator/ComfySchema.cjs';
|
|
2
|
+
import type { ComfyApiJson } from '../sdk-generator/comfy-api-json.cjs';
|
|
3
|
+
/** a Comfy account key, or a thunk read only when a run with a partner node starts */
|
|
4
|
+
export type ComfyOrgApiKeySource = string | (() => string | undefined | Promise<string | undefined>);
|
|
5
|
+
/** a partner API node of a prompt: what the error names */
|
|
6
|
+
export type PartnerApiNode = {
|
|
7
|
+
id: string;
|
|
8
|
+
classType: string;
|
|
9
|
+
};
|
|
10
|
+
/** the prompt holds a paid partner node and no Comfy account key was set */
|
|
11
|
+
export declare class ComfyOrgApiKeyMissingError extends Error {
|
|
12
|
+
hostId: string;
|
|
13
|
+
nodes: PartnerApiNode[];
|
|
14
|
+
/** name, not instanceof: the cli bundle and dist/index.js each define this class */
|
|
15
|
+
readonly name = "ComfyOrgApiKeyMissingError";
|
|
16
|
+
constructor(hostId: string, nodes: PartnerApiNode[]);
|
|
17
|
+
}
|
|
18
|
+
/** the nodes of a prompt whose schema says `api_node: true` */
|
|
19
|
+
export declare const partnerApiNodes: (apiJson: ComfyApiJson, schema: ComfySchema) => PartnerApiNode[];
|
|
20
|
+
/** the first source set wins; an empty string counts as unset */
|
|
21
|
+
export declare const resolveComfyOrgApiKey: (sources: readonly (ComfyOrgApiKeySource | undefined)[]) => Promise<string | undefined>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComfySchema } from '../sdk-generator/ComfySchema.js';
|
|
2
|
+
import type { ComfyApiJson } from '../sdk-generator/comfy-api-json.js';
|
|
3
|
+
/** a Comfy account key, or a thunk read only when a run with a partner node starts */
|
|
4
|
+
export type ComfyOrgApiKeySource = string | (() => string | undefined | Promise<string | undefined>);
|
|
5
|
+
/** a partner API node of a prompt: what the error names */
|
|
6
|
+
export type PartnerApiNode = {
|
|
7
|
+
id: string;
|
|
8
|
+
classType: string;
|
|
9
|
+
};
|
|
10
|
+
/** the prompt holds a paid partner node and no Comfy account key was set */
|
|
11
|
+
export declare class ComfyOrgApiKeyMissingError extends Error {
|
|
12
|
+
hostId: string;
|
|
13
|
+
nodes: PartnerApiNode[];
|
|
14
|
+
/** name, not instanceof: the cli bundle and dist/index.js each define this class */
|
|
15
|
+
readonly name = "ComfyOrgApiKeyMissingError";
|
|
16
|
+
constructor(hostId: string, nodes: PartnerApiNode[]);
|
|
17
|
+
}
|
|
18
|
+
/** the nodes of a prompt whose schema says `api_node: true` */
|
|
19
|
+
export declare const partnerApiNodes: (apiJson: ComfyApiJson, schema: ComfySchema) => PartnerApiNode[];
|
|
20
|
+
/** the first source set wins; an empty string counts as unset */
|
|
21
|
+
export declare const resolveComfyOrgApiKey: (sources: readonly (ComfyOrgApiKeySource | undefined)[]) => Promise<string | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function describePromptRejection(body: unknown): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function describePromptRejection(body: unknown): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComfyApiJson } from '../sdk-generator/comfy-api-json.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* the `ephemeral: true` rewrite (architecture.md item 14): every SaveImage
|
|
4
|
+
* node in the SENT snapshot becomes a SaveImageWebsocket (core node, `images`
|
|
5
|
+
* input only), so outputs stream over the ws and never touch the server disk.
|
|
6
|
+
* Mutates the given apiJson IN PLACE — callers pass the run's deep-copied
|
|
7
|
+
* snapshot, never the live graph. Returns how many nodes were rewritten so
|
|
8
|
+
* callers can warn when a graph had nothing to rewrite.
|
|
9
|
+
*/
|
|
10
|
+
export declare function rewriteSaveNodesToWebsocket(apiJson: ComfyApiJson): number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComfyApiJson } from '../sdk-generator/comfy-api-json.js';
|
|
2
|
+
/**
|
|
3
|
+
* the `ephemeral: true` rewrite (architecture.md item 14): every SaveImage
|
|
4
|
+
* node in the SENT snapshot becomes a SaveImageWebsocket (core node, `images`
|
|
5
|
+
* input only), so outputs stream over the ws and never touch the server disk.
|
|
6
|
+
* Mutates the given apiJson IN PLACE — callers pass the run's deep-copied
|
|
7
|
+
* snapshot, never the live graph. Returns how many nodes were rewritten so
|
|
8
|
+
* callers can warn when a graph had nothing to rewrite.
|
|
9
|
+
*/
|
|
10
|
+
export declare function rewriteSaveNodesToWebsocket(apiJson: ComfyApiJson): number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type PromptID, type PromptRelated_WsMsg } from './ComfyWsApi.cjs';
|
|
2
|
+
export type HistoryReplay = {
|
|
3
|
+
/** one `executed` per output node the entry lists */
|
|
4
|
+
executed: PromptRelated_WsMsg[];
|
|
5
|
+
/** the end message: from `status.messages`, or a success when the entry says success (or, on an
|
|
6
|
+
* old server, says nothing). Null when the entry claims an end it does not carry */
|
|
7
|
+
end: PromptRelated_WsMsg | null;
|
|
8
|
+
/** entries that did not pass the ws schemas, skipped */
|
|
9
|
+
problems: string[];
|
|
10
|
+
};
|
|
11
|
+
/** a prompt's `GET /history/<id>` reply as the ws messages a client missed. Null while the host has no
|
|
12
|
+
* entry for it: queued, running, or lost */
|
|
13
|
+
export declare function historyReplay(json: unknown, promptId: PromptID): HistoryReplay | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type PromptID, type PromptRelated_WsMsg } from './ComfyWsApi.js';
|
|
2
|
+
export type HistoryReplay = {
|
|
3
|
+
/** one `executed` per output node the entry lists */
|
|
4
|
+
executed: PromptRelated_WsMsg[];
|
|
5
|
+
/** the end message: from `status.messages`, or a success when the entry says success (or, on an
|
|
6
|
+
* old server, says nothing). Null when the entry claims an end it does not carry */
|
|
7
|
+
end: PromptRelated_WsMsg | null;
|
|
8
|
+
/** entries that did not pass the ws schemas, skipped */
|
|
9
|
+
problems: string[];
|
|
10
|
+
};
|
|
11
|
+
/** a prompt's `GET /history/<id>` reply as the ws messages a client missed. Null while the host has no
|
|
12
|
+
* entry for it: queued, running, or lost */
|
|
13
|
+
export declare function historyReplay(json: unknown, promptId: PromptID): HistoryReplay | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type MediaKind = 'image' | 'audio' | 'video';
|
|
2
|
+
export declare const MEDIA_KINDS: readonly MediaKind[];
|
|
3
|
+
/** picker defaults per kind, lowercase without dots */
|
|
4
|
+
export declare const DEFAULT_MEDIA_EXTENSIONS: Record<MediaKind, readonly string[]>;
|
|
5
|
+
export declare function extensionOf(filename: string): string;
|
|
6
|
+
export declare function isVideoFilename(filename: string): boolean;
|
|
7
|
+
export declare function mediaMime(filename: string): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type MediaKind = 'image' | 'audio' | 'video';
|
|
2
|
+
export declare const MEDIA_KINDS: readonly MediaKind[];
|
|
3
|
+
/** picker defaults per kind, lowercase without dots */
|
|
4
|
+
export declare const DEFAULT_MEDIA_EXTENSIONS: Record<MediaKind, readonly string[]>;
|
|
5
|
+
export declare function extensionOf(filename: string): string;
|
|
6
|
+
export declare function isVideoFilename(filename: string): boolean;
|
|
7
|
+
export declare function mediaMime(filename: string): string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* local output naming, relative to `.comfy-ts/outputs/`:
|
|
3
|
+
* the server filename is NOT unique — cloud hosts reset the
|
|
4
|
+
* `_00001_` counter every run, so trusting it overwrote the same file — and
|
|
5
|
+
* a `foo/krea/` prefix means the DIRECTORY foo/krea/, not a `krea_` name
|
|
6
|
+
* prefix. Local names are ours: dir from the prompt's own filename_prefix
|
|
7
|
+
* (or an explicit save.prefix override), then
|
|
8
|
+
* `<stem>_<timestamp>_<counter><ext>` so every run sorts chronologically
|
|
9
|
+
* per stem and nothing ever collides.
|
|
10
|
+
*/
|
|
11
|
+
export declare const localOutputPath: (p: {
|
|
12
|
+
/** explicit local dir override (SaveOptions.prefix) — wins when set */
|
|
13
|
+
localDir?: string;
|
|
14
|
+
/** the SaveImage node's own filename_prefix as sent in the prompt */
|
|
15
|
+
filenamePrefix?: string;
|
|
16
|
+
/** server-reported subfolder (fallback when no prefix is known) */
|
|
17
|
+
subfolder: string;
|
|
18
|
+
/** server-reported filename, e.g. krea_00001_.png */
|
|
19
|
+
filename: string;
|
|
20
|
+
/** run timestamp, YYYYMMDD-HHmmss */
|
|
21
|
+
timestamp: string;
|
|
22
|
+
}) => string;
|
|
23
|
+
/** REPLACE the extension (never append one): a re-encoded save owns its whole
|
|
24
|
+
* name now that local naming is ours, so `save: {format:'image/webp'}` writes
|
|
25
|
+
* `shot_20260731-154210_00001.webp`, not `…_00001.png.webp` — appending
|
|
26
|
+
* described the bytes twice and the first description was a lie */
|
|
27
|
+
export declare const withExtension: (path: string, ext: string) => string;
|
|
28
|
+
/**
|
|
29
|
+
* never-overwrite guard: bump `-2`, `-3`, … while the path exists on disk OR
|
|
30
|
+
* was already CLAIMED by a still-downloading retrieval (two same-second runs
|
|
31
|
+
* on a counter-resetting cloud host compute the same name).
|
|
32
|
+
* The chosen path is claimed before returning.
|
|
33
|
+
*/
|
|
34
|
+
export declare const uniquifyOutputPath: (p: {
|
|
35
|
+
path: string;
|
|
36
|
+
exists: (path: string) => boolean;
|
|
37
|
+
claimed: Set<string>;
|
|
38
|
+
}) => string;
|
|
39
|
+
/** YYYYMMDD-HHmmss, local time — sortable, text-encodable, no colons for filesystems */
|
|
40
|
+
export declare const runTimestamp: (d: Date) => string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* local output naming, relative to `.comfy-ts/outputs/`:
|
|
3
|
+
* the server filename is NOT unique — cloud hosts reset the
|
|
4
|
+
* `_00001_` counter every run, so trusting it overwrote the same file — and
|
|
5
|
+
* a `foo/krea/` prefix means the DIRECTORY foo/krea/, not a `krea_` name
|
|
6
|
+
* prefix. Local names are ours: dir from the prompt's own filename_prefix
|
|
7
|
+
* (or an explicit save.prefix override), then
|
|
8
|
+
* `<stem>_<timestamp>_<counter><ext>` so every run sorts chronologically
|
|
9
|
+
* per stem and nothing ever collides.
|
|
10
|
+
*/
|
|
11
|
+
export declare const localOutputPath: (p: {
|
|
12
|
+
/** explicit local dir override (SaveOptions.prefix) — wins when set */
|
|
13
|
+
localDir?: string;
|
|
14
|
+
/** the SaveImage node's own filename_prefix as sent in the prompt */
|
|
15
|
+
filenamePrefix?: string;
|
|
16
|
+
/** server-reported subfolder (fallback when no prefix is known) */
|
|
17
|
+
subfolder: string;
|
|
18
|
+
/** server-reported filename, e.g. krea_00001_.png */
|
|
19
|
+
filename: string;
|
|
20
|
+
/** run timestamp, YYYYMMDD-HHmmss */
|
|
21
|
+
timestamp: string;
|
|
22
|
+
}) => string;
|
|
23
|
+
/** REPLACE the extension (never append one): a re-encoded save owns its whole
|
|
24
|
+
* name now that local naming is ours, so `save: {format:'image/webp'}` writes
|
|
25
|
+
* `shot_20260731-154210_00001.webp`, not `…_00001.png.webp` — appending
|
|
26
|
+
* described the bytes twice and the first description was a lie */
|
|
27
|
+
export declare const withExtension: (path: string, ext: string) => string;
|
|
28
|
+
/**
|
|
29
|
+
* never-overwrite guard: bump `-2`, `-3`, … while the path exists on disk OR
|
|
30
|
+
* was already CLAIMED by a still-downloading retrieval (two same-second runs
|
|
31
|
+
* on a counter-resetting cloud host compute the same name).
|
|
32
|
+
* The chosen path is claimed before returning.
|
|
33
|
+
*/
|
|
34
|
+
export declare const uniquifyOutputPath: (p: {
|
|
35
|
+
path: string;
|
|
36
|
+
exists: (path: string) => boolean;
|
|
37
|
+
claimed: Set<string>;
|
|
38
|
+
}) => string;
|
|
39
|
+
/** YYYYMMDD-HHmmss, local time — sortable, text-encodable, no colons for filesystems */
|
|
40
|
+
export declare const runTimestamp: (d: Date) => string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const BINARY_FRAME_PREVIEW_IMAGE = 1;
|
|
2
|
+
export declare const BINARY_FRAME_TEXT = 3;
|
|
3
|
+
export declare const BINARY_FRAME_PREVIEW_IMAGE_WITH_METADATA = 4;
|
|
4
|
+
export type ParsedPreviewFrame = {
|
|
5
|
+
kind: 'preview';
|
|
6
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
7
|
+
mime: string;
|
|
8
|
+
metadata: unknown;
|
|
9
|
+
};
|
|
10
|
+
export type ParsedBinaryWsFrame = ParsedPreviewFrame | {
|
|
11
|
+
kind: 'text';
|
|
12
|
+
nodeId: string;
|
|
13
|
+
text: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'unknown';
|
|
16
|
+
eventType: number;
|
|
17
|
+
};
|
|
18
|
+
/** the frame's event type, read in place: deciding whether anyone wants a frame costs no copy */
|
|
19
|
+
export declare function binaryFrameType(data: ArrayBuffer): number;
|
|
20
|
+
export declare function isPreviewFrameType(eventType: number): boolean;
|
|
21
|
+
export declare function parseBinaryWsFrame(data: ArrayBuffer): ParsedBinaryWsFrame;
|
|
22
|
+
/** a type 1 or type 4 frame; the caller checked the type with `isPreviewFrameType` */
|
|
23
|
+
export declare function parsePreviewFrame(data: ArrayBuffer): ParsedPreviewFrame;
|
|
24
|
+
/** the node a type 4 frame names (`node_id` in its metadata), null when absent or malformed */
|
|
25
|
+
export declare function previewMetadataNodeId(metadata: unknown): string | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const BINARY_FRAME_PREVIEW_IMAGE = 1;
|
|
2
|
+
export declare const BINARY_FRAME_TEXT = 3;
|
|
3
|
+
export declare const BINARY_FRAME_PREVIEW_IMAGE_WITH_METADATA = 4;
|
|
4
|
+
export type ParsedPreviewFrame = {
|
|
5
|
+
kind: 'preview';
|
|
6
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
7
|
+
mime: string;
|
|
8
|
+
metadata: unknown;
|
|
9
|
+
};
|
|
10
|
+
export type ParsedBinaryWsFrame = ParsedPreviewFrame | {
|
|
11
|
+
kind: 'text';
|
|
12
|
+
nodeId: string;
|
|
13
|
+
text: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'unknown';
|
|
16
|
+
eventType: number;
|
|
17
|
+
};
|
|
18
|
+
/** the frame's event type, read in place: deciding whether anyone wants a frame costs no copy */
|
|
19
|
+
export declare function binaryFrameType(data: ArrayBuffer): number;
|
|
20
|
+
export declare function isPreviewFrameType(eventType: number): boolean;
|
|
21
|
+
export declare function parseBinaryWsFrame(data: ArrayBuffer): ParsedBinaryWsFrame;
|
|
22
|
+
/** a type 1 or type 4 frame; the caller checked the type with `isPreviewFrameType` */
|
|
23
|
+
export declare function parsePreviewFrame(data: ArrayBuffer): ParsedPreviewFrame;
|
|
24
|
+
/** the node a type 4 frame names (`node_id` in its metadata), null when absent or malformed */
|
|
25
|
+
export declare function previewMetadataNodeId(metadata: unknown): string | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Maybe } from '../types/index.cjs';
|
|
2
|
+
import type { ComfyInputOpts, ComfyNodeSchemaJSON } from './ComfyUIObjectInfoTypes.cjs';
|
|
3
|
+
import type { ComfyUnionInfo, NodeInputExt, NodeOutputExt } from './comfyui-types.cjs';
|
|
4
|
+
export type NodeOwnEnum = {
|
|
5
|
+
in: 'input' | 'output';
|
|
6
|
+
ownName: string;
|
|
7
|
+
enum: ComfyUnionInfo;
|
|
8
|
+
};
|
|
9
|
+
export declare class ComfyNodeSchema {
|
|
10
|
+
raw: ComfyNodeSchemaJSON;
|
|
11
|
+
nameInComfy: string;
|
|
12
|
+
nodeKey: string;
|
|
13
|
+
category: string;
|
|
14
|
+
inputs: NodeInputExt[];
|
|
15
|
+
outputs: NodeOutputExt[];
|
|
16
|
+
pythonModule: string;
|
|
17
|
+
/** list of types the node has a single output of */
|
|
18
|
+
_singleOutputs: Maybe<NodeOutputExt[]>;
|
|
19
|
+
get singleOutputs(): NodeOutputExt[];
|
|
20
|
+
constructor(raw: ComfyNodeSchemaJSON, nameInComfy: string, nodeKey: string, // same but qualified to keep track of pythonNamespace
|
|
21
|
+
category: string, inputs: NodeInputExt[], outputs: NodeOutputExt[], pythonModule: string);
|
|
22
|
+
codegenUI(): string;
|
|
23
|
+
renderOpts(opts?: ComfyInputOpts): Maybe<string>;
|
|
24
|
+
}
|
|
25
|
+
export declare const wrapQuote: (s: string) => string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Maybe } from '../types/index.js';
|
|
2
|
+
import type { ComfyInputOpts, ComfyNodeSchemaJSON } from './ComfyUIObjectInfoTypes.js';
|
|
3
|
+
import type { ComfyUnionInfo, NodeInputExt, NodeOutputExt } from './comfyui-types.js';
|
|
4
|
+
export type NodeOwnEnum = {
|
|
5
|
+
in: 'input' | 'output';
|
|
6
|
+
ownName: string;
|
|
7
|
+
enum: ComfyUnionInfo;
|
|
8
|
+
};
|
|
9
|
+
export declare class ComfyNodeSchema {
|
|
10
|
+
raw: ComfyNodeSchemaJSON;
|
|
11
|
+
nameInComfy: string;
|
|
12
|
+
nodeKey: string;
|
|
13
|
+
category: string;
|
|
14
|
+
inputs: NodeInputExt[];
|
|
15
|
+
outputs: NodeOutputExt[];
|
|
16
|
+
pythonModule: string;
|
|
17
|
+
/** list of types the node has a single output of */
|
|
18
|
+
_singleOutputs: Maybe<NodeOutputExt[]>;
|
|
19
|
+
get singleOutputs(): NodeOutputExt[];
|
|
20
|
+
constructor(raw: ComfyNodeSchemaJSON, nameInComfy: string, nodeKey: string, // same but qualified to keep track of pythonNamespace
|
|
21
|
+
category: string, inputs: NodeInputExt[], outputs: NodeOutputExt[], pythonModule: string);
|
|
22
|
+
codegenUI(): string;
|
|
23
|
+
renderOpts(opts?: ComfyInputOpts): Maybe<string>;
|
|
24
|
+
}
|
|
25
|
+
export declare const wrapQuote: (s: string) => string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ComfyNodeSchema } from './ComfyNodeSchema.cjs';
|
|
2
|
+
import type { ComfyEnumDef, ComfySchemaJSON } from './ComfyUIObjectInfoTypes.cjs';
|
|
3
|
+
import { type ComfyImageName, type ComfyNodeSlotName, type ComfyNodeSlotTypeName, type ComfyPythonModule, type ComfyUnionInfo, type ComfyUnionValue, type EmbeddingName, type NodeNameInComfy, type QualifiedNodeKey } from './comfyui-types.cjs';
|
|
4
|
+
export type ComfySchemaId = string;
|
|
5
|
+
export type ComfySchemaData = {
|
|
6
|
+
spec: ComfySchemaJSON;
|
|
7
|
+
embeddings: string[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* ONE host's schema: the parsed view of its object_info.json + embeddings.
|
|
11
|
+
* Owns union dedup (by sha1 of values), node indexing, and the per-host
|
|
12
|
+
* sdk codegen (`codegenDTS`).
|
|
13
|
+
*/
|
|
14
|
+
export declare class ComfySchema {
|
|
15
|
+
data: ComfySchemaData;
|
|
16
|
+
codegenDTS: (opts: import("./comfyui-sdk-codegen.cjs").CodegenOptions) => string;
|
|
17
|
+
constructor(data: ComfySchemaData);
|
|
18
|
+
update(data: Partial<ComfySchemaData>): void;
|
|
19
|
+
isInvalid: boolean;
|
|
20
|
+
/** number of nodes in the current schema (quick way to check your instance infos) */
|
|
21
|
+
get size(): number;
|
|
22
|
+
knownSlotTypes: Set<ComfyNodeSlotTypeName>;
|
|
23
|
+
knownUnionBySlotName: Map<ComfyNodeSlotName, ComfyUnionInfo>;
|
|
24
|
+
knownUnionByHash: Map<string, ComfyUnionInfo>;
|
|
25
|
+
knownUnionByName: Map<string, ComfyUnionInfo>;
|
|
26
|
+
nodes: ComfyNodeSchema[];
|
|
27
|
+
pythonModuleByNodeKey: Map<QualifiedNodeKey, ComfyPythonModule>;
|
|
28
|
+
pythonModuleByNodeNameInComfy: Map<NodeNameInComfy, ComfyPythonModule>;
|
|
29
|
+
nodesByNameInComfy: {
|
|
30
|
+
[key: NodeNameInComfy]: ComfyNodeSchema;
|
|
31
|
+
};
|
|
32
|
+
nodesByKey: {
|
|
33
|
+
[key: QualifiedNodeKey]: ComfyNodeSchema;
|
|
34
|
+
};
|
|
35
|
+
nodesByProduction: {
|
|
36
|
+
[key in ComfyNodeSlotTypeName]?: ComfyNodeSchema[];
|
|
37
|
+
};
|
|
38
|
+
enumsAppearingInOutput: Set<ComfyNodeSlotTypeName>;
|
|
39
|
+
pythonModules: Map<string, string[]>;
|
|
40
|
+
private parse;
|
|
41
|
+
processSlot: (p: {
|
|
42
|
+
pythonModule: string;
|
|
43
|
+
slotName: ComfyNodeSlotName;
|
|
44
|
+
comfyUnionDef: ComfyEnumDef;
|
|
45
|
+
}) => ComfyUnionInfo;
|
|
46
|
+
private log;
|
|
47
|
+
toTSType(t: string): string;
|
|
48
|
+
toAcceptsType(t: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* every possible value for a given slot, straight from the live schema.
|
|
51
|
+
* e.g. schema.values('LoraLoader.lora_name') -> all loras on this host
|
|
52
|
+
*/
|
|
53
|
+
values(slotName: string): ComfyUnionValue[];
|
|
54
|
+
/** string values only (most enums are), for quick discovery */
|
|
55
|
+
stringValues(slotName: string): string[];
|
|
56
|
+
/**
|
|
57
|
+
* for now, simply ensure that the number of parsed nodes matches the number
|
|
58
|
+
* of nodes present in the object_info.json
|
|
59
|
+
*/
|
|
60
|
+
RUN_BASIC_CHECKS: () => void;
|
|
61
|
+
hasEmbedding(embedding: string): embedding is EmbeddingName;
|
|
62
|
+
hasLora(loraName: string): boolean;
|
|
63
|
+
/** all loras on the host, optionally narrowed by a regex */
|
|
64
|
+
getLoras: (filter?: RegExp) => string[];
|
|
65
|
+
hasImage(imgName: string): imgName is ComfyImageName;
|
|
66
|
+
getImages: () => string[];
|
|
67
|
+
/**
|
|
68
|
+
* only use this function after an upload success,
|
|
69
|
+
* when you say this asset is now part of ComfyUI
|
|
70
|
+
**/
|
|
71
|
+
unsafely_addImageInSchemaWithoutReloading: (imgName: ComfyImageName) => void;
|
|
72
|
+
hasCheckpoint(ckptName: string): boolean;
|
|
73
|
+
getCheckpoints: () => string[];
|
|
74
|
+
}
|