comfy-ts 2.11.0 → 2.13.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.
Files changed (122) hide show
  1. package/README.md +1 -0
  2. package/dist/{LogsSt-qtFzOKpu.js → LogsSt-CUeo843w.js} +51 -7
  3. package/dist/LogsSt-CUeo843w.js.map +1 -0
  4. package/dist/cli.js +4 -4
  5. package/dist/index.cjs +595 -73
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +286 -46
  8. package/dist/index.d.ts +286 -46
  9. package/dist/index.js +591 -74
  10. package/dist/index.js.map +1 -1
  11. package/dist/{run-serve-BK7BA2dn.js → run-serve-DlRBv_Nk.js} +738 -58
  12. package/dist/run-serve-DlRBv_Nk.js.map +1 -0
  13. package/dist/{run-tui-CQyvMf0N.js → run-tui-B5uxm2_l.js} +43 -18
  14. package/dist/run-tui-B5uxm2_l.js.map +1 -0
  15. package/dist/{schemaDrift-DjjEtwfx.js → schemaDrift-E95iTF7E.js} +473 -60
  16. package/dist/schemaDrift-E95iTF7E.js.map +1 -0
  17. package/dist/serve-web.js +710 -174
  18. package/dist/{state--wrz0BQc.js → state-CUp2J1Zy.js} +126 -14
  19. package/dist/state-CUp2J1Zy.js.map +1 -0
  20. package/dist/web.d.ts +286 -46
  21. package/dist/web.js +591 -74
  22. package/dist/web.js.map +1 -1
  23. package/examples/comfy-cloud/sdk.d.ts +163 -163
  24. package/examples/rvion/06-qwen-image-edit.cflow.ts +3 -2
  25. package/examples/rvion/10-anima-t2i.cflow.ts +252 -0
  26. package/examples/rvion/11-yue2-t2a.cflow.ts +105 -0
  27. package/examples/rvion/12-stable-audio-3-t2a.cflow.ts +78 -0
  28. package/examples/rvion/13-ace-step-15-xl-t2a.cflow.ts +153 -0
  29. package/examples/rvion/stableAudio3Prompts.ts +19 -0
  30. package/extra/README.md +4 -0
  31. package/extra/comfyui-fresh-model-lists/README.md +25 -0
  32. package/extra/comfyui-fresh-model-lists/__init__.py +36 -0
  33. package/extra/comfyui-fresh-model-lists/test_fresh_model_lists.py +97 -0
  34. package/package.json +15 -7
  35. package/src/cli/draftMeta.ts +39 -0
  36. package/src/cli/serve/ServeApp.ts +305 -30
  37. package/src/cli/serve/applyVarPayload.ts +50 -22
  38. package/src/cli/serve/byteRange.ts +48 -0
  39. package/src/cli/serve/describeVar.ts +42 -6
  40. package/src/cli/serve/llmConfigShape.ts +51 -0
  41. package/src/cli/serve/llmConfigs.ts +52 -0
  42. package/src/cli/serve/run-serve.ts +12 -3
  43. package/src/cli/serve/tagList.ts +92 -0
  44. package/src/cli/serve/tagSource.ts +69 -0
  45. package/src/cli/serve/web/api.ts +72 -0
  46. package/src/cli/serve/web/components/App.tsx +485 -44
  47. package/src/cli/serve/web/components/DraftTabs.tsx +167 -0
  48. package/src/cli/serve/web/components/Gallery.tsx +133 -31
  49. package/src/cli/serve/web/components/HistoryPicker.tsx +149 -0
  50. package/src/cli/serve/web/components/Icon.tsx +58 -2
  51. package/src/cli/serve/web/components/MenuButton.tsx +53 -0
  52. package/src/cli/serve/web/components/Omnibox.tsx +135 -0
  53. package/src/cli/serve/web/components/PromptEnhancer.tsx +476 -180
  54. package/src/cli/serve/web/components/SideMenu.tsx +414 -0
  55. package/src/cli/serve/web/components/TooltipLayer.tsx +46 -0
  56. package/src/cli/serve/web/components/VarIcon.tsx +24 -0
  57. package/src/cli/serve/web/components/VarsForm.tsx +223 -351
  58. package/src/cli/serve/web/components/controls/BasicControls.tsx +57 -32
  59. package/src/cli/serve/web/components/controls/LorasControl.tsx +646 -317
  60. package/src/cli/serve/web/components/controls/PresetPicker.tsx +1 -1
  61. package/src/cli/serve/web/components/controls/PromptControl.tsx +279 -0
  62. package/src/cli/serve/web/components/controls/PromptEditor.tsx +113 -0
  63. package/src/cli/serve/web/components/controls/SeedControl.tsx +17 -10
  64. package/src/cli/serve/web/components/controls/SizeControl.tsx +111 -18
  65. package/src/cli/serve/web/components/modKey.ts +2 -0
  66. package/src/cli/serve/web/llm.ts +23 -12
  67. package/src/cli/serve/web/promptEditor/promptExtensions.ts +284 -0
  68. package/src/cli/serve/web/state/EnhancerSt.ts +431 -101
  69. package/src/cli/serve/web/state/FormSt.ts +214 -30
  70. package/src/cli/serve/web/state/OmniboxSt.ts +59 -0
  71. package/src/cli/serve/web/state/WebSt.ts +364 -80
  72. package/src/cli/serve/web/state/choiceButtons.ts +61 -0
  73. package/src/cli/serve/web/state/draftNames.ts +16 -0
  74. package/src/cli/serve/web/state/draftTabs.ts +75 -0
  75. package/src/cli/serve/web/state/generateButton.ts +16 -0
  76. package/src/cli/serve/web/state/history.ts +54 -0
  77. package/src/cli/serve/web/state/host.ts +5 -2
  78. package/src/cli/serve/web/state/keptLines.ts +53 -0
  79. package/src/cli/serve/web/state/latentMode.ts +20 -0
  80. package/src/cli/serve/web/state/loraSort.ts +18 -0
  81. package/src/cli/serve/web/state/moduleTree.ts +2 -2
  82. package/src/cli/serve/web/state/omnibox.ts +133 -0
  83. package/src/cli/serve/web/state/payload.ts +38 -58
  84. package/src/cli/serve/web/state/shortcuts.ts +103 -0
  85. package/src/cli/serve/web/state/sizeStars.ts +31 -0
  86. package/src/cli/serve/web/state/stableSlots.ts +21 -0
  87. package/src/cli/serve/web/state/varGroups.ts +24 -0
  88. package/src/cli/serve/web/styles.ts +653 -154
  89. package/src/cli/serve/webBundle.ts +54 -10
  90. package/src/cli/serve/workflowTags.ts +42 -0
  91. package/src/cli/serve/workspaceLabels.ts +23 -0
  92. package/src/cli/tui/components/PickerOverlays.tsx +9 -2
  93. package/src/cli/tui/imagePicker/ImagePickerSt.ts +1 -1
  94. package/src/cli/tui/state/DraftsSt.ts +28 -8
  95. package/src/cli/tui/state/EditorSt.ts +1 -1
  96. package/src/cli/tui/state/LorasSt.ts +1 -1
  97. package/src/cli/tui/state/PickerSt.ts +25 -7
  98. package/src/cli/tui/state/SettingsSt.ts +1 -1
  99. package/src/cli/tui/state/TuiSt.ts +10 -0
  100. package/src/coreExports.ts +21 -0
  101. package/src/host/ComfyHost.ts +17 -2
  102. package/src/host/ResilientWebsocket.ts +54 -4
  103. package/src/host/loraInfoCache.ts +6 -0
  104. package/src/runner/ComfyExecution.ts +60 -0
  105. package/src/runner/ComfyWorkflow.ts +4 -0
  106. package/src/runner/ComfyWsApi.ts +2 -0
  107. package/src/runner/MediaImage.ts +2 -2
  108. package/src/sdk-generator/ComfyUIObjectInfoTypes.ts +5 -5
  109. package/src/sdk-generator/comfyui-sdk-codegen.ts +1 -1
  110. package/src/state.ts +5 -0
  111. package/src/utils/copyName.ts +12 -0
  112. package/src/vars/ComfyVars.ts +337 -67
  113. package/src/vars/DefinedWorkflow.ts +47 -20
  114. package/src/vars/lanes.ts +238 -0
  115. package/src/vars/loraEntry.ts +101 -0
  116. package/src/vars/promptSyntax.ts +382 -0
  117. package/dist/LogsSt-qtFzOKpu.js.map +0 -1
  118. package/dist/run-serve-BK7BA2dn.js.map +0 -1
  119. package/dist/run-tui-CQyvMf0N.js.map +0 -1
  120. package/dist/schemaDrift-DjjEtwfx.js.map +0 -1
  121. package/dist/state--wrz0BQc.js.map +0 -1
  122. package/src/cli/serve/web/components/Sidebar.tsx +0 -66
@@ -1,37 +1,10 @@
1
- // the small per-kind controls: prompt, text, int/float, toggle, choice —
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 { PromptEnhancer } from 'src/cli/serve/web/components/PromptEnhancer.tsx'
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
- const value = typeof p.v.value === 'string' ? p.v.value : ''
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