comfy-ts 2.17.0 → 2.17.1

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 (37) hide show
  1. package/dist/{ServeApp-BSA5yzxZ.js → ServeApp-qXcQfdgT.js} +3 -3
  2. package/dist/ServeApp-qXcQfdgT.js.map +1 -0
  3. package/dist/cli.js +58 -8
  4. package/dist/cli.js.map +1 -1
  5. package/dist/index.cjs +37 -11
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.js +37 -11
  8. package/dist/index.js.map +1 -1
  9. package/dist/{run-run-DnaMLCFn.js → run-run-tg82jUIk.js} +3 -3
  10. package/dist/{run-run-DnaMLCFn.js.map → run-run-tg82jUIk.js.map} +1 -1
  11. package/dist/{run-serve-CbKxIu6i.js → run-serve-DaXzoVTS.js} +58 -12
  12. package/dist/run-serve-DaXzoVTS.js.map +1 -0
  13. package/dist/{run-tui-B0AQWbad.js → run-tui-Bw7BA75d.js} +3 -3
  14. package/dist/{run-tui-B0AQWbad.js.map → run-tui-Bw7BA75d.js.map} +1 -1
  15. package/dist/serve-web.js +56 -48
  16. package/dist/{state-C2oDiQ26.js → state-zTow5ucI.js} +38 -12
  17. package/dist/state-zTow5ucI.js.map +1 -0
  18. package/dist/web.js +37 -11
  19. package/dist/web.js.map +1 -1
  20. package/package.json +2 -2
  21. package/src/cli/bunHop.ts +49 -0
  22. package/src/cli/comfy-ts-cli.ts +4 -4
  23. package/src/cli/serve/run-serve.ts +51 -13
  24. package/src/cli/serve/web/components/App.tsx +2 -0
  25. package/src/cli/serve/web/components/DialogLayer.tsx +55 -0
  26. package/src/cli/serve/web/components/DraftTabs.tsx +8 -3
  27. package/src/cli/serve/web/components/PromptEnhancer.tsx +15 -9
  28. package/src/cli/serve/web/components/SideMenu.tsx +16 -8
  29. package/src/cli/serve/web/state/WebSt.ts +10 -1
  30. package/src/cli/serve/web/state/dialog.ts +59 -0
  31. package/src/cli/serve/web/state/keptLines.ts +1 -1
  32. package/src/cli/serve/web/styles.ts +8 -0
  33. package/src/litegraph/convertFlowToLiteGraphJSON.ts +38 -20
  34. package/src/promptEnhancers.ts +1 -1
  35. package/dist/ServeApp-BSA5yzxZ.js.map +0 -1
  36. package/dist/run-serve-CbKxIu6i.js.map +0 -1
  37. package/dist/state-C2oDiQ26.js.map +0 -1
@@ -850,7 +850,7 @@ var ComfySchema = class {
850
850
  };
851
851
  //#endregion
852
852
  //#region package.json
853
- var version = "2.17.0";
853
+ var version = "2.17.1";
854
854
  //#endregion
855
855
  //#region src/litegraph/LiteGraphLinkID.ts
856
856
  const asLiteGraphLinkID = (id) => id;
@@ -2204,20 +2204,40 @@ const convertFlowToLiteGraphJSON = (graph) => {
2204
2204
  const convertNodeToLiteGraphNode = (ctx, node) => {
2205
2205
  const inputs = [];
2206
2206
  const widgets_values = [];
2207
+ const pushLinked = (name, type, link, shape) => {
2208
+ const nodeUidNumber = bang(ctx.graph.nodes.find((n) => n.uid === link[0])?.uidNumber, `link target node "${link[0]}" not found in graph`);
2209
+ const linkId = ctx.allocateLink(nodeUidNumber, link[1], node.uidNumber, asLiteGraphSlotIndex(inputs.length), type);
2210
+ inputs.push(shape == null ? {
2211
+ name,
2212
+ type,
2213
+ link: linkId
2214
+ } : {
2215
+ name,
2216
+ type,
2217
+ shape,
2218
+ link: linkId
2219
+ });
2220
+ };
2207
2221
  for (const ipt of node.$schema.inputs) {
2208
- const raw = node.serializeValue(ipt.nameInComfy, node.json.inputs[ipt.nameInComfy]);
2209
2222
  const kind = classifySchemaInput(ipt);
2210
- if (_isLink(raw)) {
2211
- const nodeUidNumber = bang(ctx.graph.nodes.find((n) => n.uid === raw[0])?.uidNumber, `link target node "${raw[0]}" not found in graph`);
2212
- inputs.push({
2213
- name: ipt.nameInComfy,
2214
- type: ipt.typeName,
2215
- link: ctx.allocateLink(nodeUidNumber, raw[1], node.uidNumber, asLiteGraphSlotIndex(inputs.length), ipt.typeName)
2216
- });
2217
- } else if (kind.kind === "widget") {
2223
+ if (kind.kind === "dynamic-container") {
2224
+ const type = containerInstanceSlotType(ipt.opts) ?? "*";
2225
+ for (const instance of kind.instanceNames) {
2226
+ const name = `${ipt.nameInComfy}.${instance}`;
2227
+ const value = node.json.inputs[name];
2228
+ if (value == null) continue;
2229
+ const raw = node.serializeValue(name, value);
2230
+ if (!_isLink(raw)) throw new Error(`🔴 [toWorkflowJson] ${node.$schema.nameInComfy}#${node.uid} "${name}" holds a literal; an autogrow instance is a link slot in the editor`);
2231
+ pushLinked(name, type, raw, 7);
2232
+ }
2233
+ continue;
2234
+ }
2235
+ const raw = node.serializeValue(ipt.nameInComfy, node.json.inputs[ipt.nameInComfy]);
2236
+ if (_isLink(raw)) pushLinked(ipt.nameInComfy, ipt.typeName, raw);
2237
+ else if (kind.kind === "widget") {
2218
2238
  widgets_values.push(...kind.prefixValues, raw);
2219
2239
  const phantoms = kind.consumes - 1 - kind.prefixValues.length;
2220
- for (let i = 0; i < phantoms; i++) widgets_values.push(false);
2240
+ for (let i = 0; i < phantoms; i++) widgets_values.push(controlMode(ipt.opts));
2221
2241
  } else inputs.push({
2222
2242
  name: ipt.nameInComfy,
2223
2243
  type: ipt.typeName,
@@ -2240,6 +2260,12 @@ const convertNodeToLiteGraphNode = (ctx, node) => {
2240
2260
  widgets_values
2241
2261
  };
2242
2262
  };
2263
+ /** the editor's control widget is a combo (fixed, increment, decrement, randomize):
2264
+ * a config naming a mode keeps it, anything else is `fixed`, the seed the code pinned */
2265
+ const controlMode = (opts) => {
2266
+ const mode = typeof opts === "object" && opts != null ? Reflect.get(opts, "control_after_generate") : null;
2267
+ return typeof mode === "string" ? mode : "fixed";
2268
+ };
2243
2269
  const _isLink = (v) => {
2244
2270
  return Array.isArray(v) && v.length === 2 && typeof v[0] === "string" && typeof v[1] === "number";
2245
2271
  };
@@ -5224,4 +5250,4 @@ var ComfyTS = class ComfyTS {
5224
5250
  //#endregion
5225
5251
  export { ComfySchema as a, importSharp as i, settingsPathFor as n, readableStringify as r, ComfyTS as t };
5226
5252
 
5227
- //# sourceMappingURL=state-C2oDiQ26.js.map
5253
+ //# sourceMappingURL=state-zTow5ucI.js.map