comfy-ts 2.7.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/README.md +20 -13
- package/dist/{DefinedWorkflow-BJgt5t0x.js → DefinedWorkflow-BatWaZO1.js} +199 -16
- package/dist/DefinedWorkflow-BatWaZO1.js.map +1 -0
- package/dist/{DraftsSt-dizp3VcC.js → LogsSt-DFxzQfDc.js} +152 -4
- package/dist/LogsSt-DFxzQfDc.js.map +1 -0
- package/dist/cli.js +7 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +284 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +125 -7
- package/dist/index.d.ts +125 -7
- package/dist/index.js +282 -37
- package/dist/index.js.map +1 -1
- package/dist/run-serve-_nrvJYyt.js +1948 -0
- package/dist/run-serve-_nrvJYyt.js.map +1 -0
- package/dist/{run-tui-JxlEbb_f.js → run-tui-BLEdTsOX.js} +106 -157
- package/dist/run-tui-BLEdTsOX.js.map +1 -0
- package/dist/serve-web.js +441 -72
- package/dist/{state-CaHeDL-0.js → state-BbgJeCe6.js} +180 -45
- package/dist/state-BbgJeCe6.js.map +1 -0
- package/dist/web.d.ts +185 -7
- package/dist/web.js +235 -36
- package/dist/web.js.map +1 -1
- package/examples/README.md +1 -0
- package/examples/comfy-cloud/sdk.d.ts +4066 -321
- package/examples/rvion/04-krea2-turbo-t2i.cflow.ts +18 -2
- package/examples/rvion/07-local-llm-text-gen.cflow.ts +220 -0
- package/examples/web/tsconfig.json +3 -0
- package/extra/README.md +32 -0
- package/extra/comfyui-textgen-stream/README.md +35 -0
- package/extra/comfyui-textgen-stream/__init__.py +166 -0
- package/extra/scripts/fetch_text_encoder.py +137 -0
- package/package.json +6 -3
- package/src/cli/comfy-ts-cli.ts +3 -1
- package/src/cli/serve/ServeApp.ts +754 -40
- package/src/cli/serve/applyVarPayload.ts +10 -3
- package/src/cli/serve/describeVar.ts +47 -7
- package/src/cli/serve/hostProtocol.ts +68 -0
- package/src/cli/serve/managerOnlyLoras.ts +27 -0
- package/src/cli/serve/run-serve.ts +35 -38
- package/src/cli/serve/serveSettings.ts +86 -0
- package/src/cli/serve/startupPrint.ts +111 -0
- package/src/cli/serve/web/api.ts +97 -1
- package/src/cli/serve/web/components/App.tsx +61 -22
- package/src/cli/serve/web/components/Gallery.tsx +306 -41
- package/src/cli/serve/web/components/Icon.tsx +160 -0
- package/src/cli/serve/web/components/PromptEnhancer.tsx +12 -9
- package/src/cli/serve/web/components/Sidebar.tsx +43 -19
- package/src/cli/serve/web/components/VarsForm.tsx +440 -91
- package/src/cli/serve/web/components/controls/BasicControls.tsx +38 -5
- package/src/cli/serve/web/components/controls/ImageControl.tsx +3 -2
- package/src/cli/serve/web/components/controls/LorasControl.tsx +498 -81
- package/src/cli/serve/web/components/controls/PresetPicker.tsx +60 -0
- package/src/cli/serve/web/components/controls/SeedControl.tsx +38 -20
- package/src/cli/serve/web/components/controls/SizeControl.tsx +3 -2
- package/src/cli/serve/web/llm.ts +1 -1
- package/src/cli/serve/web/logWeb.ts +6 -0
- package/src/cli/serve/web/state/EnhancerSt.ts +8 -15
- package/src/cli/serve/web/state/FormSt.ts +74 -18
- package/src/cli/serve/web/state/RunSt.ts +22 -1
- package/src/cli/serve/web/state/WebSt.ts +814 -22
- package/src/cli/serve/web/state/host.ts +206 -0
- package/src/cli/serve/web/state/lightbox.ts +44 -0
- package/src/cli/serve/web/state/moduleTree.ts +52 -0
- package/src/cli/serve/web/state/payload.ts +44 -2
- package/src/cli/serve/web/state/urlSelection.ts +53 -0
- package/src/cli/serve/web/styles.ts +422 -57
- package/src/cli/serve/web/tsconfig.json +4 -0
- package/src/cli/tui/components/PickerOverlays.tsx +37 -0
- package/src/cli/tui/components/StatusBar.tsx +14 -1
- package/src/cli/tui/components/TuiApp.tsx +5 -2
- package/src/cli/tui/state/HostSt.ts +3 -2
- package/src/cli/tui/state/PickerSt.ts +48 -2
- package/src/cli/tui/state/TreeSt.ts +1 -1
- package/src/cli/tui/state/TuiSt.ts +2 -1
- package/src/coreExports.ts +8 -1
- package/src/graph/ComfyNode.ts +58 -1
- package/src/host/ComfyHost.ts +13 -2
- package/src/host/ComfyManager.ts +31 -13
- package/src/host/loraInfoCache.ts +35 -1
- package/src/host/loraManagerApi.ts +94 -0
- package/src/index.ts +2 -0
- package/src/promptEnhancers.ts +102 -0
- package/src/runner/ComfyExecution.ts +61 -6
- package/src/runner/ComfyWorkflow.ts +18 -4
- package/src/runner/ComfyWsApi.ts +3 -0
- package/src/runner/describePromptRejection.ts +34 -0
- package/src/sdk-generator/ComfySchema.ts +17 -4
- package/src/sdk-generator/comfyui-sdk-codegen.ts +56 -2
- package/src/utils/ansi.ts +13 -0
- package/src/utils/matchesRegex.ts +13 -0
- package/src/utils/safeName.ts +29 -0
- package/src/utils/stringMap.ts +9 -0
- package/src/vars/ComfyVars.ts +61 -10
- package/src/vars/presets.ts +17 -0
- package/src/web.ts +12 -0
- package/dist/DefinedWorkflow-BJgt5t0x.js.map +0 -1
- package/dist/DraftsSt-dizp3VcC.js.map +0 -1
- package/dist/run-serve-D1Tsuru9.js +0 -1162
- package/dist/run-serve-D1Tsuru9.js.map +0 -1
- package/dist/run-tui-JxlEbb_f.js.map +0 -1
- package/dist/state-CaHeDL-0.js.map +0 -1
- package/src/cli/serve/promptEnhancers.ts +0 -69
- package/src/cli/serve/safeName.ts +0 -12
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// the small per-kind controls: prompt, text, int/float, toggle, choice —
|
|
2
2
|
// bigger kinds (seed, size, loras, image) have their own files
|
|
3
3
|
import { observer } from 'mobx-react-lite'
|
|
4
|
+
import { PresetPicker } from 'src/cli/serve/web/components/controls/PresetPicker.tsx'
|
|
4
5
|
import { PromptEnhancer } from 'src/cli/serve/web/components/PromptEnhancer.tsx'
|
|
5
6
|
import type { VarSt } from 'src/cli/serve/web/state/FormSt.ts'
|
|
6
7
|
import type { WebSt } from 'src/cli/serve/web/state/WebSt.ts'
|
|
@@ -8,11 +9,24 @@ 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 }) {
|
|
9
10
|
const text = typeof p.v.value === 'string' ? p.v.value : ''
|
|
10
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) ?? []
|
|
11
15
|
return (
|
|
12
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}
|
|
13
26
|
<textarea rows={rows} value={text} onChange={(e) => p.v.set(e.target.value)} />
|
|
14
27
|
<div className="row-inline">
|
|
15
28
|
<span className="hint">// line = comment · "- " line = negative prompt</span>
|
|
29
|
+
<PresetPicker v={p.v} />
|
|
16
30
|
<PromptEnhancer v={p.v} st={p.st} module={p.module} />
|
|
17
31
|
</div>
|
|
18
32
|
</div>
|
|
@@ -20,12 +34,31 @@ export const PromptControl = observer(function PromptControl(p: { v: VarSt; st:
|
|
|
20
34
|
})
|
|
21
35
|
|
|
22
36
|
export const TextControl = observer(function TextControl(p: { v: VarSt }) {
|
|
37
|
+
const text = typeof p.v.value === 'string' ? p.v.value : ''
|
|
38
|
+
const presets = p.v.desc.textPresets ?? []
|
|
39
|
+
// `v.text(…, { multiline: true })`: an llm instruction is a paragraph, and a one-line field
|
|
40
|
+
// shows its first few words. Grows with the text like the prompt box does
|
|
41
|
+
if (p.v.desc.multiline === true) {
|
|
42
|
+
const rows = Math.min(12, Math.max(3, text.split('\n').length + 1))
|
|
43
|
+
return (
|
|
44
|
+
<div>
|
|
45
|
+
<textarea rows={rows} value={text} onChange={(e) => p.v.set(e.target.value)} />
|
|
46
|
+
{presets.length > 0 ? (
|
|
47
|
+
<div className="row-inline">
|
|
48
|
+
<PresetPicker v={p.v} />
|
|
49
|
+
</div>
|
|
50
|
+
) : null}
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
if (presets.length === 0) return <input type="text" value={text} onChange={(e) => p.v.set(e.target.value)} />
|
|
55
|
+
// a one-line field keeps the button BESIDE it: a menu under a single input would sit alone
|
|
56
|
+
// on a row of its own, twice the height for one button
|
|
23
57
|
return (
|
|
24
|
-
<
|
|
25
|
-
type="text"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/>
|
|
58
|
+
<div className="row-inline">
|
|
59
|
+
<input type="text" style={{ flex: 1 }} value={text} onChange={(e) => p.v.set(e.target.value)} />
|
|
60
|
+
<PresetPicker v={p.v} />
|
|
61
|
+
</div>
|
|
29
62
|
)
|
|
30
63
|
})
|
|
31
64
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// image: a path/url input the api already accepts, plus a browser upload
|
|
2
2
|
// (POST /upload → local file under outputs/serve-inputs/) and a preview when
|
|
3
3
|
// the value is browser-reachable
|
|
4
|
+
import { Icon } from 'src/cli/serve/web/components/Icon.tsx'
|
|
4
5
|
import { observer } from 'mobx-react-lite'
|
|
5
6
|
import { useRef } from 'react'
|
|
6
7
|
import { uploadFile } from 'src/cli/serve/web/api.ts'
|
|
@@ -41,13 +42,13 @@ export const ImageControl = observer(function ImageControl(p: { v: VarSt }) {
|
|
|
41
42
|
{value !== '' ? (
|
|
42
43
|
<button
|
|
43
44
|
type="button"
|
|
44
|
-
|
|
45
|
+
data-tip="clear the image"
|
|
45
46
|
onClick={() => {
|
|
46
47
|
p.v.set('')
|
|
47
48
|
p.v.setUploadedUrl(null)
|
|
48
49
|
}}
|
|
49
50
|
>
|
|
50
|
-
|
|
51
|
+
<Icon name="close" />
|
|
51
52
|
</button>
|
|
52
53
|
) : null}
|
|
53
54
|
<input
|