comfy-ts 2.10.0 → 2.12.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/README.md +1 -0
- package/dist/{LogsSt-DFxzQfDc.js → LogsSt-U1H0mP1m.js} +35 -5
- package/dist/LogsSt-U1H0mP1m.js.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/index.cjs +565 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +210 -31
- package/dist/index.d.ts +210 -31
- package/dist/index.js +561 -63
- package/dist/index.js.map +1 -1
- package/dist/{run-serve-_nrvJYyt.js → run-serve-BeAznay5.js} +549 -43
- package/dist/run-serve-BeAznay5.js.map +1 -0
- package/dist/{run-tui-Atvf9vb3.js → run-tui-BTGjvnKk.js} +75 -18
- package/dist/run-tui-BTGjvnKk.js.map +1 -0
- package/dist/{DefinedWorkflow-BatWaZO1.js → schemaDrift-Cg39vs53.js} +644 -60
- package/dist/schemaDrift-Cg39vs53.js.map +1 -0
- package/dist/serve-web.js +523 -133
- package/dist/{state-6RFDIQwJ.js → state-C7REnHan.js} +18 -3
- package/dist/{state-6RFDIQwJ.js.map → state-C7REnHan.js.map} +1 -1
- package/dist/web.d.ts +210 -31
- package/dist/web.js +561 -63
- package/dist/web.js.map +1 -1
- package/examples/comfy-cloud/capybara-i2v.cflow.ts +2 -0
- package/examples/comfy-cloud/wan22-5b-t2v.cflow.ts +2 -0
- package/examples/comfy-cloud/wan22-i2v.cflow.ts +2 -0
- package/examples/comfy-cloud/wan22-t2v.cflow.ts +2 -0
- package/examples/rvion/06-qwen-image-edit.cflow.ts +3 -2
- package/examples/rvion/07-local-llm-text-gen.cflow.ts +2 -2
- package/examples/rvion/10-anima-t2i.cflow.ts +229 -0
- package/extra/README.md +4 -0
- package/extra/comfyui-fresh-model-lists/README.md +25 -0
- package/extra/comfyui-fresh-model-lists/__init__.py +36 -0
- package/extra/comfyui-fresh-model-lists/test_fresh_model_lists.py +97 -0
- package/package.json +17 -7
- package/src/cli/draftMeta.ts +39 -0
- package/src/cli/serve/ServeApp.ts +242 -12
- package/src/cli/serve/applyVarPayload.ts +50 -22
- package/src/cli/serve/describeVar.ts +49 -6
- package/src/cli/serve/favicon.ts +3 -0
- package/src/cli/serve/llmConfigShape.ts +51 -0
- package/src/cli/serve/llmConfigs.ts +52 -0
- package/src/cli/serve/tagList.ts +92 -0
- package/src/cli/serve/tagSource.ts +69 -0
- package/src/cli/serve/web/api.ts +60 -0
- package/src/cli/serve/web/components/App.tsx +336 -44
- package/src/cli/serve/web/components/Gallery.tsx +105 -28
- package/src/cli/serve/web/components/HistoryPicker.tsx +149 -0
- package/src/cli/serve/web/components/Icon.tsx +18 -2
- package/src/cli/serve/web/components/MenuButton.tsx +53 -0
- package/src/cli/serve/web/components/Omnibox.tsx +85 -0
- package/src/cli/serve/web/components/PromptEnhancer.tsx +476 -180
- package/src/cli/serve/web/components/TooltipLayer.tsx +45 -0
- package/src/cli/serve/web/components/VarIcon.tsx +24 -0
- package/src/cli/serve/web/components/VarsForm.tsx +341 -177
- package/src/cli/serve/web/components/controls/BasicControls.tsx +57 -32
- package/src/cli/serve/web/components/controls/LorasControl.tsx +708 -285
- package/src/cli/serve/web/components/controls/PresetPicker.tsx +1 -1
- package/src/cli/serve/web/components/controls/PromptControl.tsx +279 -0
- package/src/cli/serve/web/components/controls/PromptEditor.tsx +113 -0
- package/src/cli/serve/web/components/controls/SeedControl.tsx +17 -10
- package/src/cli/serve/web/components/controls/SizeControl.tsx +111 -18
- package/src/cli/serve/web/components/modKey.ts +2 -0
- package/src/cli/serve/web/llm.ts +23 -12
- package/src/cli/serve/web/promptEditor/promptExtensions.ts +281 -0
- package/src/cli/serve/web/state/EnhancerSt.ts +415 -100
- package/src/cli/serve/web/state/FormSt.ts +193 -29
- package/src/cli/serve/web/state/OmniboxSt.ts +57 -0
- package/src/cli/serve/web/state/WebSt.ts +281 -57
- package/src/cli/serve/web/state/choiceButtons.ts +61 -0
- package/src/cli/serve/web/state/generateButton.ts +16 -0
- package/src/cli/serve/web/state/history.ts +54 -0
- package/src/cli/serve/web/state/host.ts +5 -2
- package/src/cli/serve/web/state/keptLines.ts +53 -0
- package/src/cli/serve/web/state/latentMode.ts +20 -0
- package/src/cli/serve/web/state/loraSort.ts +57 -0
- package/src/cli/serve/web/state/moduleTree.ts +2 -2
- package/src/cli/serve/web/state/omnibox.ts +69 -0
- package/src/cli/serve/web/state/payload.ts +38 -58
- package/src/cli/serve/web/state/shortcuts.ts +54 -0
- package/src/cli/serve/web/state/sizeStars.ts +31 -0
- package/src/cli/serve/web/state/stableSlots.ts +21 -0
- package/src/cli/serve/web/state/varGroups.ts +24 -0
- package/src/cli/serve/web/styles.ts +472 -118
- package/src/cli/serve/webBundle.ts +54 -10
- package/src/cli/tui/components/Header.tsx +2 -0
- package/src/cli/tui/components/PickerOverlays.tsx +9 -2
- package/src/cli/tui/imagePicker/ImagePickerSt.ts +1 -1
- package/src/cli/tui/state/DraftsSt.ts +18 -2
- package/src/cli/tui/state/EditorSt.ts +1 -1
- package/src/cli/tui/state/HostSt.ts +34 -0
- package/src/cli/tui/state/LorasSt.ts +1 -1
- package/src/cli/tui/state/PickerSt.ts +25 -7
- package/src/cli/tui/state/SettingsSt.ts +1 -1
- package/src/cli/tui/state/TuiSt.ts +10 -0
- package/src/coreExports.ts +20 -0
- package/src/host/ComfyHost.ts +15 -0
- package/src/host/loraInfoCache.ts +70 -0
- package/src/host/loraManagerApi.ts +27 -0
- package/src/host/schemaDrift.ts +87 -0
- package/src/state.ts +5 -0
- package/src/vars/ComfyVars.ts +337 -67
- package/src/vars/DefinedWorkflow.ts +40 -19
- package/src/vars/lanes.ts +238 -0
- package/src/vars/loraEntry.ts +101 -0
- package/src/vars/promptSyntax.ts +382 -0
- package/dist/DefinedWorkflow-BatWaZO1.js.map +0 -1
- package/dist/LogsSt-DFxzQfDc.js.map +0 -1
- package/dist/run-serve-_nrvJYyt.js.map +0 -1
- package/dist/run-tui-Atvf9vb3.js.map +0 -1
- package/src/cli/serve/web/components/Sidebar.tsx +0 -66
package/dist/index.d.cts
CHANGED
|
@@ -15968,6 +15968,37 @@ declare class ResilientWebSocketClient {
|
|
|
15968
15968
|
private flushMessageBuffer;
|
|
15969
15969
|
}
|
|
15970
15970
|
//#endregion
|
|
15971
|
+
//#region src/vars/loraEntry.d.ts
|
|
15972
|
+
type LoraEntry = {
|
|
15973
|
+
strength: [strengthModel: number, strengthClip: number];
|
|
15974
|
+
off?: boolean;
|
|
15975
|
+
mute?: string[];
|
|
15976
|
+
};
|
|
15977
|
+
type LoraStrength = boolean | number | [strengthModel: number, strengthClip: number] | LoraEntry;
|
|
15978
|
+
//#endregion
|
|
15979
|
+
//#region src/vars/lanes.d.ts
|
|
15980
|
+
type PromptLane = {
|
|
15981
|
+
name: string;
|
|
15982
|
+
prompt: string;
|
|
15983
|
+
active: boolean;
|
|
15984
|
+
};
|
|
15985
|
+
type PromptLanes = {
|
|
15986
|
+
lanes: PromptLane[];
|
|
15987
|
+
};
|
|
15988
|
+
type PromptInput = string | PromptLanes;
|
|
15989
|
+
type LoraRecord<T extends string = string> = Partial<Record<T, LoraStrength>>;
|
|
15990
|
+
type LoraLane<T extends string = string> = {
|
|
15991
|
+
name: string;
|
|
15992
|
+
active: boolean;
|
|
15993
|
+
loras: LoraRecord<T>;
|
|
15994
|
+
};
|
|
15995
|
+
type LoraLanes<T extends string = string> = {
|
|
15996
|
+
lanes: LoraLane<T>[];
|
|
15997
|
+
};
|
|
15998
|
+
/** a lora file is never named `lanes` (options end in .safetensors), so the plain record and the
|
|
15999
|
+
* lanes object can never be mistaken for each other */
|
|
16000
|
+
type LorasInput<T extends string = string> = LoraRecord<T> | LoraLanes<T>;
|
|
16001
|
+
//#endregion
|
|
15971
16002
|
//#region src/vars/presets.d.ts
|
|
15972
16003
|
type VarPreset = {
|
|
15973
16004
|
label: string;
|
|
@@ -15995,15 +16026,47 @@ type VarKind = 'text' | 'prompt' | 'int' | 'float' | 'seed' | 'toggle' | 'choice
|
|
|
15995
16026
|
* the one Out-specialized var (string in, PromptValue out); the split keeps
|
|
15996
16027
|
* outValue() cast-free.
|
|
15997
16028
|
*/
|
|
16029
|
+
/** how a var LOOKS in the panel, set by the workflow: `v.int(8).ui({ icon, color, description })`.
|
|
16030
|
+
* Every slot is optional, a color is any css color */
|
|
16031
|
+
type VarUi = {
|
|
16032
|
+
/** shown as a (?) after the label, the text is its tooltip */
|
|
16033
|
+
description?: string;
|
|
16034
|
+
/** a 24×24 svg path drawn in the icon color, or a whole `<svg …>` string */
|
|
16035
|
+
icon?: string;
|
|
16036
|
+
/** the icon's color */
|
|
16037
|
+
color?: string;
|
|
16038
|
+
labelColor?: string;
|
|
16039
|
+
/** the whole row, drawn without moving anything in it */
|
|
16040
|
+
background?: string;
|
|
16041
|
+
/** vars that go together: consecutive vars with the same group share one tinted block */
|
|
16042
|
+
group?: string;
|
|
16043
|
+
/** the block's tint, read from the first var of the group that sets it */
|
|
16044
|
+
groupColor?: string;
|
|
16045
|
+
border?: string;
|
|
16046
|
+
/** choice vars: a look per option, keyed by the option value. The lit option is filled
|
|
16047
|
+
* with its own color */
|
|
16048
|
+
options?: Record<string, {
|
|
16049
|
+
icon?: string;
|
|
16050
|
+
color?: string;
|
|
16051
|
+
}>;
|
|
16052
|
+
/** the field is shown but disabled unless every named var holds one of the listed values:
|
|
16053
|
+
* `{ model: ['aesthetic', 'base'] }`. Checked against the var names when the workflow loads.
|
|
16054
|
+
* Display only: a disabled var's value still reaches the build */
|
|
16055
|
+
activeWhen?: Record<string, readonly (string | number | boolean)[]>;
|
|
16056
|
+
};
|
|
15998
16057
|
declare abstract class ComfyVarBase<T, Out> {
|
|
15999
16058
|
readonly defaultValue: T;
|
|
16000
16059
|
label?: string | undefined;
|
|
16001
16060
|
abstract readonly kind: VarKind;
|
|
16002
16061
|
/** the vars-spec key, stamped by DefinedWorkflow at define time — error messages name the var with it */
|
|
16003
16062
|
name?: string;
|
|
16063
|
+
/** panel looks, see VarUi. Never part of the value, never in a draft */
|
|
16064
|
+
uiOpts: VarUi;
|
|
16004
16065
|
value: T;
|
|
16005
16066
|
constructor(defaultValue: T, label?: string | undefined);
|
|
16006
16067
|
set(value: T): this;
|
|
16068
|
+
/** chainable: `v.choice([...], 'a').ui({ icon: 'M4 12h16', color: '#e0af68' })` */
|
|
16069
|
+
ui(p: VarUi): this;
|
|
16007
16070
|
/** what drafts persist for this var (subclasses may add fields, e.g. seed mode) */
|
|
16008
16071
|
toJSON(): unknown;
|
|
16009
16072
|
/** what the GRAPH consumes at build time (varValues maps these return types) */
|
|
@@ -16053,6 +16116,26 @@ declare class TextVar extends ComfyVar<string> {
|
|
|
16053
16116
|
type ActiveLoraSource = {
|
|
16054
16117
|
activeNames(): string[];
|
|
16055
16118
|
hostId?: string;
|
|
16119
|
+
/** the parts of a lora's keyword left out of the prompt (LorasVar: the `mute` list) */
|
|
16120
|
+
mutedWords?(name: string): string[];
|
|
16121
|
+
};
|
|
16122
|
+
/** where a prompt's tag completion comes from (the serve web editor). The list is never shipped:
|
|
16123
|
+
* `url` is a local path (relative to the workflow file, `~/`, `file://`) or an http(s) url */
|
|
16124
|
+
type PromptTagsOpts = {
|
|
16125
|
+
url: string;
|
|
16126
|
+
/** insert `long_hair` as written in the list; default inserts `long hair` */
|
|
16127
|
+
underscores?: boolean;
|
|
16128
|
+
/** put in front of an artist tag on insert (Anima: `@`) */
|
|
16129
|
+
artistPrefix?: string;
|
|
16130
|
+
};
|
|
16131
|
+
type PromptVarOpts = {
|
|
16132
|
+
label?: string;
|
|
16133
|
+
loraKeywordsFrom?: ActiveLoraSource;
|
|
16134
|
+
presets?: VarPresetSpec;
|
|
16135
|
+
/** booru tag completion for this prompt: a tag list url, or the url with its insert rules */
|
|
16136
|
+
tags?: string | PromptTagsOpts;
|
|
16137
|
+
/** false when the model's encoder ignores `(text:1.2)`: the editor then flags every weight */
|
|
16138
|
+
weights?: boolean;
|
|
16056
16139
|
};
|
|
16057
16140
|
/** what a prompt CONTRIBUTES to build: `vars.prompt.positive` / `.negative` */
|
|
16058
16141
|
type PromptValue = {
|
|
@@ -16062,28 +16145,28 @@ type PromptValue = {
|
|
|
16062
16145
|
/**
|
|
16063
16146
|
* prompt text with editor comforts, all resolved at BUILD time (the editor and
|
|
16064
16147
|
* drafts keep the raw text):
|
|
16065
|
-
* - `//`
|
|
16148
|
+
* - `//` starts a COMMENT to the end of the line (src/vars/promptSyntax.ts) — stripped
|
|
16066
16149
|
* - `- ` lines are NEGATIVE prompt lines — removed from `.positive`,
|
|
16067
16150
|
* comma-joined into `.negative`
|
|
16068
16151
|
* - with `loraKeywordsFrom`, the ACTIVE loras' hand-assigned keywords
|
|
16069
16152
|
* (src/vars/loraKeywords.ts, ⌃K in the TUI) prefix `.positive` —
|
|
16070
16153
|
* `injectedKeywords()` is public so the TUI can PREVIEW the injection.
|
|
16071
16154
|
*/
|
|
16072
|
-
declare class PromptVar extends ComfyVarBase<
|
|
16073
|
-
promptOpts:
|
|
16074
|
-
label?: string;
|
|
16075
|
-
loraKeywordsFrom?: ActiveLoraSource;
|
|
16076
|
-
presets?: VarPresetSpec;
|
|
16077
|
-
};
|
|
16155
|
+
declare class PromptVar extends ComfyVarBase<PromptInput, PromptValue> {
|
|
16156
|
+
promptOpts: PromptVarOpts;
|
|
16078
16157
|
readonly kind: 'prompt';
|
|
16079
16158
|
/** normalized `promptOpts.presets`, in authored order (TextVarOpts.presets owns the WHY) */
|
|
16080
16159
|
readonly presets: VarPreset[];
|
|
16081
|
-
constructor(defaultValue:
|
|
16082
|
-
|
|
16083
|
-
loraKeywordsFrom?: ActiveLoraSource;
|
|
16084
|
-
presets?: VarPresetSpec;
|
|
16085
|
-
});
|
|
16160
|
+
constructor(defaultValue: PromptInput, promptOpts?: PromptVarOpts);
|
|
16161
|
+
/** in lanes mode the text carries `# name` headers, so a lane survives a round trip */
|
|
16086
16162
|
parse(raw: string): boolean;
|
|
16163
|
+
toEditBuffer(): string;
|
|
16164
|
+
/** a var list shows the lanes by name, the inactive ones in parentheses */
|
|
16165
|
+
display(): string;
|
|
16166
|
+
/** the text the build reads: the plain string, or the active lanes joined in order */
|
|
16167
|
+
get text(): string;
|
|
16168
|
+
/** the tag list options in their one object form, null when this prompt has no completion */
|
|
16169
|
+
get tags(): PromptTagsOpts | null;
|
|
16087
16170
|
static isCommentLine(line: string): boolean;
|
|
16088
16171
|
static isNegativeLine(line: string): boolean;
|
|
16089
16172
|
/** the keyword prefix the flag will inject (deduped, lora-list order) — the TUI previews this */
|
|
@@ -16162,25 +16245,65 @@ declare class ToggleVar extends ComfyVar<boolean> {
|
|
|
16162
16245
|
parse(raw: string): boolean;
|
|
16163
16246
|
display(): string;
|
|
16164
16247
|
}
|
|
16248
|
+
/** how many options a choice holds: exactly one (the default), one or none, or any number */
|
|
16249
|
+
type ChoiceSelect = 'one' | 'zero-or-one' | 'many';
|
|
16165
16250
|
declare class ChoiceVar<T extends string> extends ComfyVar<T> {
|
|
16166
16251
|
readonly choices: readonly T[];
|
|
16167
16252
|
readonly kind: 'choice';
|
|
16253
|
+
readonly select: 'one';
|
|
16168
16254
|
constructor(choices: readonly T[], defaultValue: T, label?: string);
|
|
16169
16255
|
next(delta?: number): this;
|
|
16170
16256
|
parse(raw: string): boolean;
|
|
16171
16257
|
}
|
|
16172
|
-
/**
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
|
|
16176
|
-
|
|
16258
|
+
/** one option or none: `null` is "nothing picked", clicking the lit option clears it */
|
|
16259
|
+
declare class OptionalChoiceVar<T extends string> extends ComfyVar<T | null> {
|
|
16260
|
+
readonly choices: readonly T[];
|
|
16261
|
+
readonly kind: 'choice';
|
|
16262
|
+
readonly select: 'zero-or-one';
|
|
16263
|
+
constructor(choices: readonly T[], defaultValue: T | null, label?: string);
|
|
16264
|
+
/** pick `c`, or clear it when it is already the one picked */
|
|
16265
|
+
toggle(c: T): this;
|
|
16266
|
+
/** the TUI text form: a choice, or an empty line for none */
|
|
16267
|
+
parse(raw: string): boolean;
|
|
16268
|
+
toEditBuffer(): string;
|
|
16269
|
+
/** a draft from when this was a many choice holds a list: its first known option */
|
|
16270
|
+
loadJSON(value: unknown): this;
|
|
16271
|
+
display(): string;
|
|
16272
|
+
}
|
|
16273
|
+
/** any number of options, kept in the order the choices list them */
|
|
16274
|
+
declare class MultiChoiceVar<T extends string> extends ComfyVar<T[]> {
|
|
16275
|
+
readonly choices: readonly T[];
|
|
16276
|
+
readonly kind: 'choice';
|
|
16277
|
+
readonly select: 'many';
|
|
16278
|
+
constructor(choices: readonly T[], defaultValue: readonly T[], label?: string);
|
|
16279
|
+
toggle(c: T): this;
|
|
16280
|
+
/** the TUI text form: `a, b` */
|
|
16281
|
+
parse(raw: string): boolean;
|
|
16282
|
+
toEditBuffer(): string;
|
|
16283
|
+
/** a draft from when this was a single choice holds one value: a list of one. Unknown
|
|
16284
|
+
* options are dropped, the list comes back in the choices order */
|
|
16285
|
+
loadJSON(value: unknown): this;
|
|
16286
|
+
display(): string;
|
|
16287
|
+
}
|
|
16288
|
+
/** the three choice shapes, told apart by `select` */
|
|
16289
|
+
type AnyChoiceVar<T extends string = string> = ChoiceVar<T> | OptionalChoiceVar<T> | MultiChoiceVar<T>;
|
|
16290
|
+
type ChoiceOpts<S extends ChoiceSelect> = {
|
|
16291
|
+
label?: string;
|
|
16292
|
+
select: S;
|
|
16293
|
+
};
|
|
16294
|
+
declare function choice<const T extends string>(choices: readonly T[], defaultValue: T, label?: string | {
|
|
16295
|
+
label?: string;
|
|
16296
|
+
select?: 'one';
|
|
16297
|
+
}): ChoiceVar<T>;
|
|
16298
|
+
declare function choice<const T extends string>(choices: readonly T[], defaultValue: T | null, opts: ChoiceOpts<'zero-or-one'>): OptionalChoiceVar<T>;
|
|
16299
|
+
declare function choice<const T extends string>(choices: readonly T[], defaultValue: readonly T[], opts: ChoiceOpts<'many'>): MultiChoiceVar<T>;
|
|
16177
16300
|
type ActiveLora<T extends string> = {
|
|
16178
16301
|
lora_name: T;
|
|
16179
16302
|
strength_model: number;
|
|
16180
16303
|
strength_clip: number;
|
|
16181
16304
|
};
|
|
16182
16305
|
/** normalize a loras record into what a standard LoraLoader chain consumes */
|
|
16183
|
-
declare function activeLoras<T extends string>(loras:
|
|
16306
|
+
declare function activeLoras<T extends string>(loras: LorasInput<T>): ActiveLora<T>[];
|
|
16184
16307
|
/** what LorasVar.bindHost needs — structural, so ComfyVars never imports ComfyHost */
|
|
16185
16308
|
type LorasHost = {
|
|
16186
16309
|
data?: {
|
|
@@ -16196,7 +16319,12 @@ type LorasHost = {
|
|
|
16196
16319
|
* or feed it host discovery (`host.schema.getLoras(regex?)`) directly; never
|
|
16197
16320
|
* a hardcoded inventory. Selection is empty by default.
|
|
16198
16321
|
*/
|
|
16199
|
-
|
|
16322
|
+
/**
|
|
16323
|
+
* the value is EITHER a plain record OR `{ lanes: [...] }` (src/vars/lanes.ts): named groups the
|
|
16324
|
+
* build merges in listed order, skipping inactive ones. Every method reads the merged record and
|
|
16325
|
+
* writes into the lane that holds the lora, so the TUI never needs to know lanes exist
|
|
16326
|
+
*/
|
|
16327
|
+
declare class LorasVar<T extends string> extends ComfyVarBase<LorasInput<T>, LoraRecord<T>> {
|
|
16200
16328
|
private readonly optionsSource;
|
|
16201
16329
|
readonly kind: 'loras';
|
|
16202
16330
|
/** last non-false strength per lora, so untick → re-tick restores it */
|
|
@@ -16205,7 +16333,7 @@ declare class LorasVar<T extends string> extends ComfyVar<Partial<Record<T, Lora
|
|
|
16205
16333
|
private resolvedOptions;
|
|
16206
16334
|
/** which host these loras live on, so their metadata is read from ITS mirror */
|
|
16207
16335
|
hostId: string | undefined;
|
|
16208
|
-
constructor(optionsSource: readonly T[] | RegExp, initial?:
|
|
16336
|
+
constructor(optionsSource: readonly T[] | RegExp, initial?: LorasInput<T>, label?: string);
|
|
16209
16337
|
/** the filter the workflow declared, when it declared one (`v.loras(/krea-?2/i)`). Public so
|
|
16210
16338
|
* a UI can SHOW it, and so serve applies the same narrowing to loras only its lora-manager
|
|
16211
16339
|
* mirror knows, an unfiltered union would put the whole catalog back in a filtered picker */
|
|
@@ -16216,6 +16344,14 @@ declare class LorasVar<T extends string> extends ComfyVar<Partial<Record<T, Lora
|
|
|
16216
16344
|
* values of the SAME object_info enum the generated E_LoraName union comes from */
|
|
16217
16345
|
bindHost(host: LorasHost): void;
|
|
16218
16346
|
get names(): T[];
|
|
16347
|
+
/** the loras the build reads: the plain record, or the active lanes merged in order */
|
|
16348
|
+
get record(): LoraRecord<T>;
|
|
16349
|
+
/** what the graph consumes. A lora in two active lanes runs once, with its FIRST setting */
|
|
16350
|
+
outValue(): LoraRecord<T>;
|
|
16351
|
+
/** rewrite one lora wherever it lives: the plain record, or the lane that holds it */
|
|
16352
|
+
private write;
|
|
16353
|
+
/** the parts of this lora's prompt keyword left out of the prompt */
|
|
16354
|
+
mutedWords(name: string): string[];
|
|
16219
16355
|
/** loras currently ON (PromptVar keyword prefixing consumes this) */
|
|
16220
16356
|
activeNames(): T[];
|
|
16221
16357
|
isOn(name: T): boolean;
|
|
@@ -16242,14 +16378,25 @@ type SizePreset = {
|
|
|
16242
16378
|
};
|
|
16243
16379
|
/** SDXL-style ~1MP buckets, multiples of 64 — safe for most latent models */
|
|
16244
16380
|
declare const DEFAULT_SIZE_PRESETS: SizePreset[];
|
|
16381
|
+
/** the same aspect ratios around 512, for SD1.5-era models trained at ~0.25MP */
|
|
16382
|
+
declare const SD15_SIZE_PRESETS: SizePreset[];
|
|
16383
|
+
/** starred presets are one click away in the panel, before the full list */
|
|
16384
|
+
declare const DEFAULT_STARRED_SIZES: string[];
|
|
16385
|
+
/** the family that matches a workflow's own default: a 512×512 workflow is an SD1.5-era one,
|
|
16386
|
+
* and offering it 1024 buckets would be offering sizes it was never trained at */
|
|
16387
|
+
declare function sizePresetsFor(defaultValue: SizeValue | undefined): SizePreset[];
|
|
16245
16388
|
/** width/height picker: presets + free `WxH` entry + optionally the LIVE
|
|
16246
16389
|
* size of a linked image var (the widget shows
|
|
16247
16390
|
* `WxH size of image '<name>'` as a pickable row) */
|
|
16248
16391
|
declare class SizeVar extends ComfyVar<SizeValue> {
|
|
16249
16392
|
readonly presets: SizePreset[];
|
|
16250
16393
|
readonly imageVar?: ImageVar | undefined;
|
|
16394
|
+
/** preset LABELS starred by default; a user's own stars live in the panel */
|
|
16395
|
+
readonly starred: readonly string[];
|
|
16251
16396
|
readonly kind: 'size';
|
|
16252
|
-
constructor(defaultValue?: SizeValue, presets?: SizePreset[], label?: string, imageVar?: ImageVar | undefined
|
|
16397
|
+
constructor(defaultValue?: SizeValue, presets?: SizePreset[], label?: string, imageVar?: ImageVar | undefined,
|
|
16398
|
+
/** preset LABELS starred by default; a user's own stars live in the panel */
|
|
16399
|
+
starred?: readonly string[]);
|
|
16253
16400
|
/** current dimensions of the linked image var — null when no link, unset
|
|
16254
16401
|
* path, or an unreadable/undecodable file (those errors belong to the
|
|
16255
16402
|
* image var itself, the size row simply disappears) */
|
|
@@ -16306,11 +16453,9 @@ declare class ImageVar extends ComfyVar<string> {
|
|
|
16306
16453
|
/** the var constructors: v.text / v.prompt / v.int / v.float / v.seed / v.toggle / v.choice / v.loras / v.size / v.image */
|
|
16307
16454
|
declare const v: {
|
|
16308
16455
|
text: (defaultValue: string, opts?: TextVarOpts | string) => TextVar;
|
|
16309
|
-
prompt: (
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
presets?: VarPresetSpec;
|
|
16313
|
-
}) => PromptVar;
|
|
16456
|
+
prompt: (
|
|
16457
|
+
/** a string, or `{ lanes: [{ name, prompt, active }] }` merged in listed order */
|
|
16458
|
+
defaultValue: PromptInput, opts?: PromptVarOpts) => PromptVar;
|
|
16314
16459
|
int: (defaultValue: number, opts?: {
|
|
16315
16460
|
min?: number;
|
|
16316
16461
|
max?: number;
|
|
@@ -16328,10 +16473,15 @@ declare const v: {
|
|
|
16328
16473
|
mode?: SeedMode;
|
|
16329
16474
|
}) => SeedVar;
|
|
16330
16475
|
toggle: (defaultValue: boolean, label?: string) => ToggleVar;
|
|
16331
|
-
|
|
16332
|
-
|
|
16476
|
+
/** exactly one option (the default), `{ select: 'zero-or-one' }` for one or none (value
|
|
16477
|
+
* `T | null`), `{ select: 'many' }` for any number (value `T[]`) */
|
|
16478
|
+
choice: typeof choice;
|
|
16479
|
+
loras: <T extends string = string>(options: readonly T[] | RegExp,
|
|
16480
|
+
/** a record, or `{ lanes: [{ name, active, loras }] }` merged in listed order */
|
|
16481
|
+
initial?: LorasInput<T>, label?: string) => LorasVar<T>;
|
|
16333
16482
|
size: (defaultValue?: SizeValue, opts?: {
|
|
16334
16483
|
presets?: SizePreset[];
|
|
16484
|
+
starred?: readonly string[];
|
|
16335
16485
|
label?: string;
|
|
16336
16486
|
image?: ImageVar;
|
|
16337
16487
|
}) => SizeVar;
|
|
@@ -16349,6 +16499,7 @@ type AnyVar = {
|
|
|
16349
16499
|
readonly label?: string;
|
|
16350
16500
|
/** the vars-spec key — DefinedWorkflow writes it at define time */
|
|
16351
16501
|
name?: string;
|
|
16502
|
+
readonly uiOpts: VarUi;
|
|
16352
16503
|
parse(raw: string): boolean;
|
|
16353
16504
|
loadJSON(value: unknown): unknown;
|
|
16354
16505
|
reset(): unknown;
|
|
@@ -16375,8 +16526,8 @@ type LoraNameOf<ID extends string> = 'E_LoraName' extends keyof SdkForHost<ID>['
|
|
|
16375
16526
|
* `v.loras(regex)` yields the host's lora-name union (resolved via bindHost)
|
|
16376
16527
|
*/
|
|
16377
16528
|
type BoundVars<ID extends string> = Omit<typeof v, 'loras'> & {
|
|
16378
|
-
loras(options: RegExp, initial?:
|
|
16379
|
-
loras<T extends string>(options: readonly T[], initial?:
|
|
16529
|
+
loras(options: RegExp, initial?: LorasInput<LoraNameOf<ID>>, label?: string): LorasVar<LoraNameOf<ID>>;
|
|
16530
|
+
loras<T extends string>(options: readonly T[], initial?: LorasInput<T>, label?: string): LorasVar<T>;
|
|
16380
16531
|
};
|
|
16381
16532
|
type DefineWorkflowSpec<ID extends string, V extends VarsSpec> = {
|
|
16382
16533
|
/** short id; also names the workflow instances */
|
|
@@ -16392,6 +16543,10 @@ type DefineWorkflowSpec<ID extends string, V extends VarsSpec> = {
|
|
|
16392
16543
|
/** builds the graph from the CURRENT var values; re-executed on every run().
|
|
16393
16544
|
* may be async (e.g. image uploads through the wf param) */
|
|
16394
16545
|
build: (b: SdkForHost<ID>['Builder'], vars: VarValues<V>, wf: ComfyWorkflow<ID>) => void | Promise<void>;
|
|
16546
|
+
/** named texts computed from the CURRENT var values, the same `vars` build receives, shown
|
|
16547
|
+
* live while the vars are edited (the serve panel: a foldable block under generate). Use the
|
|
16548
|
+
* function build uses, so a preview is what the run sends, never a paraphrase of it */
|
|
16549
|
+
previews?: Record<string, (vars: VarValues<V>) => string>;
|
|
16395
16550
|
};
|
|
16396
16551
|
/**
|
|
16397
16552
|
* a re-runnable workflow definition: `build` re-executes per run with the
|
|
@@ -16403,6 +16558,9 @@ declare class DefinedWorkflow<ID extends string = string, V extends VarsSpec = V
|
|
|
16403
16558
|
/** spec.vars resolved once (may be given as a thunk) — the SAME instances for the workflow's lifetime */
|
|
16404
16559
|
readonly vars: V;
|
|
16405
16560
|
constructor(host: ComfyHost<ID>, spec: DefineWorkflowSpec<ID, V>);
|
|
16561
|
+
/** every preview for the current var values. A preview that throws, or vars that cannot be
|
|
16562
|
+
* read yet (an image var still empty), give a line saying so instead of failing the others */
|
|
16563
|
+
computePreviews(): Record<string, string>;
|
|
16406
16564
|
/** [name, var] pairs, for drivers that enumerate the knobs */
|
|
16407
16565
|
entries(): [string, AnyVar][];
|
|
16408
16566
|
/** the workflow built by the latest run() (null before the first run) */
|
|
@@ -16430,6 +16588,19 @@ declare class DefinedWorkflow<ID extends string = string, V extends VarsSpec = V
|
|
|
16430
16588
|
}): Promise<ComfyExecution>;
|
|
16431
16589
|
}
|
|
16432
16590
|
//#endregion
|
|
16591
|
+
//#region src/host/schemaDrift.d.ts
|
|
16592
|
+
type Delta = {
|
|
16593
|
+
added: string[];
|
|
16594
|
+
removed: string[];
|
|
16595
|
+
};
|
|
16596
|
+
type SchemaDrift = {
|
|
16597
|
+
/** null on a light check: node types are only compared by a full one */
|
|
16598
|
+
nodes: Delta | null;
|
|
16599
|
+
models: ({
|
|
16600
|
+
noun: string;
|
|
16601
|
+
} & Delta)[];
|
|
16602
|
+
};
|
|
16603
|
+
//#endregion
|
|
16433
16604
|
//#region src/host/ComfyHost.d.ts
|
|
16434
16605
|
type ComfyHostID = Tagged<string, {
|
|
16435
16606
|
HostID: true;
|
|
@@ -16643,6 +16814,12 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
16643
16814
|
enabled: boolean;
|
|
16644
16815
|
clientId: string;
|
|
16645
16816
|
}) => Promise<void>;
|
|
16817
|
+
/** what changed on the host since this schema was loaded (src/host/schemaDrift.ts). `full: false`
|
|
16818
|
+
* asks only the loaders the schema has, a few KB, so it can run on a timer. Throws when the host
|
|
16819
|
+
* cannot be reached, which is itself the signal a caller watches for a restart */
|
|
16820
|
+
checkSchemaDrift: (p: {
|
|
16821
|
+
full: boolean;
|
|
16822
|
+
}) => Promise<SchemaDrift>;
|
|
16646
16823
|
/** GET a JSON route through host.fetch (/api preferred, bare fallback) */
|
|
16647
16824
|
private fetchJSON_;
|
|
16648
16825
|
/** retrieve the comfy spec from the schema*/
|
|
@@ -17274,6 +17451,8 @@ declare class ComfyTS {
|
|
|
17274
17451
|
resolveFromDrafts(relativePath: string): AbsolutePath;
|
|
17275
17452
|
/** master prompts of the serve web ui's prompt enhancer — hand-editable markdown */
|
|
17276
17453
|
resolveFromPromptEnhancers(relativePath: string): AbsolutePath;
|
|
17454
|
+
/** the serve web ui's LLM configs (prompt enhancer), one json per config */
|
|
17455
|
+
resolveFromLlmConfigs(relativePath: string): AbsolutePath;
|
|
17277
17456
|
resolveFromCache(relativePath: string): AbsolutePath;
|
|
17278
17457
|
/** local TUI settings (preview mode, last draft per workflow) — gitignored */
|
|
17279
17458
|
get settingsPath(): AbsolutePath;
|
|
@@ -17638,5 +17817,5 @@ declare function promptEnhancerPresets(): VarPresetSpec;
|
|
|
17638
17817
|
//#region src/cli/tui-env.d.ts
|
|
17639
17818
|
declare function isTuiActive(): boolean;
|
|
17640
17819
|
//#endregion
|
|
17641
|
-
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 PromptEnhancer, 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, exampleImagePath, 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, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, toPresetList, v };
|
|
17820
|
+
export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyChoiceVar, type AnyVar, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, type ChoiceSelect, 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, DEFAULT_STARRED_SIZES, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, 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, MultiChoiceVar, type NodeMode, NodeOf, OptionalChoiceVar, type ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, 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 Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SD15_SIZE_PRESETS, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarUi, 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, exampleImagePath, 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, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v };
|
|
17642
17821
|
//# sourceMappingURL=index.d.cts.map
|