comfy-ts 2.8.0 → 2.9.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/cli.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{run-tui-BPw-SZYW.js → run-tui-BLEdTsOX.js} +2 -2
- package/dist/{run-tui-BPw-SZYW.js.map → run-tui-BLEdTsOX.js.map} +1 -1
- package/dist/serve-web.js +26 -17
- package/dist/{state-B-boDz-Z.js → state-BbgJeCe6.js} +2 -2
- package/dist/{state-B-boDz-Z.js.map → state-BbgJeCe6.js.map} +1 -1
- package/dist/web.d.ts +77 -1
- package/dist/web.js +1 -1
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/serve/hostProtocol.ts +68 -0
- package/src/cli/serve/web/components/Gallery.tsx +70 -18
- package/src/cli/serve/web/state/FormSt.ts +8 -1
- package/src/cli/serve/web/state/WebSt.ts +297 -9
- package/src/cli/serve/web/state/host.ts +206 -0
- package/src/cli/serve/web/styles.ts +9 -0
- package/src/web.ts +12 -0
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
|
-
|
|
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