comfy-ts 2.11.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-qtFzOKpu.js → LogsSt-U1H0mP1m.js} +35 -5
- package/dist/LogsSt-U1H0mP1m.js.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/index.cjs +473 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +191 -31
- package/dist/index.d.ts +191 -31
- package/dist/index.js +469 -63
- package/dist/index.js.map +1 -1
- package/dist/{run-serve-BK7BA2dn.js → run-serve-BeAznay5.js} +461 -43
- package/dist/run-serve-BeAznay5.js.map +1 -0
- package/dist/{run-tui-CQyvMf0N.js → run-tui-BTGjvnKk.js} +43 -18
- package/dist/run-tui-BTGjvnKk.js.map +1 -0
- package/dist/{schemaDrift-DjjEtwfx.js → schemaDrift-Cg39vs53.js} +470 -60
- package/dist/schemaDrift-Cg39vs53.js.map +1 -0
- package/dist/serve-web.js +508 -134
- package/dist/{state--wrz0BQc.js → state-C7REnHan.js} +7 -3
- package/dist/{state--wrz0BQc.js.map → state-C7REnHan.js.map} +1 -1
- package/dist/web.d.ts +191 -31
- package/dist/web.js +469 -63
- package/dist/web.js.map +1 -1
- package/examples/rvion/06-qwen-image-edit.cflow.ts +3 -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 +15 -7
- package/src/cli/draftMeta.ts +39 -0
- package/src/cli/serve/ServeApp.ts +148 -12
- package/src/cli/serve/applyVarPayload.ts +50 -22
- package/src/cli/serve/describeVar.ts +42 -6
- 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 +48 -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 -188
- package/src/cli/serve/web/components/controls/BasicControls.tsx +57 -32
- package/src/cli/serve/web/components/controls/LorasControl.tsx +644 -317
- 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 +219 -74
- 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 +18 -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 +457 -118
- package/src/cli/serve/webBundle.ts +54 -10
- 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/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/loraInfoCache.ts +6 -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/LogsSt-qtFzOKpu.js.map +0 -1
- package/dist/run-serve-BK7BA2dn.js.map +0 -1
- package/dist/run-tui-CQyvMf0N.js.map +0 -1
- package/dist/schemaDrift-DjjEtwfx.js.map +0 -1
- package/src/cli/serve/web/components/Sidebar.tsx +0 -66
|
@@ -1,37 +1,10 @@
|
|
|
1
|
-
// the small per-kind controls:
|
|
2
|
-
// bigger kinds (seed, size, loras, image) have their own files
|
|
1
|
+
// the small per-kind controls: text, int/float, toggle, choice —
|
|
2
|
+
// bigger kinds (prompt, seed, size, loras, image) have their own files
|
|
3
3
|
import { observer } from 'mobx-react-lite'
|
|
4
4
|
import { PresetPicker } from 'src/cli/serve/web/components/controls/PresetPicker.tsx'
|
|
5
|
-
import {
|
|
5
|
+
import { VarIcon } from 'src/cli/serve/web/components/VarIcon.tsx'
|
|
6
|
+
import { choiceAsButtons, clickChoice, pickedChoices } from 'src/cli/serve/web/state/choiceButtons.ts'
|
|
6
7
|
import type { VarSt } from 'src/cli/serve/web/state/FormSt.ts'
|
|
7
|
-
import type { WebSt } from 'src/cli/serve/web/state/WebSt.ts'
|
|
8
|
-
|
|
9
|
-
export const PromptControl = observer(function PromptControl(p: { v: VarSt; st: WebSt; module: string }) {
|
|
10
|
-
const text = typeof p.v.value === 'string' ? p.v.value : ''
|
|
11
|
-
const rows = Math.min(12, Math.max(4, text.split('\n').length + 1))
|
|
12
|
-
// what the ACTIVE loras will prepend at build time: invisible until now, so the prompt you
|
|
13
|
-
// read here was not the prompt that ran
|
|
14
|
-
const injected = p.st.form?.loraKeywordsFor(p.v) ?? []
|
|
15
|
-
return (
|
|
16
|
-
<div>
|
|
17
|
-
{injected.length > 0 ? (
|
|
18
|
-
<div className="kw-prefix" data-tip="added in front of your prompt at run time, one per active lora">
|
|
19
|
-
{injected.map((kw) => (
|
|
20
|
-
<span key={kw} className="kw-chip">
|
|
21
|
-
{kw}
|
|
22
|
-
</span>
|
|
23
|
-
))}
|
|
24
|
-
</div>
|
|
25
|
-
) : null}
|
|
26
|
-
<textarea rows={rows} value={text} onChange={(e) => p.v.set(e.target.value)} />
|
|
27
|
-
<div className="row-inline">
|
|
28
|
-
<span className="hint">// line = comment · "- " line = negative prompt</span>
|
|
29
|
-
<PresetPicker v={p.v} />
|
|
30
|
-
<PromptEnhancer v={p.v} st={p.st} module={p.module} />
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
)
|
|
34
|
-
})
|
|
35
8
|
|
|
36
9
|
export const TextControl = observer(function TextControl(p: { v: VarSt }) {
|
|
37
10
|
const text = typeof p.v.value === 'string' ? p.v.value : ''
|
|
@@ -108,7 +81,59 @@ export const ToggleControl = observer(function ToggleControl(p: { v: VarSt }) {
|
|
|
108
81
|
|
|
109
82
|
export const ChoiceControl = observer(function ChoiceControl(p: { v: VarSt }) {
|
|
110
83
|
const choices = p.v.desc.choices ?? []
|
|
111
|
-
|
|
84
|
+
// one (the default), zero-or-one (null = none picked), many (a list)
|
|
85
|
+
const select = p.v.desc.select ?? 'one'
|
|
86
|
+
const picked = pickedChoices(p.v.value)
|
|
87
|
+
const looks = p.v.desc.ui?.options ?? {}
|
|
88
|
+
const click = (c: string): void => p.v.set(clickChoice({ select, choices, value: p.v.value, c }))
|
|
89
|
+
// a stale draft value is said, never shown as if one of the buttons were lit
|
|
90
|
+
const stale = picked.filter((x) => !choices.includes(x))
|
|
91
|
+
const staleNote =
|
|
92
|
+
stale.length > 0 ? (
|
|
93
|
+
<span className="hint">{stale.join(', ')} (not on this host)</span>
|
|
94
|
+
) : select === 'one' && picked.length === 0 ? (
|
|
95
|
+
<span className="hint">(unset)</span>
|
|
96
|
+
) : null
|
|
97
|
+
// many choices can always be several buttons at once: a select holds one value only
|
|
98
|
+
if (choiceAsButtons(choices) || select !== 'one')
|
|
99
|
+
return (
|
|
100
|
+
<span className="row-inline">
|
|
101
|
+
<span className="btn-group wrap">
|
|
102
|
+
{choices.map((c) => {
|
|
103
|
+
// the workflow's look for THIS option: its icon, and its color for the lit fill
|
|
104
|
+
const look = looks[c]
|
|
105
|
+
const on = picked.includes(c)
|
|
106
|
+
return (
|
|
107
|
+
<button
|
|
108
|
+
key={c}
|
|
109
|
+
type="button"
|
|
110
|
+
className={on ? 'sel' : ''}
|
|
111
|
+
data-tip={
|
|
112
|
+
select === 'many'
|
|
113
|
+
? `${on ? 'on' : 'off'}: click to toggle`
|
|
114
|
+
: select === 'zero-or-one' && on
|
|
115
|
+
? 'click again to pick none'
|
|
116
|
+
: undefined
|
|
117
|
+
}
|
|
118
|
+
style={
|
|
119
|
+
look?.color == null
|
|
120
|
+
? undefined
|
|
121
|
+
: on
|
|
122
|
+
? { background: look.color, borderColor: look.color }
|
|
123
|
+
: { color: look.color }
|
|
124
|
+
}
|
|
125
|
+
onClick={() => click(c)}
|
|
126
|
+
>
|
|
127
|
+
{look?.icon == null ? null : <VarIcon icon={look.icon} color={undefined} />}
|
|
128
|
+
{c}
|
|
129
|
+
</button>
|
|
130
|
+
)
|
|
131
|
+
})}
|
|
132
|
+
</span>
|
|
133
|
+
{staleNote}
|
|
134
|
+
</span>
|
|
135
|
+
)
|
|
136
|
+
const value = picked[0] ?? ''
|
|
112
137
|
return (
|
|
113
138
|
<select value={value} onChange={(e) => p.v.set(e.target.value)}>
|
|
114
139
|
{/* honest display for a value outside the current union (stale draft): the
|