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,22 @@
|
|
|
1
|
+
/** pure url layer for ComfyHost: parse once, render everywhere. No comfyts global. */
|
|
2
|
+
export type ParsedHostBase = {
|
|
3
|
+
scheme: 'http' | 'https';
|
|
4
|
+
host: string;
|
|
5
|
+
/** always concrete (defaults 80/443 from the scheme when the url omits it) */
|
|
6
|
+
port: number;
|
|
7
|
+
/** '' or '/segment…' with no trailing slash */
|
|
8
|
+
basePath: string;
|
|
9
|
+
};
|
|
10
|
+
/** exactly ONE of `url` or the legacy `host`+`port` (+`https?`) spelling */
|
|
11
|
+
export declare function parseHostBase(p: {
|
|
12
|
+
id: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
host?: string;
|
|
15
|
+
port?: number;
|
|
16
|
+
https?: boolean;
|
|
17
|
+
}): ParsedHostBase;
|
|
18
|
+
/** http(s) base, port omitted when it is the scheme default */
|
|
19
|
+
export declare function renderHttpBase(p: ParsedHostBase): string;
|
|
20
|
+
/** ws(s) endpoint; auth rides the upgrade headers — EXCEPT headerless
|
|
21
|
+
* transports (browser), where the ws client remaps X-API-Key to ?token= */
|
|
22
|
+
export declare function renderWsUrl(p: ParsedHostBase): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** pure url layer for ComfyHost: parse once, render everywhere. No comfyts global. */
|
|
2
|
+
export type ParsedHostBase = {
|
|
3
|
+
scheme: 'http' | 'https';
|
|
4
|
+
host: string;
|
|
5
|
+
/** always concrete (defaults 80/443 from the scheme when the url omits it) */
|
|
6
|
+
port: number;
|
|
7
|
+
/** '' or '/segment…' with no trailing slash */
|
|
8
|
+
basePath: string;
|
|
9
|
+
};
|
|
10
|
+
/** exactly ONE of `url` or the legacy `host`+`port` (+`https?`) spelling */
|
|
11
|
+
export declare function parseHostBase(p: {
|
|
12
|
+
id: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
host?: string;
|
|
15
|
+
port?: number;
|
|
16
|
+
https?: boolean;
|
|
17
|
+
}): ParsedHostBase;
|
|
18
|
+
/** http(s) base, port omitted when it is the scheme default */
|
|
19
|
+
export declare function renderHttpBase(p: ParsedHostBase): string;
|
|
20
|
+
/** ws(s) endpoint; auth rides the upgrade headers — EXCEPT headerless
|
|
21
|
+
* transports (browser), where the ws client remaps X-API-Key to ?token= */
|
|
22
|
+
export declare function renderWsUrl(p: ParsedHostBase): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComfyHost } from './ComfyHost.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* the host with the shortest queue. Score = max(server queue, our runs in flight there):
|
|
4
|
+
* the server counts every client, the local count sees runs not posted yet.
|
|
5
|
+
* Ties go to the first host listed; a host that does not answer is skipped, all down throws.
|
|
6
|
+
*/
|
|
7
|
+
export declare function leastBusy<H extends ComfyHost<string>>(hosts: readonly H[], p?: {
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
}): Promise<H>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComfyHost } from './ComfyHost.js';
|
|
2
|
+
/**
|
|
3
|
+
* the host with the shortest queue. Score = max(server queue, our runs in flight there):
|
|
4
|
+
* the server counts every client, the local count sees runs not posted yet.
|
|
5
|
+
* Ties go to the first host listed; a host that does not answer is skipped, all down throws.
|
|
6
|
+
*/
|
|
7
|
+
export declare function leastBusy<H extends ComfyHost<string>>(hosts: readonly H[], p?: {
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
}): Promise<H>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type LmLoraItem } from './loraManagerApi.cjs';
|
|
2
|
+
import type { AbsolutePath } from '../types/index.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* the LOCAL MIRROR of what ComfyUI-Lora-Manager knows about a host's loras
|
|
5
|
+
* (agent/architecture.md item 8). A ComfyUI host only ever tells us a lora's
|
|
6
|
+
* file name; the model's real name, its trigger words and its tags live in the
|
|
7
|
+
* extension. We sweep them once (`comfy-ts loras`) into
|
|
8
|
+
* `.comfy-ts/hosts/<id>/loras.json` and every surface reads the mirror after.
|
|
9
|
+
*/
|
|
10
|
+
export type LoraMirror = {
|
|
11
|
+
hostId: string;
|
|
12
|
+
/** remembered so a later `comfy-ts loras` re-syncs with no flags. NEVER an api key. */
|
|
13
|
+
hostUrl: string;
|
|
14
|
+
fetchedAt: string;
|
|
15
|
+
count: number;
|
|
16
|
+
/** `loraKey` → the RAW lm item */
|
|
17
|
+
loras: Record<string, LmLoraItem>;
|
|
18
|
+
};
|
|
19
|
+
/** pure: the on-disk shape for a sweep. Items without a file_name are dropped (nothing to key them by). */
|
|
20
|
+
export declare function buildLoraMirror(p: {
|
|
21
|
+
hostId: string;
|
|
22
|
+
hostUrl: string;
|
|
23
|
+
fetchedAt: string;
|
|
24
|
+
items: LmLoraItem[];
|
|
25
|
+
}): LoraMirror;
|
|
26
|
+
export declare function writeLoraMirror(mirror: LoraMirror): AbsolutePath;
|
|
27
|
+
/** null = never synced (or unreadable, which is LOGGED) */
|
|
28
|
+
export declare function readLoraMirror(hostId: string): LoraMirror | null;
|
|
29
|
+
/**
|
|
30
|
+
* re-read any mirror whose file changed (or appeared) since we loaded it.
|
|
31
|
+
* `comfy-ts loras` in another terminal is the normal case, and without this a
|
|
32
|
+
* TUI session kept the stale data — or kept knowing NOTHING, for a host whose
|
|
33
|
+
* first sync happened while it was open. One stat per registered host, so this
|
|
34
|
+
* belongs at user-initiated moments (opening the loras overlay), never in a render.
|
|
35
|
+
*/
|
|
36
|
+
export declare function refreshLoraInfoCacheIfChanged(): void;
|
|
37
|
+
/** forget everything loaded, so the next read re-reads from disk (tests, and a hard refresh) */
|
|
38
|
+
export declare function reloadLoraInfoCache(): void;
|
|
39
|
+
/**
|
|
40
|
+
* the lm item for a raw lora name (`styles\x.safetensors`).
|
|
41
|
+
* `hostId` picks the mirror that actually describes this host's file; without
|
|
42
|
+
* it, any host that knows the name answers. null when unsynced/unknown.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getLoraInfo(name: string, hostId?: string): LmLoraItem | null;
|
|
45
|
+
/** civitai trigger words for this lora, in civitai's order */
|
|
46
|
+
export declare function getLoraTriggerWords(name: string, hostId?: string): string[];
|
|
47
|
+
/** the human name (`Aurora Ink Wash`), falling back to the file's own name */
|
|
48
|
+
export declare function getLoraDisplayName(name: string, hostId?: string): string;
|
|
49
|
+
/** what the mirror knows about a lora's trigger words. The extension drops an EMPTY
|
|
50
|
+
* `trainedWords` when it slims the civitai block (model_scanner.py `if trained_words:`), so a
|
|
51
|
+
* block linked to civitai (an `id`) with no words means fetched and empty, while no block at
|
|
52
|
+
* all means civitai was never asked. null = the lora is not in the mirror */
|
|
53
|
+
export type LoraTriggers = {
|
|
54
|
+
state: 'words';
|
|
55
|
+
words: string[];
|
|
56
|
+
} | {
|
|
57
|
+
state: 'none';
|
|
58
|
+
} | {
|
|
59
|
+
state: 'unfetched';
|
|
60
|
+
}
|
|
61
|
+
/** civitai was asked and has no version for this file (a private or local lora) */
|
|
62
|
+
| {
|
|
63
|
+
state: 'not-on-civitai';
|
|
64
|
+
};
|
|
65
|
+
export declare function loraTriggersOf(item: LmLoraItem, p?: {
|
|
66
|
+
civitaiMiss?: boolean;
|
|
67
|
+
}): LoraTriggers;
|
|
68
|
+
export declare function getLoraTriggers(name: string, hostId?: string): LoraTriggers | null;
|
|
69
|
+
/** sha256 → when civitai said it has no version for that file */
|
|
70
|
+
export declare function readCivitaiMisses(hostId: string): Record<string, string>;
|
|
71
|
+
export declare function recordCivitaiMiss(p: {
|
|
72
|
+
hostId: string;
|
|
73
|
+
sha256: string;
|
|
74
|
+
miss: boolean;
|
|
75
|
+
}): void;
|
|
76
|
+
/** when the lora file landed on the host (epoch seconds), null when unsynced/unknown */
|
|
77
|
+
export declare function getLoraAddedAt(name: string, hostId?: string): number | null;
|
|
78
|
+
/** server-relative preview url from the mirror, null when unsynced/unknown */
|
|
79
|
+
export declare function getLoraPreviewUrl(name: string, hostId?: string): string | null;
|
|
80
|
+
/** the lora's NAMES: the file, and the model name a human would call it by */
|
|
81
|
+
/**
|
|
82
|
+
* every lora the mirror knows for a host: its normalized KEY (comparable with `loraKey(option)`,
|
|
83
|
+
* never with a raw enum value, those keep their case, extension and windows separators) and the
|
|
84
|
+
* NAME a ComfyUI graph would load it by, rebuilt from the manager's folder + real filename.
|
|
85
|
+
* `[]` when the host was never synced.
|
|
86
|
+
*/
|
|
87
|
+
export declare function loraMirrorEntries(hostId: string, p?: {
|
|
88
|
+
separator?: '/' | '\\';
|
|
89
|
+
}): {
|
|
90
|
+
key: string;
|
|
91
|
+
serverName: string;
|
|
92
|
+
}[];
|
|
93
|
+
export declare function loraSearchNames(name: string, hostId?: string): string[];
|
|
94
|
+
/** the lora's FREE TEXT: tags, base model, trigger words */
|
|
95
|
+
export declare function loraSearchText(name: string, hostId?: string): string[];
|
|
96
|
+
/**
|
|
97
|
+
* the loras overlay filter: find a lora by its human name, not only by the file
|
|
98
|
+
* name. EVERY whitespace-separated token must be a SUBSTRING of some field — order
|
|
99
|
+
* free, so `aurora ink`, `ink aurora` and `styles wash` all land on the same
|
|
100
|
+
* lora. NOT fuzzyMatch: a subsequence match over phrases this long matches
|
|
101
|
+
* nearly everything. Measured on a real collection, filtering by each lora's
|
|
102
|
+
* own file name: this rule peaks at 8 hits where fuzzyMatch matched a third of
|
|
103
|
+
* every lora present.
|
|
104
|
+
* Fields are matched one by one, never as a concatenated haystack, for the same
|
|
105
|
+
* reason. `tests/lora-corpus.private.test.ts` keeps that measurement runnable.
|
|
106
|
+
*/
|
|
107
|
+
export declare function loraMatchesFilter(name: string, filter: string, hostId?: string): boolean;
|
|
108
|
+
/** the loras a host lists that the local copy of its lora manager list does not know yet:
|
|
109
|
+
* downloaded after the last sync, so they have no name, preview or trigger words here */
|
|
110
|
+
export declare function lorasMissingFromMirror(hostLoras: readonly string[], inMirror: (name: string) => boolean): string[];
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type LmLoraItem } from './loraManagerApi.js';
|
|
2
|
+
import type { AbsolutePath } from '../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* the LOCAL MIRROR of what ComfyUI-Lora-Manager knows about a host's loras
|
|
5
|
+
* (agent/architecture.md item 8). A ComfyUI host only ever tells us a lora's
|
|
6
|
+
* file name; the model's real name, its trigger words and its tags live in the
|
|
7
|
+
* extension. We sweep them once (`comfy-ts loras`) into
|
|
8
|
+
* `.comfy-ts/hosts/<id>/loras.json` and every surface reads the mirror after.
|
|
9
|
+
*/
|
|
10
|
+
export type LoraMirror = {
|
|
11
|
+
hostId: string;
|
|
12
|
+
/** remembered so a later `comfy-ts loras` re-syncs with no flags. NEVER an api key. */
|
|
13
|
+
hostUrl: string;
|
|
14
|
+
fetchedAt: string;
|
|
15
|
+
count: number;
|
|
16
|
+
/** `loraKey` → the RAW lm item */
|
|
17
|
+
loras: Record<string, LmLoraItem>;
|
|
18
|
+
};
|
|
19
|
+
/** pure: the on-disk shape for a sweep. Items without a file_name are dropped (nothing to key them by). */
|
|
20
|
+
export declare function buildLoraMirror(p: {
|
|
21
|
+
hostId: string;
|
|
22
|
+
hostUrl: string;
|
|
23
|
+
fetchedAt: string;
|
|
24
|
+
items: LmLoraItem[];
|
|
25
|
+
}): LoraMirror;
|
|
26
|
+
export declare function writeLoraMirror(mirror: LoraMirror): AbsolutePath;
|
|
27
|
+
/** null = never synced (or unreadable, which is LOGGED) */
|
|
28
|
+
export declare function readLoraMirror(hostId: string): LoraMirror | null;
|
|
29
|
+
/**
|
|
30
|
+
* re-read any mirror whose file changed (or appeared) since we loaded it.
|
|
31
|
+
* `comfy-ts loras` in another terminal is the normal case, and without this a
|
|
32
|
+
* TUI session kept the stale data — or kept knowing NOTHING, for a host whose
|
|
33
|
+
* first sync happened while it was open. One stat per registered host, so this
|
|
34
|
+
* belongs at user-initiated moments (opening the loras overlay), never in a render.
|
|
35
|
+
*/
|
|
36
|
+
export declare function refreshLoraInfoCacheIfChanged(): void;
|
|
37
|
+
/** forget everything loaded, so the next read re-reads from disk (tests, and a hard refresh) */
|
|
38
|
+
export declare function reloadLoraInfoCache(): void;
|
|
39
|
+
/**
|
|
40
|
+
* the lm item for a raw lora name (`styles\x.safetensors`).
|
|
41
|
+
* `hostId` picks the mirror that actually describes this host's file; without
|
|
42
|
+
* it, any host that knows the name answers. null when unsynced/unknown.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getLoraInfo(name: string, hostId?: string): LmLoraItem | null;
|
|
45
|
+
/** civitai trigger words for this lora, in civitai's order */
|
|
46
|
+
export declare function getLoraTriggerWords(name: string, hostId?: string): string[];
|
|
47
|
+
/** the human name (`Aurora Ink Wash`), falling back to the file's own name */
|
|
48
|
+
export declare function getLoraDisplayName(name: string, hostId?: string): string;
|
|
49
|
+
/** what the mirror knows about a lora's trigger words. The extension drops an EMPTY
|
|
50
|
+
* `trainedWords` when it slims the civitai block (model_scanner.py `if trained_words:`), so a
|
|
51
|
+
* block linked to civitai (an `id`) with no words means fetched and empty, while no block at
|
|
52
|
+
* all means civitai was never asked. null = the lora is not in the mirror */
|
|
53
|
+
export type LoraTriggers = {
|
|
54
|
+
state: 'words';
|
|
55
|
+
words: string[];
|
|
56
|
+
} | {
|
|
57
|
+
state: 'none';
|
|
58
|
+
} | {
|
|
59
|
+
state: 'unfetched';
|
|
60
|
+
}
|
|
61
|
+
/** civitai was asked and has no version for this file (a private or local lora) */
|
|
62
|
+
| {
|
|
63
|
+
state: 'not-on-civitai';
|
|
64
|
+
};
|
|
65
|
+
export declare function loraTriggersOf(item: LmLoraItem, p?: {
|
|
66
|
+
civitaiMiss?: boolean;
|
|
67
|
+
}): LoraTriggers;
|
|
68
|
+
export declare function getLoraTriggers(name: string, hostId?: string): LoraTriggers | null;
|
|
69
|
+
/** sha256 → when civitai said it has no version for that file */
|
|
70
|
+
export declare function readCivitaiMisses(hostId: string): Record<string, string>;
|
|
71
|
+
export declare function recordCivitaiMiss(p: {
|
|
72
|
+
hostId: string;
|
|
73
|
+
sha256: string;
|
|
74
|
+
miss: boolean;
|
|
75
|
+
}): void;
|
|
76
|
+
/** when the lora file landed on the host (epoch seconds), null when unsynced/unknown */
|
|
77
|
+
export declare function getLoraAddedAt(name: string, hostId?: string): number | null;
|
|
78
|
+
/** server-relative preview url from the mirror, null when unsynced/unknown */
|
|
79
|
+
export declare function getLoraPreviewUrl(name: string, hostId?: string): string | null;
|
|
80
|
+
/** the lora's NAMES: the file, and the model name a human would call it by */
|
|
81
|
+
/**
|
|
82
|
+
* every lora the mirror knows for a host: its normalized KEY (comparable with `loraKey(option)`,
|
|
83
|
+
* never with a raw enum value, those keep their case, extension and windows separators) and the
|
|
84
|
+
* NAME a ComfyUI graph would load it by, rebuilt from the manager's folder + real filename.
|
|
85
|
+
* `[]` when the host was never synced.
|
|
86
|
+
*/
|
|
87
|
+
export declare function loraMirrorEntries(hostId: string, p?: {
|
|
88
|
+
separator?: '/' | '\\';
|
|
89
|
+
}): {
|
|
90
|
+
key: string;
|
|
91
|
+
serverName: string;
|
|
92
|
+
}[];
|
|
93
|
+
export declare function loraSearchNames(name: string, hostId?: string): string[];
|
|
94
|
+
/** the lora's FREE TEXT: tags, base model, trigger words */
|
|
95
|
+
export declare function loraSearchText(name: string, hostId?: string): string[];
|
|
96
|
+
/**
|
|
97
|
+
* the loras overlay filter: find a lora by its human name, not only by the file
|
|
98
|
+
* name. EVERY whitespace-separated token must be a SUBSTRING of some field — order
|
|
99
|
+
* free, so `aurora ink`, `ink aurora` and `styles wash` all land on the same
|
|
100
|
+
* lora. NOT fuzzyMatch: a subsequence match over phrases this long matches
|
|
101
|
+
* nearly everything. Measured on a real collection, filtering by each lora's
|
|
102
|
+
* own file name: this rule peaks at 8 hits where fuzzyMatch matched a third of
|
|
103
|
+
* every lora present.
|
|
104
|
+
* Fields are matched one by one, never as a concatenated haystack, for the same
|
|
105
|
+
* reason. `tests/lora-corpus.private.test.ts` keeps that measurement runnable.
|
|
106
|
+
*/
|
|
107
|
+
export declare function loraMatchesFilter(name: string, filter: string, hostId?: string): boolean;
|
|
108
|
+
/** the loras a host lists that the local copy of its lora manager list does not know yet:
|
|
109
|
+
* downloaded after the last sync, so they have no name, preview or trigger words here */
|
|
110
|
+
export declare function lorasMissingFromMirror(hostLoras: readonly string[], inMirror: (name: string) => boolean): string[];
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ComfyHost } from './ComfyHost.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* client for the OPTIONAL ComfyUI-Lora-Manager extension.
|
|
4
|
+
* absent extension = normal condition: callers get null/empty and degrade.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* one lora exactly as lora-manager sent it. RAW on purpose (agent/architecture
|
|
8
|
+
* item 8): the mirror on disk keeps every field, including the ones we do not
|
|
9
|
+
* read yet, so adding `sha256` or `civitai.modelId` to a surface later is an
|
|
10
|
+
* accessor, not a re-sync. Reading goes through the checked lm* helpers below.
|
|
11
|
+
*/
|
|
12
|
+
export type LmLoraItem = Record<string, unknown>;
|
|
13
|
+
export declare function lmFileName(item: LmLoraItem): string | null;
|
|
14
|
+
export declare function lmFolder(item: LmLoraItem): string;
|
|
15
|
+
export declare function lmModelName(item: LmLoraItem): string | null;
|
|
16
|
+
export declare function lmBaseModel(item: LmLoraItem): string | null;
|
|
17
|
+
export declare function lmPreviewUrl(item: LmLoraItem): string | null;
|
|
18
|
+
/** the file's size in bytes, when the extension reports it */
|
|
19
|
+
/** the file's content hash: what the extension keys its example images by */
|
|
20
|
+
export declare function lmSha256(item: LmLoraItem): string | null;
|
|
21
|
+
/** when the file landed on the host (epoch seconds): the lora manager's own "date added" sort reads it */
|
|
22
|
+
export declare function lmModified(item: LmLoraItem): number | null;
|
|
23
|
+
export declare function lmFileSize(item: LmLoraItem): number | null;
|
|
24
|
+
/** the note YOU wrote in the lora manager, empty when there is none */
|
|
25
|
+
export declare function lmNotes(item: LmLoraItem): string;
|
|
26
|
+
/** the civitai block: what links a local file back to the page it came from */
|
|
27
|
+
export declare function lmCivitai(item: LmLoraItem): {
|
|
28
|
+
modelId: number | null;
|
|
29
|
+
name: string | null;
|
|
30
|
+
} | null;
|
|
31
|
+
export declare function lmTags(item: LmLoraItem): string[];
|
|
32
|
+
/** the trigger words: civitai's `trainedWords`, absent for a lora nobody published */
|
|
33
|
+
export declare function lmTrainedWords(item: LmLoraItem): string[];
|
|
34
|
+
/** lm's own absolute path for the file, as it exists on the HOST's disk */
|
|
35
|
+
export declare function lmFilePath(item: LmLoraItem): string | null;
|
|
36
|
+
/**
|
|
37
|
+
* the ONE key space where a host's object_info spelling of a lora meets
|
|
38
|
+
* lora-manager's: lowercase, forward slashes, no model extension.
|
|
39
|
+
* `styles\Aurora.safetensors` and lm's folder `styles` + file_name `aurora`
|
|
40
|
+
* both become `styles/aurora`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function loraKey(name: string): string;
|
|
43
|
+
/** the file's own name, windows separators included (`styles\x.safetensors` → `x.safetensors`) */
|
|
44
|
+
export declare function loraBasename(name: string): string;
|
|
45
|
+
/** the mirror key for an lm item: its folder/file_name pair, normalized */
|
|
46
|
+
export declare function lmItemKey(item: LmLoraItem): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* the outcome of a sweep, DISCRIMINATED. A bare `null` for "no loras" conflated
|
|
49
|
+
* three very different situations, and callers then told the user the wrong one:
|
|
50
|
+
* a host that is merely DOWN was reported as "extension not detected", and a
|
|
51
|
+
* sweep cut short mid-collection was indistinguishable from a complete one, so
|
|
52
|
+
* a partial mirror could overwrite a good one and report success.
|
|
53
|
+
*/
|
|
54
|
+
export type LoraSweep = {
|
|
55
|
+
status: 'ok';
|
|
56
|
+
items: LmLoraItem[];
|
|
57
|
+
}
|
|
58
|
+
/** the extension answered, then stopped answering: `items` is INCOMPLETE, never write it over a good mirror */
|
|
59
|
+
| {
|
|
60
|
+
status: 'partial';
|
|
61
|
+
items: LmLoraItem[];
|
|
62
|
+
reason: string;
|
|
63
|
+
}
|
|
64
|
+
/** no ComfyUI-Lora-Manager on this host (404 on the first page) */
|
|
65
|
+
| {
|
|
66
|
+
status: 'absent';
|
|
67
|
+
}
|
|
68
|
+
/** the host itself could not be reached (down, refused, auth) */
|
|
69
|
+
| {
|
|
70
|
+
status: 'unreachable';
|
|
71
|
+
reason: string;
|
|
72
|
+
};
|
|
73
|
+
/** asks the extension to (re)fetch civitai metadata for ONE lora file, trigger words included.
|
|
74
|
+
* The reply says why when civitai has nothing for it (a private or deleted model) */
|
|
75
|
+
export declare function fetchLoraCivitai(host: ComfyHost, filePath: string): Promise<{
|
|
76
|
+
ok: true;
|
|
77
|
+
} | {
|
|
78
|
+
ok: false;
|
|
79
|
+
reason: string;
|
|
80
|
+
}>;
|
|
81
|
+
/** civitai's model description for ONE lora, as PLAIN TEXT. The extension answers html, and
|
|
82
|
+
* html from a third party is never rendered: tags are stripped here, at the seam.
|
|
83
|
+
* null = the extension has no description for it (or does not expose the route) */
|
|
84
|
+
export declare function fetchLoraDescription(host: ComfyHost, filePath: string): Promise<string | null>;
|
|
85
|
+
/** the example images lora-manager keeps for a lora. `reason` explains an empty list rather
|
|
86
|
+
* than pretending the lora has none, "no example images path configured" is a SETTING */
|
|
87
|
+
export declare function fetchLoraExampleImages(host: ComfyHost, sha256: string): Promise<{
|
|
88
|
+
files: string[];
|
|
89
|
+
reason: string | null;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* every lora lora-manager knows, RAW, in one paged sweep.
|
|
93
|
+
* page_size asks for 500; the server caps it at 100, so the loop follows `total`.
|
|
94
|
+
*/
|
|
95
|
+
export declare function fetchLoraList(host: ComfyHost): Promise<LoraSweep>;
|
|
96
|
+
/** `loraKey` → server-relative preview_url */
|
|
97
|
+
export declare function loraPreviewMapFrom(items: LmLoraItem[]): Map<string, string>;
|
|
98
|
+
/** the bytes look like an image (magic numbers) — guards against ComfyUI's SPA index.html fallback */
|
|
99
|
+
export declare function looksLikeImage(bytes: Uint8Array): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* fetch a preview image's bytes from its server-relative preview_url.
|
|
102
|
+
* cached on success at `.comfy-ts/cache/lora-previews/<sha1(url)>`. Returns null
|
|
103
|
+
* when the file is missing: lora-manager SPA-fallbacks to index.html (HTML), so
|
|
104
|
+
* an html or video content-type OR non-image magic bytes => no preview, not a crash.
|
|
105
|
+
*/
|
|
106
|
+
export declare function fetchLoraPreviewBytes(host: ComfyHost, previewUrl: string): Promise<Uint8Array | null>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ComfyHost } from './ComfyHost.js';
|
|
2
|
+
/**
|
|
3
|
+
* client for the OPTIONAL ComfyUI-Lora-Manager extension.
|
|
4
|
+
* absent extension = normal condition: callers get null/empty and degrade.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* one lora exactly as lora-manager sent it. RAW on purpose (agent/architecture
|
|
8
|
+
* item 8): the mirror on disk keeps every field, including the ones we do not
|
|
9
|
+
* read yet, so adding `sha256` or `civitai.modelId` to a surface later is an
|
|
10
|
+
* accessor, not a re-sync. Reading goes through the checked lm* helpers below.
|
|
11
|
+
*/
|
|
12
|
+
export type LmLoraItem = Record<string, unknown>;
|
|
13
|
+
export declare function lmFileName(item: LmLoraItem): string | null;
|
|
14
|
+
export declare function lmFolder(item: LmLoraItem): string;
|
|
15
|
+
export declare function lmModelName(item: LmLoraItem): string | null;
|
|
16
|
+
export declare function lmBaseModel(item: LmLoraItem): string | null;
|
|
17
|
+
export declare function lmPreviewUrl(item: LmLoraItem): string | null;
|
|
18
|
+
/** the file's size in bytes, when the extension reports it */
|
|
19
|
+
/** the file's content hash: what the extension keys its example images by */
|
|
20
|
+
export declare function lmSha256(item: LmLoraItem): string | null;
|
|
21
|
+
/** when the file landed on the host (epoch seconds): the lora manager's own "date added" sort reads it */
|
|
22
|
+
export declare function lmModified(item: LmLoraItem): number | null;
|
|
23
|
+
export declare function lmFileSize(item: LmLoraItem): number | null;
|
|
24
|
+
/** the note YOU wrote in the lora manager, empty when there is none */
|
|
25
|
+
export declare function lmNotes(item: LmLoraItem): string;
|
|
26
|
+
/** the civitai block: what links a local file back to the page it came from */
|
|
27
|
+
export declare function lmCivitai(item: LmLoraItem): {
|
|
28
|
+
modelId: number | null;
|
|
29
|
+
name: string | null;
|
|
30
|
+
} | null;
|
|
31
|
+
export declare function lmTags(item: LmLoraItem): string[];
|
|
32
|
+
/** the trigger words: civitai's `trainedWords`, absent for a lora nobody published */
|
|
33
|
+
export declare function lmTrainedWords(item: LmLoraItem): string[];
|
|
34
|
+
/** lm's own absolute path for the file, as it exists on the HOST's disk */
|
|
35
|
+
export declare function lmFilePath(item: LmLoraItem): string | null;
|
|
36
|
+
/**
|
|
37
|
+
* the ONE key space where a host's object_info spelling of a lora meets
|
|
38
|
+
* lora-manager's: lowercase, forward slashes, no model extension.
|
|
39
|
+
* `styles\Aurora.safetensors` and lm's folder `styles` + file_name `aurora`
|
|
40
|
+
* both become `styles/aurora`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function loraKey(name: string): string;
|
|
43
|
+
/** the file's own name, windows separators included (`styles\x.safetensors` → `x.safetensors`) */
|
|
44
|
+
export declare function loraBasename(name: string): string;
|
|
45
|
+
/** the mirror key for an lm item: its folder/file_name pair, normalized */
|
|
46
|
+
export declare function lmItemKey(item: LmLoraItem): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* the outcome of a sweep, DISCRIMINATED. A bare `null` for "no loras" conflated
|
|
49
|
+
* three very different situations, and callers then told the user the wrong one:
|
|
50
|
+
* a host that is merely DOWN was reported as "extension not detected", and a
|
|
51
|
+
* sweep cut short mid-collection was indistinguishable from a complete one, so
|
|
52
|
+
* a partial mirror could overwrite a good one and report success.
|
|
53
|
+
*/
|
|
54
|
+
export type LoraSweep = {
|
|
55
|
+
status: 'ok';
|
|
56
|
+
items: LmLoraItem[];
|
|
57
|
+
}
|
|
58
|
+
/** the extension answered, then stopped answering: `items` is INCOMPLETE, never write it over a good mirror */
|
|
59
|
+
| {
|
|
60
|
+
status: 'partial';
|
|
61
|
+
items: LmLoraItem[];
|
|
62
|
+
reason: string;
|
|
63
|
+
}
|
|
64
|
+
/** no ComfyUI-Lora-Manager on this host (404 on the first page) */
|
|
65
|
+
| {
|
|
66
|
+
status: 'absent';
|
|
67
|
+
}
|
|
68
|
+
/** the host itself could not be reached (down, refused, auth) */
|
|
69
|
+
| {
|
|
70
|
+
status: 'unreachable';
|
|
71
|
+
reason: string;
|
|
72
|
+
};
|
|
73
|
+
/** asks the extension to (re)fetch civitai metadata for ONE lora file, trigger words included.
|
|
74
|
+
* The reply says why when civitai has nothing for it (a private or deleted model) */
|
|
75
|
+
export declare function fetchLoraCivitai(host: ComfyHost, filePath: string): Promise<{
|
|
76
|
+
ok: true;
|
|
77
|
+
} | {
|
|
78
|
+
ok: false;
|
|
79
|
+
reason: string;
|
|
80
|
+
}>;
|
|
81
|
+
/** civitai's model description for ONE lora, as PLAIN TEXT. The extension answers html, and
|
|
82
|
+
* html from a third party is never rendered: tags are stripped here, at the seam.
|
|
83
|
+
* null = the extension has no description for it (or does not expose the route) */
|
|
84
|
+
export declare function fetchLoraDescription(host: ComfyHost, filePath: string): Promise<string | null>;
|
|
85
|
+
/** the example images lora-manager keeps for a lora. `reason` explains an empty list rather
|
|
86
|
+
* than pretending the lora has none, "no example images path configured" is a SETTING */
|
|
87
|
+
export declare function fetchLoraExampleImages(host: ComfyHost, sha256: string): Promise<{
|
|
88
|
+
files: string[];
|
|
89
|
+
reason: string | null;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* every lora lora-manager knows, RAW, in one paged sweep.
|
|
93
|
+
* page_size asks for 500; the server caps it at 100, so the loop follows `total`.
|
|
94
|
+
*/
|
|
95
|
+
export declare function fetchLoraList(host: ComfyHost): Promise<LoraSweep>;
|
|
96
|
+
/** `loraKey` → server-relative preview_url */
|
|
97
|
+
export declare function loraPreviewMapFrom(items: LmLoraItem[]): Map<string, string>;
|
|
98
|
+
/** the bytes look like an image (magic numbers) — guards against ComfyUI's SPA index.html fallback */
|
|
99
|
+
export declare function looksLikeImage(bytes: Uint8Array): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* fetch a preview image's bytes from its server-relative preview_url.
|
|
102
|
+
* cached on success at `.comfy-ts/cache/lora-previews/<sha1(url)>`. Returns null
|
|
103
|
+
* when the file is missing: lora-manager SPA-fallbacks to index.html (HTML), so
|
|
104
|
+
* an html or video content-type OR non-image magic bytes => no preview, not a crash.
|
|
105
|
+
*/
|
|
106
|
+
export declare function fetchLoraPreviewBytes(host: ComfyHost, previewUrl: string): Promise<Uint8Array | null>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type PreviewMethod = 'none' | 'auto' | 'latent2rgb' | 'taesd';
|
|
2
|
+
/** the preview method a host was launched with, from its /system_stats payload. `'none'` when
|
|
3
|
+
* the flag is absent (ComfyUI's default), null when the payload carries no argv to read (a cloud
|
|
4
|
+
* host) or the flag holds a value this parser does not know */
|
|
5
|
+
export declare function previewMethodFromSystemStats(stats: unknown): PreviewMethod | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type PreviewMethod = 'none' | 'auto' | 'latent2rgb' | 'taesd';
|
|
2
|
+
/** the preview method a host was launched with, from its /system_stats payload. `'none'` when
|
|
3
|
+
* the flag is absent (ComfyUI's default), null when the payload carries no argv to read (a cloud
|
|
4
|
+
* host) or the flag holds a value this parser does not know */
|
|
5
|
+
export declare function previewMethodFromSystemStats(stats: unknown): PreviewMethod | null;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* what changed on a host since a schema was loaded: node types, and the model files each loader
|
|
3
|
+
* lists. ComfyUI exposes no boot time, so staleness is decided by CONTENT: a restart that changed
|
|
4
|
+
* nothing stays quiet, a new lora shows even when nobody knows when the box rebooted.
|
|
5
|
+
* A light check asks only the loaders (`/object_info/<node>`, a few KB); a full one compares every
|
|
6
|
+
* node type (`/object_info`, megabytes).
|
|
7
|
+
*/
|
|
8
|
+
/** the loader inputs whose combo IS a model folder listing */
|
|
9
|
+
export declare const MODEL_LISTS: readonly [{
|
|
10
|
+
readonly noun: 'lora';
|
|
11
|
+
readonly node: 'LoraLoader';
|
|
12
|
+
readonly input: 'lora_name';
|
|
13
|
+
}, {
|
|
14
|
+
readonly noun: 'checkpoint';
|
|
15
|
+
readonly node: 'CheckpointLoaderSimple';
|
|
16
|
+
readonly input: 'ckpt_name';
|
|
17
|
+
}, {
|
|
18
|
+
readonly noun: 'unet';
|
|
19
|
+
readonly node: 'UNETLoader';
|
|
20
|
+
readonly input: 'unet_name';
|
|
21
|
+
}, {
|
|
22
|
+
readonly noun: 'text encoder';
|
|
23
|
+
readonly node: 'CLIPLoader';
|
|
24
|
+
readonly input: 'clip_name';
|
|
25
|
+
}, {
|
|
26
|
+
readonly noun: 'vae';
|
|
27
|
+
readonly node: 'VAELoader';
|
|
28
|
+
readonly input: 'vae_name';
|
|
29
|
+
}];
|
|
30
|
+
type Spec = Record<string, unknown>;
|
|
31
|
+
type Delta = {
|
|
32
|
+
added: string[];
|
|
33
|
+
removed: string[];
|
|
34
|
+
};
|
|
35
|
+
export type SchemaDrift = {
|
|
36
|
+
/** null on a light check: node types are only compared by a full one */
|
|
37
|
+
nodes: Delta | null;
|
|
38
|
+
models: ({
|
|
39
|
+
noun: string;
|
|
40
|
+
} & Delta)[];
|
|
41
|
+
};
|
|
42
|
+
/** a combo's options in both object_info spellings: `[[...options]]` and `['COMBO', { options }]` */
|
|
43
|
+
export declare function comboOptions(spec: Spec, node: string, input: string): string[] | null;
|
|
44
|
+
/** `live` may be PARTIAL (a light check holds only the loaders): a list is compared only where both
|
|
45
|
+
* sides have the loader, and node types only when `full` */
|
|
46
|
+
export declare function diffSchemas(p: {
|
|
47
|
+
loaded: Spec;
|
|
48
|
+
live: Spec;
|
|
49
|
+
full: boolean;
|
|
50
|
+
}): SchemaDrift;
|
|
51
|
+
export declare function driftChanged(d: SchemaDrift): boolean;
|
|
52
|
+
/** `+5 loras, -1 unet, +4 node types`, '' when nothing changed */
|
|
53
|
+
export declare function summarizeDrift(d: SchemaDrift): string;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* what changed on a host since a schema was loaded: node types, and the model files each loader
|
|
3
|
+
* lists. ComfyUI exposes no boot time, so staleness is decided by CONTENT: a restart that changed
|
|
4
|
+
* nothing stays quiet, a new lora shows even when nobody knows when the box rebooted.
|
|
5
|
+
* A light check asks only the loaders (`/object_info/<node>`, a few KB); a full one compares every
|
|
6
|
+
* node type (`/object_info`, megabytes).
|
|
7
|
+
*/
|
|
8
|
+
/** the loader inputs whose combo IS a model folder listing */
|
|
9
|
+
export declare const MODEL_LISTS: readonly [{
|
|
10
|
+
readonly noun: 'lora';
|
|
11
|
+
readonly node: 'LoraLoader';
|
|
12
|
+
readonly input: 'lora_name';
|
|
13
|
+
}, {
|
|
14
|
+
readonly noun: 'checkpoint';
|
|
15
|
+
readonly node: 'CheckpointLoaderSimple';
|
|
16
|
+
readonly input: 'ckpt_name';
|
|
17
|
+
}, {
|
|
18
|
+
readonly noun: 'unet';
|
|
19
|
+
readonly node: 'UNETLoader';
|
|
20
|
+
readonly input: 'unet_name';
|
|
21
|
+
}, {
|
|
22
|
+
readonly noun: 'text encoder';
|
|
23
|
+
readonly node: 'CLIPLoader';
|
|
24
|
+
readonly input: 'clip_name';
|
|
25
|
+
}, {
|
|
26
|
+
readonly noun: 'vae';
|
|
27
|
+
readonly node: 'VAELoader';
|
|
28
|
+
readonly input: 'vae_name';
|
|
29
|
+
}];
|
|
30
|
+
type Spec = Record<string, unknown>;
|
|
31
|
+
type Delta = {
|
|
32
|
+
added: string[];
|
|
33
|
+
removed: string[];
|
|
34
|
+
};
|
|
35
|
+
export type SchemaDrift = {
|
|
36
|
+
/** null on a light check: node types are only compared by a full one */
|
|
37
|
+
nodes: Delta | null;
|
|
38
|
+
models: ({
|
|
39
|
+
noun: string;
|
|
40
|
+
} & Delta)[];
|
|
41
|
+
};
|
|
42
|
+
/** a combo's options in both object_info spellings: `[[...options]]` and `['COMBO', { options }]` */
|
|
43
|
+
export declare function comboOptions(spec: Spec, node: string, input: string): string[] | null;
|
|
44
|
+
/** `live` may be PARTIAL (a light check holds only the loaders): a list is compared only where both
|
|
45
|
+
* sides have the loader, and node types only when `full` */
|
|
46
|
+
export declare function diffSchemas(p: {
|
|
47
|
+
loaded: Spec;
|
|
48
|
+
live: Spec;
|
|
49
|
+
full: boolean;
|
|
50
|
+
}): SchemaDrift;
|
|
51
|
+
export declare function driftChanged(d: SchemaDrift): boolean;
|
|
52
|
+
/** `+5 loras, -1 unet, +4 node types`, '' when nothing changed */
|
|
53
|
+
export declare function summarizeDrift(d: SchemaDrift): string;
|
|
54
|
+
export {};
|