comfy-ts 2.8.0 → 2.10.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.
package/dist/web.d.ts CHANGED
@@ -17609,5 +17609,81 @@ declare function loraMatchesFilter(name: string, filter: string, hostId?: string
17609
17609
  */
17610
17610
  declare function loraTag<N extends string = string>(name: N, strength?: number, clipStrength?: number): string;
17611
17611
  //#endregion
17612
- export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyVar, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, ChoiceVar, type CodegenOptions, type ComfyApiJson, type ComfyApiNodeJson, 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, ComfyWorkflow, ComfyWorkflowBuilder, type ComfyWorkflowData, type ComfyWorkflowID, type ConnectOptions, ConvertibleImageFormat, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, ImageVar, ImageVarEmptyError, type ImageVarOpts, IntVar, InvalidPromptError, IsEqual, type LiteGraphJSON, type LmLoraItem, type LoraMirror, type LoraNameOf, type LoraStrength, type LoraSweep, type LorasHost, LorasVar, MDContent, Maybe, MediaImage, type MediaImageData, type NodeMode, NodeOf, type ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type ProgressReport, type PromptID, type PromptRelated_WsMsg, type PromptValue, PromptVar, type QualifiedNodeKey, RelativePath, type Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarValues, type VarsSpec, WorkflowConvertError, WorkflowNormalizeError, type WsLike, type WsMessageEvent, type WsMsg, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, toPresetList, v };
17612
+ //#region src/cli/serve/hostProtocol.d.ts
17613
+ /** a button the host asks the panel to draw on every result */
17614
+ type PanelHostAction = {
17615
+ id: string;
17616
+ label: string;
17617
+ title?: string;
17618
+ };
17619
+ /** the host requests that always get exactly one reply: `state` or `error` */
17620
+ type PanelRequest = 'set-selection' | 'set-values' | 'get-state';
17621
+ /** the form as it is now: var name → value in the draft file's shape (seed `{mode,value}`,
17622
+ * size `{width,height}`, loras `{name: strength}`). `request` names the host request this
17623
+ * answers; absent when the panel volunteers it (a user edit, a user switch, run seeds).
17624
+ * `rejected` is on a `set-values` reply only: every name that was NOT applied (no such var,
17625
+ * or a value its control cannot produce). Never posted before the host origin is pinned */
17626
+ type PanelState = {
17627
+ comfyTs: 'state';
17628
+ module: string;
17629
+ draft: string;
17630
+ values: Record<string, unknown>;
17631
+ request?: PanelRequest;
17632
+ rejected?: string[];
17633
+ };
17634
+ /** `code: 'boot'` (no `request`): the panel could not boot (index failed, zero workflows, the
17635
+ * opening draft unreadable); may go out before the pin. Every other code answers one request:
17636
+ * `unknown-module` · `select-failed` · `superseded` · `no-form` */
17637
+ type PanelError = {
17638
+ comfyTs: 'error';
17639
+ code: 'boot';
17640
+ message: string;
17641
+ } | {
17642
+ comfyTs: 'error';
17643
+ code: 'unknown-module' | 'select-failed' | 'superseded' | 'no-form';
17644
+ message: string;
17645
+ request: PanelRequest;
17646
+ };
17647
+ type PanelResultAction = {
17648
+ comfyTs: 'result-action';
17649
+ id: string;
17650
+ promptId: string;
17651
+ ix: number;
17652
+ /** the image url, relative to the panel's own origin (`/images/<promptId>/<ix>` or `/outputs/…`) */
17653
+ url: string;
17654
+ filename: string;
17655
+ module: string;
17656
+ draft: string;
17657
+ seeds: Record<string, number>;
17658
+ /** the prompt var's text at click time, when the form has one */
17659
+ prompt: string | null;
17660
+ };
17661
+ /** panel → host. `selection` is the light subset of `state` (no values), so it may go out
17662
+ * before the pin, like `ready` and the boot error */
17663
+ type PanelToHost = {
17664
+ comfyTs: 'ready';
17665
+ } | {
17666
+ comfyTs: 'selection';
17667
+ module: string;
17668
+ draft: string;
17669
+ } | PanelState | PanelError | PanelResultAction;
17670
+ /** host → panel */
17671
+ type HostToPanel = {
17672
+ comfyTs: 'host-actions';
17673
+ actions: PanelHostAction[];
17674
+ } | {
17675
+ comfyTs: 'set-prompt';
17676
+ text: string;
17677
+ } | {
17678
+ comfyTs: 'set-selection';
17679
+ module: string;
17680
+ draft: string;
17681
+ } | {
17682
+ comfyTs: 'set-values';
17683
+ values: Record<string, unknown>;
17684
+ } | {
17685
+ comfyTs: 'get-state';
17686
+ };
17687
+ //#endregion
17688
+ export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyVar, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, ChoiceVar, type CodegenOptions, type ComfyApiJson, type ComfyApiNodeJson, 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, ComfyWorkflow, ComfyWorkflowBuilder, type ComfyWorkflowData, type ComfyWorkflowID, type ConnectOptions, ConvertibleImageFormat, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, type HostToPanel, ImageVar, ImageVarEmptyError, type ImageVarOpts, IntVar, InvalidPromptError, IsEqual, type LiteGraphJSON, type LmLoraItem, type LoraMirror, type LoraNameOf, type LoraStrength, type LoraSweep, type LorasHost, LorasVar, MDContent, Maybe, MediaImage, type MediaImageData, type NodeMode, NodeOf, type PanelError, type PanelHostAction, type PanelRequest, type PanelResultAction, type PanelState, type PanelToHost, type ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type ProgressReport, type PromptID, type PromptRelated_WsMsg, type PromptValue, PromptVar, type QualifiedNodeKey, RelativePath, type Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarValues, type VarsSpec, WorkflowConvertError, WorkflowNormalizeError, type WsLike, type WsMessageEvent, type WsMsg, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, toPresetList, v };
17613
17689
  //# sourceMappingURL=web.d.ts.map
package/dist/web.js CHANGED
@@ -101,7 +101,7 @@ function getComfyStorage() {
101
101
  }
102
102
  //#endregion
103
103
  //#region package.json
104
- var version = "2.8.0";
104
+ var version = "2.10.0";
105
105
  //#endregion
106
106
  //#region src/litegraph/LiteGraphLinkID.ts
107
107
  const asLiteGraphLinkID = (id) => id;
@@ -1578,8 +1578,15 @@ var ComfyNode = class ComfyNode {
1578
1578
  }
1579
1579
  _getExpectedTypeForField(name) {
1580
1580
  const input = this.$schema.inputs.find((i) => i.nameInComfy === name);
1581
- if (input == null) throw new Error("🔴 input not found asdf");
1582
- return input.typeName;
1581
+ if (input != null) return input.typeName;
1582
+ const dot = name.indexOf(".");
1583
+ const decl = dot > 0 ? this.$schema.inputs.find((i) => i.nameInComfy === name.slice(0, dot)) : void 0;
1584
+ if (decl != null) {
1585
+ const kind = classifySchemaInput(decl);
1586
+ const slotType = containerInstanceSlotType(decl.opts);
1587
+ if (kind.kind === "dynamic-container" && kind.instanceNames.includes(name.slice(dot + 1)) && slotType != null) return slotType;
1588
+ }
1589
+ throw new Error(`🔴 no input "${name}" on ${this.$schema.nodeKey}: cannot tell which output of the linked node to use`);
1583
1590
  }
1584
1591
  _getOutputForTypeOrCrash(type) {
1585
1592
  const i = this.$schema.outputs.find((i) => i.typeName === type);