comfy-ts 2.7.0 → 2.8.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-BPw-SZYW.js} +106 -157
- package/dist/run-tui-BPw-SZYW.js.map +1 -0
- package/dist/serve-web.js +432 -72
- package/dist/{state-CaHeDL-0.js → state-B-boDz-Z.js} +180 -45
- package/dist/state-B-boDz-Z.js.map +1 -0
- package/dist/web.d.ts +109 -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/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 +243 -30
- 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 +66 -17
- package/src/cli/serve/web/state/RunSt.ts +22 -1
- package/src/cli/serve/web/state/WebSt.ts +518 -14
- 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 +413 -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/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,5 +1,6 @@
|
|
|
1
1
|
// ✨ on a prompt row → the refine modal: openrouter key + thinking model +
|
|
2
2
|
// a library of named master prompts. Nothing touches the var until APPLY.
|
|
3
|
+
import { Icon } from 'src/cli/serve/web/components/Icon.tsx'
|
|
3
4
|
import { observer } from 'mobx-react-lite'
|
|
4
5
|
import { useEffect } from 'react'
|
|
5
6
|
import type { ProviderId, ReasoningEffort } from 'src/cli/serve/web/llm.ts'
|
|
@@ -70,12 +71,12 @@ const Settings = observer(function Settings(p: { e: EnhancerSt }) {
|
|
|
70
71
|
style={{ flex: 1 }}
|
|
71
72
|
/>
|
|
72
73
|
)}
|
|
73
|
-
<label className="row-inline"
|
|
74
|
+
<label className="row-inline" data-tip="hide models that report no reasoning support">
|
|
74
75
|
<input type="checkbox" checked={p.e.thinkingOnly} onChange={() => p.e.toggleThinkingOnly()} />
|
|
75
76
|
<span className="hint">thinking only</span>
|
|
76
77
|
</label>
|
|
77
78
|
{local ? null : (
|
|
78
|
-
<label className="row-inline"
|
|
79
|
+
<label className="row-inline" data-tip="reasoning effort sent to the model">
|
|
79
80
|
<span className="hint">effort</span>
|
|
80
81
|
<select value={p.e.effort} onChange={(ev) => p.e.setEffort(ev.target.value)}>
|
|
81
82
|
{EFFORTS.map((x) => (
|
|
@@ -146,8 +147,8 @@ const MasterPrompt = observer(function MasterPrompt(p: { e: EnhancerSt }) {
|
|
|
146
147
|
<button type="button" onClick={rename}>
|
|
147
148
|
rename
|
|
148
149
|
</button>
|
|
149
|
-
<button type="button" onClick={remove}
|
|
150
|
-
|
|
150
|
+
<button type="button" onClick={remove} data-tip="delete this master prompt file">
|
|
151
|
+
<Icon name="close" />
|
|
151
152
|
</button>
|
|
152
153
|
<span className="hint">
|
|
153
154
|
{p.e.saveState === 'saving' ? 'saving…' : null}
|
|
@@ -179,9 +180,11 @@ const Modal = observer(function Modal(p: { e: EnhancerSt }) {
|
|
|
179
180
|
<div className="modal-overlay" onClick={() => e.close()}>
|
|
180
181
|
<div className="modal" onClick={(ev) => ev.stopPropagation()}>
|
|
181
182
|
<div className="modal-head">
|
|
182
|
-
<b style={{ flex: 1 }}
|
|
183
|
+
<b style={{ flex: 1 }}>
|
|
184
|
+
<Icon name="sparkle" /> enhance prompt
|
|
185
|
+
</b>
|
|
183
186
|
<button type="button" onClick={() => e.close()}>
|
|
184
|
-
|
|
187
|
+
<Icon name="close" />
|
|
185
188
|
</button>
|
|
186
189
|
</div>
|
|
187
190
|
<div className="modal-body">
|
|
@@ -217,7 +220,7 @@ const Modal = observer(function Modal(p: { e: EnhancerSt }) {
|
|
|
217
220
|
stop
|
|
218
221
|
</button>
|
|
219
222
|
) : (
|
|
220
|
-
<button type="button" className="primary" onClick={() => e.run()}
|
|
223
|
+
<button type="button" className="primary" onClick={() => e.run()} data-tip="⌘⏎ / ctrl+⏎">
|
|
221
224
|
enhance
|
|
222
225
|
</button>
|
|
223
226
|
)}
|
|
@@ -243,10 +246,10 @@ export const PromptEnhancer = observer(function PromptEnhancer(p: { v: VarSt; st
|
|
|
243
246
|
<button
|
|
244
247
|
type="button"
|
|
245
248
|
className="link"
|
|
246
|
-
|
|
249
|
+
data-tip="rewrite this prompt with an llm"
|
|
247
250
|
onClick={() => e.openFor({ v: p.v, module: p.module })}
|
|
248
251
|
>
|
|
249
|
-
|
|
252
|
+
<Icon name="sparkle" /> enhance
|
|
250
253
|
</button>
|
|
251
254
|
{e.target === p.v ? <Modal e={e} /> : null}
|
|
252
255
|
</>
|
|
@@ -1,29 +1,53 @@
|
|
|
1
|
-
// module → drafts navigation + module load errors, mirrors the TUI tree's job
|
|
1
|
+
// module → drafts navigation + module load errors, mirrors the TUI tree's job.
|
|
2
|
+
// A TREE: folder, then its workflows, then their drafts, the folder is part of
|
|
3
|
+
// what identifies a workflow, and eating it made six workflows look like a flat list
|
|
2
4
|
import { observer } from 'mobx-react-lite'
|
|
5
|
+
import { Icon } from 'src/cli/serve/web/components/Icon.tsx'
|
|
6
|
+
import { groupModulesByFolder } from 'src/cli/serve/web/state/moduleTree.ts'
|
|
3
7
|
import type { WebSt } from 'src/cli/serve/web/state/WebSt.ts'
|
|
4
8
|
|
|
5
9
|
export const Sidebar = observer(function Sidebar(p: { st: WebSt }) {
|
|
10
|
+
const groups = groupModulesByFolder(p.st.modules)
|
|
6
11
|
return (
|
|
7
12
|
<div className="sidebar">
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
{/* it opens from the WORKFLOW head box, which nothing announces: a way OUT that is
|
|
14
|
+
visible from inside is what makes that discoverable, and it says where it is */}
|
|
15
|
+
<div className="side-head">
|
|
16
|
+
<span>workflows</span>
|
|
17
|
+
<button
|
|
18
|
+
type="button"
|
|
19
|
+
data-tip="close — reopen it by clicking the workflow name"
|
|
20
|
+
onClick={() => p.st.toggleSidebar()}
|
|
21
|
+
>
|
|
22
|
+
<Icon name="close" />
|
|
23
|
+
</button>
|
|
24
|
+
</div>
|
|
25
|
+
{groups.map((group) => (
|
|
26
|
+
<div key={group.folder} className="side-group">
|
|
27
|
+
{group.folder === '' ? null : <div className="side-folder">{group.folder}/</div>}
|
|
28
|
+
<div className="side-branch">
|
|
29
|
+
{group.modules.map((mod) => (
|
|
30
|
+
<div key={mod.module}>
|
|
31
|
+
<div className="side-module">
|
|
32
|
+
<span className="name">{mod.module}</span>
|
|
33
|
+
<span className="host">{mod.host}</span>
|
|
34
|
+
</div>
|
|
35
|
+
{mod.drafts.map((draft) => {
|
|
36
|
+
const sel = p.st.form?.moduleKey === mod.module && p.st.form?.draft === draft
|
|
37
|
+
return (
|
|
38
|
+
<button
|
|
39
|
+
key={draft}
|
|
40
|
+
type="button"
|
|
41
|
+
className={sel ? 'side-draft sel' : 'side-draft'}
|
|
42
|
+
onClick={() => void p.st.select({ module: mod.module, draft })}
|
|
43
|
+
>
|
|
44
|
+
{draft}
|
|
45
|
+
</button>
|
|
46
|
+
)
|
|
47
|
+
})}
|
|
48
|
+
</div>
|
|
49
|
+
))}
|
|
13
50
|
</div>
|
|
14
|
-
{mod.drafts.map((draft) => {
|
|
15
|
-
const sel = p.st.form?.moduleKey === mod.module && p.st.form?.draft === draft
|
|
16
|
-
return (
|
|
17
|
-
<button
|
|
18
|
-
key={draft}
|
|
19
|
-
type="button"
|
|
20
|
-
className={sel ? 'side-draft sel' : 'side-draft'}
|
|
21
|
-
onClick={() => void p.st.select({ module: mod.module, draft })}
|
|
22
|
-
>
|
|
23
|
-
{draft}
|
|
24
|
-
</button>
|
|
25
|
-
)
|
|
26
|
-
})}
|
|
27
51
|
</div>
|
|
28
52
|
))}
|
|
29
53
|
{Object.keys(p.st.loadErrors).length > 0 ? (
|