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,8 +1,8 @@
|
|
|
1
1
|
// web ui bundle resolution (architecture item 12, web ui): prebuilt
|
|
2
2
|
// dist/serve-web.js next to the running module, else an in-memory Bun.build
|
|
3
|
-
// from source (src/ ships in the npm tarball),
|
|
4
|
-
// without a UI, never crash
|
|
5
|
-
import { existsSync, readFileSync } from 'node:fs'
|
|
3
|
+
// from source (src/ ships in the npm tarball), rebuilt when a source file changes,
|
|
4
|
+
// else null — the api must serve without a UI, never crash
|
|
5
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'
|
|
6
6
|
import { fileURLToPath } from 'node:url'
|
|
7
7
|
import { dirname, join } from 'pathe'
|
|
8
8
|
|
|
@@ -43,11 +43,42 @@ export async function buildWebJsText(pkgRoot: string): Promise<string> {
|
|
|
43
43
|
return await result.outputs[0].text()
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
/**
|
|
46
|
+
/** changes whenever a file under `dir` is added, removed or rewritten. The web bundle reaches
|
|
47
|
+
* outside web/ (vars, protocol types), so the whole src/ tree is the input: ~300 stats, a few ms */
|
|
48
|
+
export function sourceSignature(dir: string): string {
|
|
49
|
+
let count = 0
|
|
50
|
+
let newest = 0
|
|
51
|
+
let bytes = 0
|
|
52
|
+
const walk = (d: string): void => {
|
|
53
|
+
for (const entry of readdirSync(d, { withFileTypes: true })) {
|
|
54
|
+
const abs = join(d, entry.name)
|
|
55
|
+
if (entry.isDirectory()) walk(abs)
|
|
56
|
+
else if (entry.isFile()) {
|
|
57
|
+
const st = statSync(abs)
|
|
58
|
+
count += 1
|
|
59
|
+
bytes += st.size
|
|
60
|
+
newest = Math.max(newest, st.mtimeMs)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
walk(dir)
|
|
65
|
+
return `${count}:${bytes}:${newest}`
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let prebuiltJs: string | null = null
|
|
69
|
+
let fromSource: { signature: string; js: Promise<string | null> } | null = null
|
|
70
|
+
|
|
71
|
+
/** the runtime resolution chain; every miss logs loud and degrades to api-only. Called on every
|
|
72
|
+
* page load: a prebuilt file is read once, a source build is redone only when src/ changed, so
|
|
73
|
+
* an edited panel shows on refresh under `bun --watch`, which never sees the bundled files */
|
|
47
74
|
export async function loadOrBuildWebJs(): Promise<string | null> {
|
|
48
75
|
const here = dirname(fileURLToPath(import.meta.url))
|
|
49
76
|
const prebuilt = join(here, 'serve-web.js')
|
|
50
|
-
if (
|
|
77
|
+
if (prebuiltJs != null) return prebuiltJs
|
|
78
|
+
if (existsSync(prebuilt)) {
|
|
79
|
+
prebuiltJs = readFileSync(prebuilt, 'utf8')
|
|
80
|
+
return prebuiltJs
|
|
81
|
+
}
|
|
51
82
|
if (typeof Bun === 'undefined') {
|
|
52
83
|
console.error('[serve] 🔴 no serve-web.js next to the cli and not running under bun — api only, no web ui')
|
|
53
84
|
return null
|
|
@@ -57,10 +88,23 @@ export async function loadOrBuildWebJs(): Promise<string | null> {
|
|
|
57
88
|
console.error(`[serve] 🔴 web ui source not found (looked for ${WEB_ENTRY} above ${here}) — api only, no web ui`)
|
|
58
89
|
return null
|
|
59
90
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
91
|
+
const signature = sourceSignature(join(pkgRoot, 'src'))
|
|
92
|
+
if (fromSource?.signature !== signature) {
|
|
93
|
+
const rebuilt = fromSource != null
|
|
94
|
+
// a failed build stays failed for this signature: logged once, retried on the next edit
|
|
95
|
+
fromSource = {
|
|
96
|
+
signature,
|
|
97
|
+
js: buildWebJsText(pkgRoot).then(
|
|
98
|
+
(js) => {
|
|
99
|
+
if (rebuilt) console.log('[serve] web ui rebuilt from source')
|
|
100
|
+
return js
|
|
101
|
+
},
|
|
102
|
+
(e: unknown) => {
|
|
103
|
+
console.error('[serve] 🔴 web ui bundle failed — api only until the next edit:', e)
|
|
104
|
+
return null
|
|
105
|
+
},
|
|
106
|
+
),
|
|
107
|
+
}
|
|
65
108
|
}
|
|
109
|
+
return await fromSource.js
|
|
66
110
|
}
|
|
@@ -26,11 +26,18 @@ export const ChoiceOverlay = observer((p: { st: TuiSt }) => {
|
|
|
26
26
|
node: (
|
|
27
27
|
<Text key={opt} inverse={ix === pk.ix}>
|
|
28
28
|
{ix === pk.ix ? '▸ ' : ' '}
|
|
29
|
+
{pk.isPicked(opt) ? '● ' : '○ '}
|
|
29
30
|
{opt}
|
|
30
31
|
</Text>
|
|
31
32
|
),
|
|
32
33
|
}))}
|
|
33
|
-
footer={
|
|
34
|
+
footer={
|
|
35
|
+
options.length === 0 ? (
|
|
36
|
+
<Text color="red">no match</Text>
|
|
37
|
+
) : pk.choiceIsMany ? (
|
|
38
|
+
<Text color="gray">⏎ toggles · esc done</Text>
|
|
39
|
+
) : undefined
|
|
40
|
+
}
|
|
34
41
|
/>
|
|
35
42
|
)
|
|
36
43
|
})
|
|
@@ -41,7 +48,7 @@ export const PresetOverlay = observer((p: { st: TuiSt }) => {
|
|
|
41
48
|
const s = p.st
|
|
42
49
|
const pk = s.picker
|
|
43
50
|
const options = pk.presetOptions
|
|
44
|
-
const current = pk.presetVar?.
|
|
51
|
+
const current = pk.presetVar?.toEditBuffer().trim() ?? ''
|
|
45
52
|
return (
|
|
46
53
|
<OverlayList
|
|
47
54
|
title={
|
|
@@ -13,6 +13,7 @@ import { dirname, join } from 'pathe'
|
|
|
13
13
|
import { moduleName } from 'src/cli/tui/treeRows.ts'
|
|
14
14
|
import { extractErrorMessage } from 'src/utils/extractErrorMessage.ts'
|
|
15
15
|
import type { TuiMode, TuiSt } from 'src/cli/tui/state/TuiSt.ts'
|
|
16
|
+
import { isDraftRecord, preserveDraftMeta } from 'src/cli/draftMeta.ts'
|
|
16
17
|
|
|
17
18
|
/** module basename (`01-txt2img`) keys the draft folder — knowable for EVERY tree file without importing it */
|
|
18
19
|
export function draftKeyForFile(file: string): string {
|
|
@@ -51,7 +52,7 @@ export class DraftsSt {
|
|
|
51
52
|
(json) => {
|
|
52
53
|
if (json != null && this.active != null) this.write(this.active, json)
|
|
53
54
|
},
|
|
54
|
-
{ delay:
|
|
55
|
+
{ delay: this.st.timing.autosaveMs },
|
|
55
56
|
),
|
|
56
57
|
)
|
|
57
58
|
}
|
|
@@ -73,10 +74,11 @@ export class DraftsSt {
|
|
|
73
74
|
return Object.fromEntries(this.st.entries.map(([k, varDef]) => [k, varDef.toJSON()]))
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
// the TUI knows only the var values: what the panel stored beside them ($enhance) stays
|
|
76
78
|
private write(name: string, json: string): void {
|
|
77
79
|
const path = join(this.dir, `${name}.json`)
|
|
78
80
|
mkdirSync(dirname(path), { recursive: true })
|
|
79
|
-
writeFileSync(path, json)
|
|
81
|
+
writeFileSync(path, keepDraftMeta(path, json))
|
|
80
82
|
this.version++
|
|
81
83
|
}
|
|
82
84
|
|
|
@@ -271,3 +273,17 @@ export class DraftsSt {
|
|
|
271
273
|
this.st.mode = 'nav'
|
|
272
274
|
}
|
|
273
275
|
}
|
|
276
|
+
|
|
277
|
+
/** the new json, plus the `$` keys the file on disk already carried (src/cli/draftMeta.ts) */
|
|
278
|
+
function keepDraftMeta(path: string, json: string): string {
|
|
279
|
+
if (!existsSync(path)) return json
|
|
280
|
+
let previous: unknown
|
|
281
|
+
try {
|
|
282
|
+
previous = JSON.parse(readFileSync(path, 'utf8'))
|
|
283
|
+
} catch {
|
|
284
|
+
return json
|
|
285
|
+
}
|
|
286
|
+
const next: unknown = JSON.parse(json)
|
|
287
|
+
if (!isDraftRecord(previous) || !isDraftRecord(next)) return json
|
|
288
|
+
return JSON.stringify(preserveDraftMeta(previous, next), null, 2)
|
|
289
|
+
}
|
|
@@ -63,7 +63,7 @@ export class EditorSt {
|
|
|
63
63
|
const sel = this.st.selected?.[1]
|
|
64
64
|
if (sel == null) return
|
|
65
65
|
this.st.mode = 'overlay-text'
|
|
66
|
-
this.buffer =
|
|
66
|
+
this.buffer = sel.toEditBuffer()
|
|
67
67
|
this.cursor = [...this.buffer].length
|
|
68
68
|
this.invalid = false
|
|
69
69
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { makeAutoObservable } from 'mobx'
|
|
2
2
|
import { fuzzyMatch } from 'src/utils/fuzzyMatch.ts'
|
|
3
|
-
import type {
|
|
3
|
+
import type { AnyChoiceVar, PromptVar, SizeVar, TextVar } from 'src/vars/ComfyVars.ts'
|
|
4
4
|
import type { VarPreset } from 'src/vars/presets.ts'
|
|
5
5
|
import type { TuiSt } from 'src/cli/tui/state/TuiSt.ts'
|
|
6
6
|
|
|
@@ -25,9 +25,21 @@ export class PickerSt {
|
|
|
25
25
|
imageSizeRow: string | null = null
|
|
26
26
|
|
|
27
27
|
// kind-narrowing casts sanctioned (agent/coding.md), `kind` is the tag
|
|
28
|
-
private get choiceVar():
|
|
28
|
+
private get choiceVar(): AnyChoiceVar<string> | null {
|
|
29
29
|
const sel = this.st.selected?.[1]
|
|
30
|
-
return sel?.kind === 'choice' ? (sel as
|
|
30
|
+
return sel?.kind === 'choice' ? (sel as AnyChoiceVar<string>) : null
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** is this option currently picked (one, one or none, or one of many) */
|
|
34
|
+
isPicked(option: string): boolean {
|
|
35
|
+
const cv = this.choiceVar
|
|
36
|
+
if (cv == null) return false
|
|
37
|
+
return cv.select === 'many' ? cv.value.includes(option) : cv.value === option
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** a many-choice stays open after ⏎: you toggle several, esc leaves */
|
|
41
|
+
get choiceIsMany(): boolean {
|
|
42
|
+
return this.choiceVar?.select === 'many'
|
|
31
43
|
}
|
|
32
44
|
|
|
33
45
|
private get sizeVar(): SizeVar | null {
|
|
@@ -76,7 +88,8 @@ export class PickerSt {
|
|
|
76
88
|
this.st.mode = 'overlay-choice'
|
|
77
89
|
this.filter = ''
|
|
78
90
|
this.invalid = false
|
|
79
|
-
|
|
91
|
+
const first = cv.select === 'many' ? cv.value[0] : cv.value
|
|
92
|
+
this.ix = Math.max(0, first == null ? 0 : cv.choices.indexOf(first))
|
|
80
93
|
}
|
|
81
94
|
|
|
82
95
|
/** `P` on a text/prompt var that declares presets. A var without any stays on `nav`:
|
|
@@ -87,7 +100,7 @@ export class PickerSt {
|
|
|
87
100
|
this.st.mode = 'overlay-preset'
|
|
88
101
|
this.filter = ''
|
|
89
102
|
this.invalid = false
|
|
90
|
-
const value = pv.
|
|
103
|
+
const value = pv.toEditBuffer().trim()
|
|
91
104
|
const ix = pv.presets.findIndex((x) => x.text.trim() === value)
|
|
92
105
|
this.ix = ix === -1 ? 0 : ix
|
|
93
106
|
}
|
|
@@ -142,9 +155,14 @@ export class PickerSt {
|
|
|
142
155
|
}
|
|
143
156
|
const cv = this.choiceVar
|
|
144
157
|
if (cv != null) {
|
|
145
|
-
const hit = this.options[this.ix]
|
|
158
|
+
const hit = cv.choices.find((c) => c === this.options[this.ix])
|
|
146
159
|
if (hit == null) return
|
|
147
|
-
cv.
|
|
160
|
+
if (cv.select === 'many') {
|
|
161
|
+
cv.toggle(hit)
|
|
162
|
+
return
|
|
163
|
+
}
|
|
164
|
+
if (cv.select === 'zero-or-one') cv.toggle(hit)
|
|
165
|
+
else cv.set(hit)
|
|
148
166
|
this.st.mode = 'nav'
|
|
149
167
|
return
|
|
150
168
|
}
|
|
@@ -41,6 +41,9 @@ export type TuiMode =
|
|
|
41
41
|
* ROOT of the TUI state tree (one instance per run). Children are service
|
|
42
42
|
* classes with an `st` backref; components are stateless views over this.
|
|
43
43
|
*/
|
|
44
|
+
export type TuiTiming = { previewMs: number; autosaveMs: number }
|
|
45
|
+
export const TUI_TIMING: TuiTiming = { previewMs: 120, autosaveMs: 300 }
|
|
46
|
+
|
|
44
47
|
export class TuiSt {
|
|
45
48
|
wf: DefinedWorkflow
|
|
46
49
|
mode: TuiMode = 'nav'
|
|
@@ -86,6 +89,9 @@ export class TuiSt {
|
|
|
86
89
|
logs: LogsSt
|
|
87
90
|
settings: SettingsSt
|
|
88
91
|
|
|
92
|
+
/** the debounces the sub-stores run on */
|
|
93
|
+
readonly timing: TuiTiming
|
|
94
|
+
|
|
89
95
|
/** owned cleanups (reactions, listeners) — flushed by dispose() */
|
|
90
96
|
disposers: (() => void)[] = []
|
|
91
97
|
onExit: () => void = () => {}
|
|
@@ -99,15 +105,19 @@ export class TuiSt {
|
|
|
99
105
|
bundledFiles?: Set<string>
|
|
100
106
|
/** modules that failed to load before mount (red rows in the tree) */
|
|
101
107
|
loadErrors?: Map<string, string>
|
|
108
|
+
/** tests set these to a few ms rather than wait them out */
|
|
109
|
+
timing?: TuiTiming
|
|
102
110
|
} = {},
|
|
103
111
|
) {
|
|
104
112
|
this.wf = wf
|
|
113
|
+
this.timing = opts.timing ?? TUI_TIMING
|
|
105
114
|
// wf: observableRef so switching workflows re-renders without proxying
|
|
106
115
|
// the foreign object; children manage their own observability
|
|
107
116
|
makeAutoObservable(this, {
|
|
108
117
|
wf: observableRef,
|
|
109
118
|
hostOverride: observableRef,
|
|
110
119
|
onExit: false,
|
|
120
|
+
timing: false,
|
|
111
121
|
editor: false,
|
|
112
122
|
picker: false,
|
|
113
123
|
loras: false,
|
package/src/coreExports.ts
CHANGED
|
@@ -85,11 +85,16 @@ export {
|
|
|
85
85
|
SeedVar,
|
|
86
86
|
ToggleVar,
|
|
87
87
|
ChoiceVar,
|
|
88
|
+
OptionalChoiceVar,
|
|
89
|
+
MultiChoiceVar,
|
|
88
90
|
LorasVar,
|
|
89
91
|
SizeVar,
|
|
90
92
|
ImageVar,
|
|
91
93
|
ImageVarEmptyError,
|
|
92
94
|
DEFAULT_SIZE_PRESETS,
|
|
95
|
+
SD15_SIZE_PRESETS,
|
|
96
|
+
DEFAULT_STARRED_SIZES,
|
|
97
|
+
sizePresetsFor,
|
|
93
98
|
DEFAULT_IMAGE_EXTENSIONS,
|
|
94
99
|
activeLoras,
|
|
95
100
|
} from 'src/vars/ComfyVars.ts'
|
|
@@ -97,6 +102,9 @@ export type {
|
|
|
97
102
|
AnyVar,
|
|
98
103
|
VarKind,
|
|
99
104
|
VarsSpec,
|
|
105
|
+
VarUi,
|
|
106
|
+
AnyChoiceVar,
|
|
107
|
+
ChoiceSelect,
|
|
100
108
|
VarValues,
|
|
101
109
|
PromptValue,
|
|
102
110
|
ActiveLoraSource,
|
|
@@ -107,8 +115,20 @@ export type {
|
|
|
107
115
|
SizePreset,
|
|
108
116
|
ImageVarOpts,
|
|
109
117
|
TextVarOpts,
|
|
118
|
+
PromptVarOpts,
|
|
119
|
+
PromptTagsOpts,
|
|
110
120
|
} from 'src/vars/ComfyVars.ts'
|
|
111
121
|
export { toPresetList, activePresetLabel, type VarPreset, type VarPresetSpec } from 'src/vars/presets.ts'
|
|
122
|
+
export type {
|
|
123
|
+
PromptInput,
|
|
124
|
+
PromptLane,
|
|
125
|
+
PromptLanes,
|
|
126
|
+
LorasInput,
|
|
127
|
+
LoraLane,
|
|
128
|
+
LoraLanes,
|
|
129
|
+
LoraRecord,
|
|
130
|
+
} from 'src/vars/lanes.ts'
|
|
131
|
+
export type { LoraEntry } from 'src/vars/loraEntry.ts'
|
|
112
132
|
export { DefinedWorkflow, type DefineWorkflowSpec, type BoundVars, type LoraNameOf } from 'src/vars/DefinedWorkflow.ts'
|
|
113
133
|
export {
|
|
114
134
|
clearLoraKeywordOverride,
|
|
@@ -333,3 +333,9 @@ export function loraMatchesFilter(name: string, filter: string, hostId?: string)
|
|
|
333
333
|
const fields = [...loraSearchNames(name, hostId), ...loraSearchText(name, hostId)].map((f) => f.toLowerCase())
|
|
334
334
|
return tokens.every((token) => fields.some((field) => field.includes(token)))
|
|
335
335
|
}
|
|
336
|
+
|
|
337
|
+
/** the loras a host lists that the local copy of its lora manager list does not know yet:
|
|
338
|
+
* downloaded after the last sync, so they have no name, preview or trigger words here */
|
|
339
|
+
export function lorasMissingFromMirror(hostLoras: readonly string[], inMirror: (name: string) => boolean): string[] {
|
|
340
|
+
return hostLoras.filter((n) => !inMirror(n))
|
|
341
|
+
}
|
package/src/state.ts
CHANGED
|
@@ -110,6 +110,11 @@ export class ComfyTS {
|
|
|
110
110
|
return asAbsolutePath(join(this.baseFolder, 'prompt-enhancers', relativePath))
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
/** the serve web ui's LLM configs (prompt enhancer), one json per config */
|
|
114
|
+
resolveFromLlmConfigs(relativePath: string): AbsolutePath {
|
|
115
|
+
return asAbsolutePath(join(this.baseFolder, 'llm-configs', relativePath))
|
|
116
|
+
}
|
|
117
|
+
|
|
113
118
|
resolveFromCache(relativePath: string): AbsolutePath {
|
|
114
119
|
return asAbsolutePath(join(this.baseFolder, 'cache', relativePath))
|
|
115
120
|
}
|