comfy-ts 2.23.0 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/{ServeApp-DolRCMHj.js → ServeApp-fsHtW5zG.js} +3 -3
  2. package/dist/{ServeApp-DolRCMHj.js.map → ServeApp-fsHtW5zG.js.map} +1 -1
  3. package/dist/cli.js +5 -5
  4. package/dist/{exampleAssets-Duneoq6r.js → exampleAssets-DZynSkZm.js} +79 -15
  5. package/dist/exampleAssets-DZynSkZm.js.map +1 -0
  6. package/dist/{findDefinedWorkflow-DjoJA8y7.js → findDefinedWorkflow-qyqFea7q.js} +2 -2
  7. package/dist/{findDefinedWorkflow-DjoJA8y7.js.map → findDefinedWorkflow-qyqFea7q.js.map} +1 -1
  8. package/dist/index.cjs +80 -14
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +53 -19
  11. package/dist/index.d.ts +53 -19
  12. package/dist/index.js +80 -15
  13. package/dist/index.js.map +1 -1
  14. package/dist/{run-run-Cr0L9lCK.js → run-run-Cn2JzKlE.js} +5 -5
  15. package/dist/{run-run-Cr0L9lCK.js.map → run-run-Cn2JzKlE.js.map} +1 -1
  16. package/dist/{run-serve---qA7o_m.js → run-serve-BhGegaCI.js} +4 -4
  17. package/dist/{run-serve---qA7o_m.js.map → run-serve-BhGegaCI.js.map} +1 -1
  18. package/dist/{run-tui-DxXiWo5J.js → run-tui-CrM4ijkH.js} +4 -4
  19. package/dist/{run-tui-DxXiWo5J.js.map → run-tui-CrM4ijkH.js.map} +1 -1
  20. package/dist/{schemaDrift-BTxdABHi.js → schemaDrift-BGYJZGMD.js} +3 -2
  21. package/dist/{schemaDrift-BTxdABHi.js.map → schemaDrift-BGYJZGMD.js.map} +1 -1
  22. package/dist/web.d.ts +53 -19
  23. package/dist/web.js +80 -15
  24. package/dist/web.js.map +1 -1
  25. package/examples/README.md +1 -0
  26. package/examples/depth-explorer/models.ts +6 -56
  27. package/examples/depth-explorer/serve.ts +12 -133
  28. package/examples/depth-explorer/web/App.tsx +20 -91
  29. package/examples/depth-explorer/web/index.html +1 -0
  30. package/examples/depth-explorer/web/state.ts +26 -109
  31. package/examples/depth-explorer/web/styles.css +1 -286
  32. package/examples/explorer-kit/catalog.ts +80 -0
  33. package/examples/explorer-kit/server.ts +167 -0
  34. package/examples/explorer-kit/web/base.css +289 -0
  35. package/examples/explorer-kit/web/runs.ts +160 -0
  36. package/examples/explorer-kit/web/ui.tsx +125 -0
  37. package/examples/rvion/17-relight.cflow.ts +2 -1
  38. package/examples/rvion/19-flythrough.cflow.ts +312 -0
  39. package/examples/rvion/20-grow-splat.cflow.ts +88 -0
  40. package/examples/rvion/21-photo-to-model.cflow.ts +191 -0
  41. package/examples/rvion/flythroughChain.ts +171 -0
  42. package/examples/rvion/flythroughColmap.ts +157 -0
  43. package/examples/rvion/flythroughFuse.ts +199 -0
  44. package/examples/rvion/flythroughGuide.ts +300 -0
  45. package/examples/rvion/flythroughPalette.ts +310 -0
  46. package/examples/rvion/flythroughPath.ts +177 -0
  47. package/examples/rvion/flythroughSplat.ts +73 -0
  48. package/examples/rvion/grow-splat/align.ts +114 -0
  49. package/examples/rvion/grow-splat/grow.ts +198 -0
  50. package/examples/rvion/grow-splat/ply.ts +166 -0
  51. package/examples/rvion/grow-splat/raster.ts +207 -0
  52. package/examples/rvion/grow-splat/sharp.ts +45 -0
  53. package/examples/rvion/splatDataset.ts +80 -0
  54. package/examples/rvion/splatEval.ts +380 -0
  55. package/examples/upscale-explorer/models.ts +341 -0
  56. package/examples/upscale-explorer/serve.ts +19 -0
  57. package/examples/upscale-explorer/web/App.tsx +250 -0
  58. package/examples/upscale-explorer/web/compare.tsx +285 -0
  59. package/examples/upscale-explorer/web/index.html +15 -0
  60. package/examples/upscale-explorer/web/main.tsx +12 -0
  61. package/examples/upscale-explorer/web/state.ts +279 -0
  62. package/examples/upscale-explorer/web/styles.css +241 -0
  63. package/examples/upscale-explorer/web/tsconfig.json +16 -0
  64. package/examples/upscale-explorer/web/viewport.tsx +130 -0
  65. package/examples/world-explorer/web/main.tsx +2 -2
  66. package/package.json +4 -3
  67. package/src/coreExports.ts +5 -0
  68. package/src/host/ComfyHost.ts +6 -0
  69. package/src/runner/ComfyExecution.ts +22 -5
  70. package/src/runner/ComfyWorkflow.ts +22 -0
  71. package/src/runner/ComfyWsApi.ts +1 -1
  72. package/src/runner/comfyOrgApiKey.ts +44 -0
  73. package/src/sdk-generator/ComfyUIObjectInfoTypes.ts +2 -0
  74. package/src/state.ts +2 -0
  75. package/src/vars/DefinedWorkflow.ts +1 -0
  76. package/dist/exampleAssets-Duneoq6r.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -12234,6 +12234,7 @@ declare const types$1: import("arktype").Module<{
12234
12234
  client_id: string;
12235
12235
  extra_data: {
12236
12236
  extra_pnginfo: unknown;
12237
+ api_key_comfy_org?: string | undefined;
12237
12238
  };
12238
12239
  prompt: unknown;
12239
12240
  };
@@ -12262,16 +12263,9 @@ declare const types$1: import("arktype").Module<{
12262
12263
  };
12263
12264
  PromptID: PromptID;
12264
12265
  PromptRelated_WsMsg: {
12265
- type: "progress";
12266
- data: {
12267
- value: number;
12268
- max: number;
12269
- };
12270
- } | {
12271
- type: "executing";
12266
+ type: "execution_start";
12272
12267
  data: {
12273
12268
  prompt_id: PromptID;
12274
- node?: ComfyNodeId | null | undefined;
12275
12269
  };
12276
12270
  } | {
12277
12271
  type: "execution_cached";
@@ -12280,9 +12274,16 @@ declare const types$1: import("arktype").Module<{
12280
12274
  prompt_id: PromptID;
12281
12275
  };
12282
12276
  } | {
12283
- type: "execution_start";
12277
+ type: "executing";
12284
12278
  data: {
12285
12279
  prompt_id: PromptID;
12280
+ node?: ComfyNodeId | null | undefined;
12281
+ };
12282
+ } | {
12283
+ type: "progress";
12284
+ data: {
12285
+ value: number;
12286
+ max: number;
12286
12287
  };
12287
12288
  } | {
12288
12289
  type: "progress_state";
@@ -12366,16 +12367,9 @@ declare const types$1: import("arktype").Module<{
12366
12367
  data: string;
12367
12368
  };
12368
12369
  WsMsg: {
12369
- type: "progress";
12370
- data: {
12371
- value: number;
12372
- max: number;
12373
- };
12374
- } | {
12375
- type: "executing";
12370
+ type: "execution_start";
12376
12371
  data: {
12377
12372
  prompt_id: PromptID;
12378
- node?: ComfyNodeId | null | undefined;
12379
12373
  };
12380
12374
  } | {
12381
12375
  type: "execution_cached";
@@ -12384,9 +12378,16 @@ declare const types$1: import("arktype").Module<{
12384
12378
  prompt_id: PromptID;
12385
12379
  };
12386
12380
  } | {
12387
- type: "execution_start";
12381
+ type: "executing";
12388
12382
  data: {
12389
12383
  prompt_id: PromptID;
12384
+ node?: ComfyNodeId | null | undefined;
12385
+ };
12386
+ } | {
12387
+ type: "progress";
12388
+ data: {
12389
+ value: number;
12390
+ max: number;
12390
12391
  };
12391
12392
  } | {
12392
12393
  type: "progress_state";
@@ -12995,6 +12996,7 @@ declare const types: import("arktype").Module<{
12995
12996
  output_tooltips?: (string | null)[] | undefined;
12996
12997
  deprecated?: boolean | undefined;
12997
12998
  experimental?: boolean | undefined;
12999
+ api_node?: boolean | undefined;
12998
13000
  };
12999
13001
  ComfySchemaJSON: {
13000
13002
  [x: string]: {
@@ -13103,6 +13105,7 @@ declare const types: import("arktype").Module<{
13103
13105
  output_tooltips?: (string | null)[] | undefined;
13104
13106
  deprecated?: boolean | undefined;
13105
13107
  experimental?: boolean | undefined;
13108
+ api_node?: boolean | undefined;
13106
13109
  };
13107
13110
  };
13108
13111
  }>;
@@ -13285,6 +13288,8 @@ type ComfyAudioOutput = {
13285
13288
  mime: string;
13286
13289
  bytes: Uint8Array;
13287
13290
  absPath: AbsolutePath | null;
13291
+ /** the `tag` / `tags` of the output node's metadata, as on images */
13292
+ tags: string[];
13288
13293
  };
13289
13294
  /** one video file an output node published (SaveVideo, SaveWEBM, VHS_VideoCombine), same
13290
13295
  * shape and same retrieval as an audio file */
@@ -13446,6 +13451,10 @@ declare class ComfyExecution {
13446
13451
  private encodeAndWrite;
13447
13452
  /** accumulate an output on the prompt; tags from node metadata ride along */
13448
13453
  private pushImage;
13454
+ /** the tags an output node was built with (`{ tag }` / `{ tags }` metadata) */
13455
+ private tagsOf;
13456
+ /** the sent graph saves through SaveImageWebsocket: those outputs exist only as ws frames */
13457
+ private get sendsWsFrames();
13449
13458
  /** true while the currently executing node is a SaveImageWebsocket in the
13450
13459
  * SENT snapshot (the ephemeral rewrite only touches the snapshot, so the
13451
13460
  * live graph may still say SaveImage) — binary frames are then OUTPUTS */
@@ -17759,6 +17768,23 @@ type SchemaDrift = {
17759
17768
  } & Delta)[];
17760
17769
  };
17761
17770
  //#endregion
17771
+ //#region src/runner/comfyOrgApiKey.d.ts
17772
+ /** a Comfy account key, or a thunk read only when a run with a partner node starts */
17773
+ type ComfyOrgApiKeySource = string | (() => string | undefined | Promise<string | undefined>);
17774
+ /** a partner API node of a prompt: what the error names */
17775
+ type PartnerApiNode = {
17776
+ id: string;
17777
+ classType: string;
17778
+ };
17779
+ /** the prompt holds a paid partner node and no Comfy account key was set */
17780
+ declare class ComfyOrgApiKeyMissingError extends Error {
17781
+ hostId: string;
17782
+ nodes: PartnerApiNode[];
17783
+ /** name, not instanceof: the cli bundle and dist/index.js each define this class */
17784
+ readonly name = "ComfyOrgApiKeyMissingError";
17785
+ constructor(hostId: string, nodes: PartnerApiNode[]);
17786
+ }
17787
+ //#endregion
17762
17788
  //#region src/host/ComfyHost.d.ts
17763
17789
  type ComfyHostID = Tagged<string, {
17764
17790
  HostID: true;
@@ -17775,6 +17801,11 @@ type ComfyHostData = {
17775
17801
  /** sent as X-API-Key on every request AND the ws upgrade.
17776
17802
  * NEVER persist the value: read it from an env var (e.g. COMFY_CLOUD_API_KEY) */
17777
17803
  apiKey?: string;
17804
+ /** the Comfy account key (platform.comfy.org) that paid partner API nodes bill to, sent as
17805
+ * `extra_data.api_key_comfy_org` with a prompt that holds one. A thunk is read only when such
17806
+ * a run starts. `RunSettings.comfyOrgApiKey` overrides it for one run; a cloud.comfy.org host
17807
+ * falls back to its apiKey. NEVER persist the value (architecture.md, Partner API nodes) */
17808
+ comfyOrgApiKey?: ComfyOrgApiKeySource;
17778
17809
  /** default true. false = never write sdk.d.ts to .comfy-ts/hosts/<id>/ —
17779
17810
  * schema updates stay in-memory. The comfy-cloud example sets false: its sdk
17780
17811
  * home is the COMMITTED examples/comfy-cloud/sdk.d.ts (gen:sdk:cloud), and a
@@ -18311,6 +18342,9 @@ type RunSettings = {
18311
18342
  * without it no frame is decoded for the run. ComfyUI sends frames only when launched with
18312
18343
  * `--preview-method`, see `host.fetchPreviewMethod()` */
18313
18344
  onPreview?: (p: ExecutionPreview) => void;
18345
+ /** the Comfy account key for this run's paid partner API nodes; overrides the host's
18346
+ * `comfyOrgApiKey`. Sent only when the prompt holds one, never saved */
18347
+ comfyOrgApiKey?: ComfyOrgApiKeySource;
18314
18348
  };
18315
18349
  /** exactly what was sent to the host for one execution, frozen at send time */
18316
18350
  type ExecutionSnapshot = {
@@ -19078,5 +19112,5 @@ declare function promptEnhancerPresets(): VarPresetSpec;
19078
19112
  //#region src/cli/tui-env.d.ts
19079
19113
  declare function isTuiActive(): boolean;
19080
19114
  //#endregion
19081
- export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyChoiceVar, type AnyVar, AudioVar, type AudioVarOpts, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, type ChoiceOptionLook, type ChoiceSelect, ChoiceVar, type CodegenOptions, type Comfy3DOutput, type ComfyApiJson, type ComfyApiNodeJson, type ComfyAudioOutput, ComfyExecution, type ComfyExecutionData, type ComfyExecutionStatus, ComfyHost, ComfyHostAuthError, type ComfyHostData, type ComfyHostID, ComfyHostUnreachableError, type ComfyImageName, ComfyManager, ComfyNode, type ComfyNodeId, type ComfyNodeIdMode, type ComfyNodeMetadata, ComfyNodeOutput, type ComfyNodeSchemaJSON, ComfySchema, type ComfySchemaJSON, ComfySdkBase, ComfySdkShape, type ComfyStorage, ComfyTS, type ComfyTextOutput, type ComfyUnionValue, type ComfyUploadImageResult, ComfyUploader, ComfyVar, ComfyVarBase, type ComfyVideoOutput, ComfyWorkflow, ComfyWorkflowBuilder, type ComfyWorkflowData, type ComfyWorkflowID, type ConnectOptions, ConvertibleImageFormat, DEFAULT_AUDIO_EXTENSIONS, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, DEFAULT_STARRED_SIZES, DEFAULT_VIDEO_EXTENSIONS, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionPreview, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, type HostSlotSource, ImageVar, ImageVarEmptyError, type ImageVarOpts, IntVar, InvalidPromptError, IsEqual, type LiteGraphJSON, type LmLoraItem, type LoraEntry, type LoraLane, type LoraLanes, type LoraMirror, type LoraNameOf, type LoraRecord, type LoraStrength, type LoraSweep, type LorasHost, type LorasInput, LorasVar, MDContent, Maybe, MediaImage, type MediaImageData, MediaVar, MediaVarEmptyError, type MediaVarOpts, type ModelVarOpts, MultiChoiceVar, type NodeMode, NodeOf, OptionalChoiceVar, type OutputWidget, type OutputWidgetKind, type ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type PreviewMethod, type ProgressReport, type PromptEnhancer, type PromptID, type PromptInput, type PromptLane, type PromptLanes, type PromptRelated_WsMsg, type PromptTagsOpts, type PromptValue, PromptVar, type PromptVarOpts, type QualifiedNodeKey, RelativePath, type RelightRoles, type RelightWidget, type Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SD15_SIZE_PRESETS, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, type SlotNameOf, type SlotValueOf, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarUi, type VarValues, type VarsSpec, VideoVar, type VideoVarOpts, WorkflowConvertError, WorkflowNormalizeError, type WsLike, type WsMessageEvent, type WsMsg, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, exampleImagePath, exampleMediaPath, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, isTuiActive, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, promptEnhancerPresets, readPromptEnhancers, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resolveWidgetRoles, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v, widget };
19115
+ export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyChoiceVar, type AnyVar, AudioVar, type AudioVarOpts, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, type ChoiceOptionLook, type ChoiceSelect, ChoiceVar, type CodegenOptions, type Comfy3DOutput, type ComfyApiJson, type ComfyApiNodeJson, type ComfyAudioOutput, ComfyExecution, type ComfyExecutionData, type ComfyExecutionStatus, ComfyHost, ComfyHostAuthError, type ComfyHostData, type ComfyHostID, ComfyHostUnreachableError, type ComfyImageName, ComfyManager, ComfyNode, type ComfyNodeId, type ComfyNodeIdMode, type ComfyNodeMetadata, ComfyNodeOutput, type ComfyNodeSchemaJSON, ComfyOrgApiKeyMissingError, type ComfyOrgApiKeySource, ComfySchema, type ComfySchemaJSON, ComfySdkBase, ComfySdkShape, type ComfyStorage, ComfyTS, type ComfyTextOutput, type ComfyUnionValue, type ComfyUploadImageResult, ComfyUploader, ComfyVar, ComfyVarBase, type ComfyVideoOutput, ComfyWorkflow, ComfyWorkflowBuilder, type ComfyWorkflowData, type ComfyWorkflowID, type ConnectOptions, ConvertibleImageFormat, DEFAULT_AUDIO_EXTENSIONS, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, DEFAULT_STARRED_SIZES, DEFAULT_VIDEO_EXTENSIONS, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionPreview, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, type HostSlotSource, ImageVar, ImageVarEmptyError, type ImageVarOpts, IntVar, InvalidPromptError, IsEqual, type LiteGraphJSON, type LmLoraItem, type LoraEntry, type LoraLane, type LoraLanes, type LoraMirror, type LoraNameOf, type LoraRecord, type LoraStrength, type LoraSweep, type LorasHost, type LorasInput, LorasVar, MDContent, Maybe, MediaImage, type MediaImageData, MediaVar, MediaVarEmptyError, type MediaVarOpts, type ModelVarOpts, MultiChoiceVar, type NodeMode, NodeOf, OptionalChoiceVar, type OutputWidget, type OutputWidgetKind, type ParsedHostBase, PartialOmit, type PartnerApiNode, type PluginInstallStatus, type PluginSuggestion, type PreviewMethod, type ProgressReport, type PromptEnhancer, type PromptID, type PromptInput, type PromptLane, type PromptLanes, type PromptRelated_WsMsg, type PromptTagsOpts, type PromptValue, PromptVar, type PromptVarOpts, type QualifiedNodeKey, RelativePath, type RelightRoles, type RelightWidget, type Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SD15_SIZE_PRESETS, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, type SlotNameOf, type SlotValueOf, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarUi, type VarValues, type VarsSpec, VideoVar, type VideoVarOpts, WorkflowConvertError, WorkflowNormalizeError, type WsLike, type WsMessageEvent, type WsMsg, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, exampleImagePath, exampleMediaPath, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, isTuiActive, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, promptEnhancerPresets, readPromptEnhancers, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resolveWidgetRoles, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v, widget };
19082
19116
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -12234,6 +12234,7 @@ declare const types$1: import("arktype").Module<{
12234
12234
  client_id: string;
12235
12235
  extra_data: {
12236
12236
  extra_pnginfo: unknown;
12237
+ api_key_comfy_org?: string | undefined;
12237
12238
  };
12238
12239
  prompt: unknown;
12239
12240
  };
@@ -12262,16 +12263,9 @@ declare const types$1: import("arktype").Module<{
12262
12263
  };
12263
12264
  PromptID: PromptID;
12264
12265
  PromptRelated_WsMsg: {
12265
- type: "progress";
12266
- data: {
12267
- value: number;
12268
- max: number;
12269
- };
12270
- } | {
12271
- type: "executing";
12266
+ type: "execution_start";
12272
12267
  data: {
12273
12268
  prompt_id: PromptID;
12274
- node?: ComfyNodeId | null | undefined;
12275
12269
  };
12276
12270
  } | {
12277
12271
  type: "execution_cached";
@@ -12280,9 +12274,16 @@ declare const types$1: import("arktype").Module<{
12280
12274
  prompt_id: PromptID;
12281
12275
  };
12282
12276
  } | {
12283
- type: "execution_start";
12277
+ type: "executing";
12284
12278
  data: {
12285
12279
  prompt_id: PromptID;
12280
+ node?: ComfyNodeId | null | undefined;
12281
+ };
12282
+ } | {
12283
+ type: "progress";
12284
+ data: {
12285
+ value: number;
12286
+ max: number;
12286
12287
  };
12287
12288
  } | {
12288
12289
  type: "progress_state";
@@ -12366,16 +12367,9 @@ declare const types$1: import("arktype").Module<{
12366
12367
  data: string;
12367
12368
  };
12368
12369
  WsMsg: {
12369
- type: "progress";
12370
- data: {
12371
- value: number;
12372
- max: number;
12373
- };
12374
- } | {
12375
- type: "executing";
12370
+ type: "execution_start";
12376
12371
  data: {
12377
12372
  prompt_id: PromptID;
12378
- node?: ComfyNodeId | null | undefined;
12379
12373
  };
12380
12374
  } | {
12381
12375
  type: "execution_cached";
@@ -12384,9 +12378,16 @@ declare const types$1: import("arktype").Module<{
12384
12378
  prompt_id: PromptID;
12385
12379
  };
12386
12380
  } | {
12387
- type: "execution_start";
12381
+ type: "executing";
12388
12382
  data: {
12389
12383
  prompt_id: PromptID;
12384
+ node?: ComfyNodeId | null | undefined;
12385
+ };
12386
+ } | {
12387
+ type: "progress";
12388
+ data: {
12389
+ value: number;
12390
+ max: number;
12390
12391
  };
12391
12392
  } | {
12392
12393
  type: "progress_state";
@@ -12995,6 +12996,7 @@ declare const types: import("arktype").Module<{
12995
12996
  output_tooltips?: (string | null)[] | undefined;
12996
12997
  deprecated?: boolean | undefined;
12997
12998
  experimental?: boolean | undefined;
12999
+ api_node?: boolean | undefined;
12998
13000
  };
12999
13001
  ComfySchemaJSON: {
13000
13002
  [x: string]: {
@@ -13103,6 +13105,7 @@ declare const types: import("arktype").Module<{
13103
13105
  output_tooltips?: (string | null)[] | undefined;
13104
13106
  deprecated?: boolean | undefined;
13105
13107
  experimental?: boolean | undefined;
13108
+ api_node?: boolean | undefined;
13106
13109
  };
13107
13110
  };
13108
13111
  }>;
@@ -13285,6 +13288,8 @@ type ComfyAudioOutput = {
13285
13288
  mime: string;
13286
13289
  bytes: Uint8Array;
13287
13290
  absPath: AbsolutePath | null;
13291
+ /** the `tag` / `tags` of the output node's metadata, as on images */
13292
+ tags: string[];
13288
13293
  };
13289
13294
  /** one video file an output node published (SaveVideo, SaveWEBM, VHS_VideoCombine), same
13290
13295
  * shape and same retrieval as an audio file */
@@ -13446,6 +13451,10 @@ declare class ComfyExecution {
13446
13451
  private encodeAndWrite;
13447
13452
  /** accumulate an output on the prompt; tags from node metadata ride along */
13448
13453
  private pushImage;
13454
+ /** the tags an output node was built with (`{ tag }` / `{ tags }` metadata) */
13455
+ private tagsOf;
13456
+ /** the sent graph saves through SaveImageWebsocket: those outputs exist only as ws frames */
13457
+ private get sendsWsFrames();
13449
13458
  /** true while the currently executing node is a SaveImageWebsocket in the
13450
13459
  * SENT snapshot (the ephemeral rewrite only touches the snapshot, so the
13451
13460
  * live graph may still say SaveImage) — binary frames are then OUTPUTS */
@@ -17759,6 +17768,23 @@ type SchemaDrift = {
17759
17768
  } & Delta)[];
17760
17769
  };
17761
17770
  //#endregion
17771
+ //#region src/runner/comfyOrgApiKey.d.ts
17772
+ /** a Comfy account key, or a thunk read only when a run with a partner node starts */
17773
+ type ComfyOrgApiKeySource = string | (() => string | undefined | Promise<string | undefined>);
17774
+ /** a partner API node of a prompt: what the error names */
17775
+ type PartnerApiNode = {
17776
+ id: string;
17777
+ classType: string;
17778
+ };
17779
+ /** the prompt holds a paid partner node and no Comfy account key was set */
17780
+ declare class ComfyOrgApiKeyMissingError extends Error {
17781
+ hostId: string;
17782
+ nodes: PartnerApiNode[];
17783
+ /** name, not instanceof: the cli bundle and dist/index.js each define this class */
17784
+ readonly name = "ComfyOrgApiKeyMissingError";
17785
+ constructor(hostId: string, nodes: PartnerApiNode[]);
17786
+ }
17787
+ //#endregion
17762
17788
  //#region src/host/ComfyHost.d.ts
17763
17789
  type ComfyHostID = Tagged<string, {
17764
17790
  HostID: true;
@@ -17775,6 +17801,11 @@ type ComfyHostData = {
17775
17801
  /** sent as X-API-Key on every request AND the ws upgrade.
17776
17802
  * NEVER persist the value: read it from an env var (e.g. COMFY_CLOUD_API_KEY) */
17777
17803
  apiKey?: string;
17804
+ /** the Comfy account key (platform.comfy.org) that paid partner API nodes bill to, sent as
17805
+ * `extra_data.api_key_comfy_org` with a prompt that holds one. A thunk is read only when such
17806
+ * a run starts. `RunSettings.comfyOrgApiKey` overrides it for one run; a cloud.comfy.org host
17807
+ * falls back to its apiKey. NEVER persist the value (architecture.md, Partner API nodes) */
17808
+ comfyOrgApiKey?: ComfyOrgApiKeySource;
17778
17809
  /** default true. false = never write sdk.d.ts to .comfy-ts/hosts/<id>/ —
17779
17810
  * schema updates stay in-memory. The comfy-cloud example sets false: its sdk
17780
17811
  * home is the COMMITTED examples/comfy-cloud/sdk.d.ts (gen:sdk:cloud), and a
@@ -18311,6 +18342,9 @@ type RunSettings = {
18311
18342
  * without it no frame is decoded for the run. ComfyUI sends frames only when launched with
18312
18343
  * `--preview-method`, see `host.fetchPreviewMethod()` */
18313
18344
  onPreview?: (p: ExecutionPreview) => void;
18345
+ /** the Comfy account key for this run's paid partner API nodes; overrides the host's
18346
+ * `comfyOrgApiKey`. Sent only when the prompt holds one, never saved */
18347
+ comfyOrgApiKey?: ComfyOrgApiKeySource;
18314
18348
  };
18315
18349
  /** exactly what was sent to the host for one execution, frozen at send time */
18316
18350
  type ExecutionSnapshot = {
@@ -19078,5 +19112,5 @@ declare function promptEnhancerPresets(): VarPresetSpec;
19078
19112
  //#region src/cli/tui-env.d.ts
19079
19113
  declare function isTuiActive(): boolean;
19080
19114
  //#endregion
19081
- export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyChoiceVar, type AnyVar, AudioVar, type AudioVarOpts, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, type ChoiceOptionLook, type ChoiceSelect, ChoiceVar, type CodegenOptions, type Comfy3DOutput, type ComfyApiJson, type ComfyApiNodeJson, type ComfyAudioOutput, ComfyExecution, type ComfyExecutionData, type ComfyExecutionStatus, ComfyHost, ComfyHostAuthError, type ComfyHostData, type ComfyHostID, ComfyHostUnreachableError, type ComfyImageName, ComfyManager, ComfyNode, type ComfyNodeId, type ComfyNodeIdMode, type ComfyNodeMetadata, ComfyNodeOutput, type ComfyNodeSchemaJSON, ComfySchema, type ComfySchemaJSON, ComfySdkBase, ComfySdkShape, type ComfyStorage, ComfyTS, type ComfyTextOutput, type ComfyUnionValue, type ComfyUploadImageResult, ComfyUploader, ComfyVar, ComfyVarBase, type ComfyVideoOutput, ComfyWorkflow, ComfyWorkflowBuilder, type ComfyWorkflowData, type ComfyWorkflowID, type ConnectOptions, ConvertibleImageFormat, DEFAULT_AUDIO_EXTENSIONS, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, DEFAULT_STARRED_SIZES, DEFAULT_VIDEO_EXTENSIONS, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionPreview, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, type HostSlotSource, ImageVar, ImageVarEmptyError, type ImageVarOpts, IntVar, InvalidPromptError, IsEqual, type LiteGraphJSON, type LmLoraItem, type LoraEntry, type LoraLane, type LoraLanes, type LoraMirror, type LoraNameOf, type LoraRecord, type LoraStrength, type LoraSweep, type LorasHost, type LorasInput, LorasVar, MDContent, Maybe, MediaImage, type MediaImageData, MediaVar, MediaVarEmptyError, type MediaVarOpts, type ModelVarOpts, MultiChoiceVar, type NodeMode, NodeOf, OptionalChoiceVar, type OutputWidget, type OutputWidgetKind, type ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type PreviewMethod, type ProgressReport, type PromptEnhancer, type PromptID, type PromptInput, type PromptLane, type PromptLanes, type PromptRelated_WsMsg, type PromptTagsOpts, type PromptValue, PromptVar, type PromptVarOpts, type QualifiedNodeKey, RelativePath, type RelightRoles, type RelightWidget, type Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SD15_SIZE_PRESETS, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, type SlotNameOf, type SlotValueOf, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarUi, type VarValues, type VarsSpec, VideoVar, type VideoVarOpts, WorkflowConvertError, WorkflowNormalizeError, type WsLike, type WsMessageEvent, type WsMsg, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, exampleImagePath, exampleMediaPath, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, isTuiActive, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, promptEnhancerPresets, readPromptEnhancers, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resolveWidgetRoles, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v, widget };
19115
+ export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyChoiceVar, type AnyVar, AudioVar, type AudioVarOpts, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, type ChoiceOptionLook, type ChoiceSelect, ChoiceVar, type CodegenOptions, type Comfy3DOutput, type ComfyApiJson, type ComfyApiNodeJson, type ComfyAudioOutput, ComfyExecution, type ComfyExecutionData, type ComfyExecutionStatus, ComfyHost, ComfyHostAuthError, type ComfyHostData, type ComfyHostID, ComfyHostUnreachableError, type ComfyImageName, ComfyManager, ComfyNode, type ComfyNodeId, type ComfyNodeIdMode, type ComfyNodeMetadata, ComfyNodeOutput, type ComfyNodeSchemaJSON, ComfyOrgApiKeyMissingError, type ComfyOrgApiKeySource, ComfySchema, type ComfySchemaJSON, ComfySdkBase, ComfySdkShape, type ComfyStorage, ComfyTS, type ComfyTextOutput, type ComfyUnionValue, type ComfyUploadImageResult, ComfyUploader, ComfyVar, ComfyVarBase, type ComfyVideoOutput, ComfyWorkflow, ComfyWorkflowBuilder, type ComfyWorkflowData, type ComfyWorkflowID, type ConnectOptions, ConvertibleImageFormat, DEFAULT_AUDIO_EXTENSIONS, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, DEFAULT_STARRED_SIZES, DEFAULT_VIDEO_EXTENSIONS, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionPreview, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, type HostSlotSource, ImageVar, ImageVarEmptyError, type ImageVarOpts, IntVar, InvalidPromptError, IsEqual, type LiteGraphJSON, type LmLoraItem, type LoraEntry, type LoraLane, type LoraLanes, type LoraMirror, type LoraNameOf, type LoraRecord, type LoraStrength, type LoraSweep, type LorasHost, type LorasInput, LorasVar, MDContent, Maybe, MediaImage, type MediaImageData, MediaVar, MediaVarEmptyError, type MediaVarOpts, type ModelVarOpts, MultiChoiceVar, type NodeMode, NodeOf, OptionalChoiceVar, type OutputWidget, type OutputWidgetKind, type ParsedHostBase, PartialOmit, type PartnerApiNode, type PluginInstallStatus, type PluginSuggestion, type PreviewMethod, type ProgressReport, type PromptEnhancer, type PromptID, type PromptInput, type PromptLane, type PromptLanes, type PromptRelated_WsMsg, type PromptTagsOpts, type PromptValue, PromptVar, type PromptVarOpts, type QualifiedNodeKey, RelativePath, type RelightRoles, type RelightWidget, type Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SD15_SIZE_PRESETS, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, type SlotNameOf, type SlotValueOf, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarUi, type VarValues, type VarsSpec, VideoVar, type VideoVarOpts, WorkflowConvertError, WorkflowNormalizeError, type WsLike, type WsMessageEvent, type WsMsg, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, exampleImagePath, exampleMediaPath, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, isTuiActive, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, promptEnhancerPresets, readPromptEnhancers, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resolveWidgetRoles, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v, widget };
19082
19116
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -110,7 +110,7 @@ function createNodeStorage() {
110
110
  }
111
111
  //#endregion
112
112
  //#region package.json
113
- var version = "2.23.0";
113
+ var version = "2.24.0";
114
114
  //#endregion
115
115
  //#region src/litegraph/LiteGraphLinkID.ts
116
116
  const asLiteGraphLinkID = (id) => id;
@@ -2332,7 +2332,10 @@ const types$1 = scope({
2332
2332
  Timestamp: "number",
2333
2333
  ApiPromptInput: {
2334
2334
  client_id: "string",
2335
- extra_data: { extra_pnginfo: "unknown" },
2335
+ extra_data: {
2336
+ extra_pnginfo: "unknown",
2337
+ "api_key_comfy_org?": "string"
2338
+ },
2336
2339
  prompt: "unknown"
2337
2340
  },
2338
2341
  NodeProgress: {
@@ -3005,6 +3008,8 @@ var ComfyExecution = class {
3005
3008
  });
3006
3009
  return "lost";
3007
3010
  }
3011
+ const sinceHeard = Date.now() - this.lastHeardAt;
3012
+ if (!this.mayHaveMissedEvents && this.sendsWsFrames && sinceHeard < this.host.runSilenceMaxMs) return "waiting";
3008
3013
  logInfo(`run ${id}: ended on host '${hostId}' without its end reaching the socket, finishing from its history`);
3009
3014
  for (const p of replay.problems) logError(`run ${id}: a history entry does not match the ws schemas, skipped: ${p}`);
3010
3015
  this.replayUnheardOutputs(replay);
@@ -3035,13 +3040,15 @@ var ComfyExecution = class {
3035
3040
  this.retrieveFile = async (info, promptNodeID, mime) => {
3036
3041
  const response = await this.host.fetchFile("/view?" + new URLSearchParams(info).toString());
3037
3042
  const bytes = new Uint8Array(await response.arrayBuffer());
3043
+ const tags = this.tagsOf(promptNodeID);
3038
3044
  const sf = this.save;
3039
3045
  if (sf == null) return {
3040
3046
  nodeId: promptNodeID,
3041
3047
  filename: info.filename,
3042
3048
  mime,
3043
3049
  bytes,
3044
- absPath: null
3050
+ absPath: null,
3051
+ tags
3045
3052
  };
3046
3053
  const promptPrefix = this.workflow.data.apiJson?.[promptNodeID]?.inputs["filename_prefix"];
3047
3054
  const written = await this.encodeAndWrite({
@@ -3059,7 +3066,8 @@ var ComfyExecution = class {
3059
3066
  filename: info.filename,
3060
3067
  mime,
3061
3068
  bytes,
3062
- absPath: written.path
3069
+ absPath: written.path,
3070
+ tags
3063
3071
  };
3064
3072
  };
3065
3073
  this.imageErrors = [];
@@ -3286,11 +3294,19 @@ var ComfyExecution = class {
3286
3294
  }
3287
3295
  /** accumulate an output on the prompt; tags from node metadata ride along */
3288
3296
  pushImage(img, promptNodeID) {
3289
- const promptMeta = promptNodeID != null ? this.workflow.data.metadata?.[promptNodeID] : null;
3290
- if (promptMeta?.tag) img.tags.push(promptMeta.tag);
3291
- if (promptMeta?.tags) img.tags.push(...promptMeta.tags);
3297
+ img.tags.push(...this.tagsOf(promptNodeID));
3292
3298
  this.images.push(img);
3293
3299
  }
3300
+ /** the tags an output node was built with (`{ tag }` / `{ tags }` metadata) */
3301
+ tagsOf(promptNodeID) {
3302
+ const promptMeta = promptNodeID != null ? this.workflow.data.metadata?.[promptNodeID] : null;
3303
+ return [...promptMeta?.tag ? [promptMeta.tag] : [], ...promptMeta?.tags ?? []];
3304
+ }
3305
+ /** the sent graph saves through SaveImageWebsocket: those outputs exist only as ws frames */
3306
+ get sendsWsFrames() {
3307
+ const apiJson = this.snapshot?.apiJson ?? this.workflow.apiJson;
3308
+ return Object.values(apiJson).some((n) => n?.class_type === "SaveImageWebsocket");
3309
+ }
3294
3310
  /** true while the currently executing node is a SaveImageWebsocket in the
3295
3311
  * SENT snapshot (the ephemeral rewrite only touches the snapshot, so the
3296
3312
  * live graph may still say SaveImage) — binary frames are then OUTPUTS */
@@ -3338,6 +3354,35 @@ var ComfyExecution = class {
3338
3354
  }
3339
3355
  };
3340
3356
  //#endregion
3357
+ //#region src/runner/comfyOrgApiKey.ts
3358
+ /** the prompt holds a paid partner node and no Comfy account key was set */
3359
+ var ComfyOrgApiKeyMissingError = class extends Error {
3360
+ constructor(hostId, nodes) {
3361
+ const list = nodes.map((n) => `${n.classType} #${n.id}`).join(", ");
3362
+ super(`🔴 host '${hostId}': the prompt holds partner API node(s) ${list}, which bill a Comfy account, and no Comfy account key is set. Set it with \`comfy.host({ id: '${hostId}', comfyOrgApiKey })\` or \`run({ comfyOrgApiKey })\` (a string or a thunk; the key comes from platform.comfy.org). Nothing was sent.`);
3363
+ this.hostId = hostId;
3364
+ this.nodes = nodes;
3365
+ this.name = "ComfyOrgApiKeyMissingError";
3366
+ }
3367
+ };
3368
+ /** the nodes of a prompt whose schema says `api_node: true` */
3369
+ const partnerApiNodes = (apiJson, schema) => {
3370
+ const out = [];
3371
+ for (const [id, node] of Object.entries(apiJson)) if (schema.nodesByNameInComfy[node.class_type]?.raw.api_node === true) out.push({
3372
+ id,
3373
+ classType: node.class_type
3374
+ });
3375
+ return out;
3376
+ };
3377
+ /** the first source set wins; an empty string counts as unset */
3378
+ const resolveComfyOrgApiKey = async (sources) => {
3379
+ for (const src of sources) {
3380
+ if (src == null) continue;
3381
+ const key = typeof src === "string" ? src : await src();
3382
+ if (key != null && key !== "") return key;
3383
+ }
3384
+ };
3385
+ //#endregion
3341
3386
  //#region src/runner/ephemeral.ts
3342
3387
  /**
3343
3388
  * the `ephemeral: true` rewrite (architecture.md item 14): every SaveImage
@@ -3497,6 +3542,8 @@ function comfyWorkflowAutoLayout(p) {
3497
3542
  }
3498
3543
  //#endregion
3499
3544
  //#region src/runner/ComfyWorkflow.ts
3545
+ /** a Comfy Cloud host's X-API-Key is a platform.comfy.org key, the one partner nodes bill to */
3546
+ const COMFY_CLOUD_HOST = "cloud.comfy.org";
3500
3547
  const asComfyWorkflowID = (x) => x;
3501
3548
  var ComfyWorkflow = class {
3502
3549
  constructor(host, data) {
@@ -3627,14 +3674,29 @@ var ComfyWorkflow = class {
3627
3674
  const hasWsSaver = Object.values(snapshot.apiJson).some((n) => n.class_type === "SaveImageWebsocket");
3628
3675
  if (rewritten === 0 && !hasWsSaver) console.warn(`🟡 ephemeral run: no SaveImage/SaveImageWebsocket node in workflow '${this.id}' — nothing streams back`);
3629
3676
  }
3677
+ const partners = partnerApiNodes(snapshot.apiJson, this.schema);
3678
+ let comfyOrgApiKey;
3679
+ if (partners.length > 0) {
3680
+ const data = this.host.data;
3681
+ const cloudKey = data.apiKey != null && this.host.base.host === COMFY_CLOUD_HOST ? data.apiKey : void 0;
3682
+ comfyOrgApiKey = await resolveComfyOrgApiKey([
3683
+ p.comfyOrgApiKey,
3684
+ data.comfyOrgApiKey,
3685
+ cloudKey
3686
+ ]);
3687
+ if (comfyOrgApiKey == null) throw new ComfyOrgApiKeyMissingError(data.id, partners);
3688
+ }
3630
3689
  const out = {
3631
3690
  client_id: this.host.comfySessionId,
3632
3691
  prompt: snapshot.apiJson,
3633
- extra_data: { extra_pnginfo: {
3634
- workflow: snapshot.workflowJson,
3635
- comfy_ts_workflow_id: this.id,
3636
- comfy_ts_version: comfyts.version
3637
- } }
3692
+ extra_data: {
3693
+ extra_pnginfo: {
3694
+ workflow: snapshot.workflowJson,
3695
+ comfy_ts_workflow_id: this.id,
3696
+ comfy_ts_version: comfyts.version
3697
+ },
3698
+ ...comfyOrgApiKey != null ? { api_key_comfy_org: comfyOrgApiKey } : {}
3699
+ }
3638
3700
  };
3639
3701
  const res = await this.host.fetch("/prompt", {
3640
3702
  method: "POST",
@@ -4409,7 +4471,8 @@ const types = scope({
4409
4471
  output_node: "boolean",
4410
4472
  "output_tooltips?": "(string | null)[]",
4411
4473
  "deprecated?": "boolean",
4412
- "experimental?": "boolean"
4474
+ "experimental?": "boolean",
4475
+ "api_node?": "boolean"
4413
4476
  },
4414
4477
  ComfyInputSpecAlt1: ["ComfyInputType", "ComfyInputOpts"],
4415
4478
  ComfyInputSpecAlt2: ["ComfyInputType"],
@@ -6936,7 +6999,8 @@ var DefinedWorkflow = class {
6936
6999
  idMode: settings.idMode,
6937
7000
  log: settings.log,
6938
7001
  onProgress: settings.onProgress,
6939
- onPreview: settings.onPreview
7002
+ onPreview: settings.onPreview,
7003
+ comfyOrgApiKey: settings.comfyOrgApiKey
6940
7004
  });
6941
7005
  this.lastExecution = execution;
6942
7006
  return execution;
@@ -8430,6 +8494,7 @@ var ComfyTS = class ComfyTS {
8430
8494
  const authed = (p) => p.apiKey != null ? " (authed)" : "";
8431
8495
  throw new Error(`host id '${data.id}' already registered ${cur == null ? "with no address" : `at ${renderHttpBase(cur)}`}${authed(existing.data)} — refusing ${incoming == null ? "the id alone" : renderHttpBase(incoming)}${authed(data)}`);
8432
8496
  }
8497
+ if (data.comfyOrgApiKey != null) existing.data.comfyOrgApiKey = data.comfyOrgApiKey;
8433
8498
  return existing;
8434
8499
  }
8435
8500
  const created = new ComfyHost(data);
@@ -8634,6 +8699,6 @@ function isTuiActive() {
8634
8699
  */
8635
8700
  setDefaultComfyStorage(createNodeStorage());
8636
8701
  //#endregion
8637
- export { AudioVar, ChoiceVar, ComfyExecution, ComfyHost, ComfyHostAuthError, ComfyHostUnreachableError, ComfyManager, ComfyNode, ComfyNodeOutput, ComfySchema, ComfyTS, ComfyUploader, ComfyVar, ComfyVarBase, ComfyWorkflow, ComfyWorkflowBuilder, DEFAULT_AUDIO_EXTENSIONS, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, DEFAULT_STARRED_SIZES, DEFAULT_VIDEO_EXTENSIONS, DefinedWorkflow, FloatVar, ImageVar, ImageVarEmptyError, IntVar, InvalidPromptError, LorasVar, MediaImage, MediaVar, MediaVarEmptyError, MultiChoiceVar, OptionalChoiceVar, PromptVar, ResilientWebSocketClient, SD15_SIZE_PRESETS, SeedVar, SizeVar, TextVar, ToggleVar, VideoVar, WorkflowConvertError, WorkflowNormalizeError, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, exampleImagePath, exampleMediaPath, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, isTuiActive, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, parseHostBase, parseWorkflowJson, promptEnhancerPresets, readPromptEnhancers, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resolveWidgetRoles, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v, widget };
8702
+ export { AudioVar, ChoiceVar, ComfyExecution, ComfyHost, ComfyHostAuthError, ComfyHostUnreachableError, ComfyManager, ComfyNode, ComfyNodeOutput, ComfyOrgApiKeyMissingError, ComfySchema, ComfyTS, ComfyUploader, ComfyVar, ComfyVarBase, ComfyWorkflow, ComfyWorkflowBuilder, DEFAULT_AUDIO_EXTENSIONS, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, DEFAULT_STARRED_SIZES, DEFAULT_VIDEO_EXTENSIONS, DefinedWorkflow, FloatVar, ImageVar, ImageVarEmptyError, IntVar, InvalidPromptError, LorasVar, MediaImage, MediaVar, MediaVarEmptyError, MultiChoiceVar, OptionalChoiceVar, PromptVar, ResilientWebSocketClient, SD15_SIZE_PRESETS, SeedVar, SizeVar, TextVar, ToggleVar, VideoVar, WorkflowConvertError, WorkflowNormalizeError, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, exampleImagePath, exampleMediaPath, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, isTuiActive, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, parseHostBase, parseWorkflowJson, promptEnhancerPresets, readPromptEnhancers, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resolveWidgetRoles, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v, widget };
8638
8703
 
8639
8704
  //# sourceMappingURL=index.js.map