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
package/dist/web.js CHANGED
@@ -101,7 +101,7 @@ function getComfyStorage() {
101
101
  }
102
102
  //#endregion
103
103
  //#region package.json
104
- var version = "2.17.0";
104
+ var version = "2.17.1";
105
105
  //#endregion
106
106
  //#region src/litegraph/LiteGraphLinkID.ts
107
107
  const asLiteGraphLinkID = (id) => id;
@@ -1704,20 +1704,40 @@ const convertFlowToLiteGraphJSON = (graph) => {
1704
1704
  const convertNodeToLiteGraphNode = (ctx, node) => {
1705
1705
  const inputs = [];
1706
1706
  const widgets_values = [];
1707
+ const pushLinked = (name, type, link, shape) => {
1708
+ const nodeUidNumber = bang(ctx.graph.nodes.find((n) => n.uid === link[0])?.uidNumber, `link target node "${link[0]}" not found in graph`);
1709
+ const linkId = ctx.allocateLink(nodeUidNumber, link[1], node.uidNumber, asLiteGraphSlotIndex(inputs.length), type);
1710
+ inputs.push(shape == null ? {
1711
+ name,
1712
+ type,
1713
+ link: linkId
1714
+ } : {
1715
+ name,
1716
+ type,
1717
+ shape,
1718
+ link: linkId
1719
+ });
1720
+ };
1707
1721
  for (const ipt of node.$schema.inputs) {
1708
- const raw = node.serializeValue(ipt.nameInComfy, node.json.inputs[ipt.nameInComfy]);
1709
1722
  const kind = classifySchemaInput(ipt);
1710
- if (_isLink(raw)) {
1711
- const nodeUidNumber = bang(ctx.graph.nodes.find((n) => n.uid === raw[0])?.uidNumber, `link target node "${raw[0]}" not found in graph`);
1712
- inputs.push({
1713
- name: ipt.nameInComfy,
1714
- type: ipt.typeName,
1715
- link: ctx.allocateLink(nodeUidNumber, raw[1], node.uidNumber, asLiteGraphSlotIndex(inputs.length), ipt.typeName)
1716
- });
1717
- } else if (kind.kind === "widget") {
1723
+ if (kind.kind === "dynamic-container") {
1724
+ const type = containerInstanceSlotType(ipt.opts) ?? "*";
1725
+ for (const instance of kind.instanceNames) {
1726
+ const name = `${ipt.nameInComfy}.${instance}`;
1727
+ const value = node.json.inputs[name];
1728
+ if (value == null) continue;
1729
+ const raw = node.serializeValue(name, value);
1730
+ 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`);
1731
+ pushLinked(name, type, raw, 7);
1732
+ }
1733
+ continue;
1734
+ }
1735
+ const raw = node.serializeValue(ipt.nameInComfy, node.json.inputs[ipt.nameInComfy]);
1736
+ if (_isLink(raw)) pushLinked(ipt.nameInComfy, ipt.typeName, raw);
1737
+ else if (kind.kind === "widget") {
1718
1738
  widgets_values.push(...kind.prefixValues, raw);
1719
1739
  const phantoms = kind.consumes - 1 - kind.prefixValues.length;
1720
- for (let i = 0; i < phantoms; i++) widgets_values.push(false);
1740
+ for (let i = 0; i < phantoms; i++) widgets_values.push(controlMode(ipt.opts));
1721
1741
  } else inputs.push({
1722
1742
  name: ipt.nameInComfy,
1723
1743
  type: ipt.typeName,
@@ -1740,6 +1760,12 @@ const convertNodeToLiteGraphNode = (ctx, node) => {
1740
1760
  widgets_values
1741
1761
  };
1742
1762
  };
1763
+ /** the editor's control widget is a combo (fixed, increment, decrement, randomize):
1764
+ * a config naming a mode keeps it, anything else is `fixed`, the seed the code pinned */
1765
+ const controlMode = (opts) => {
1766
+ const mode = typeof opts === "object" && opts != null ? Reflect.get(opts, "control_after_generate") : null;
1767
+ return typeof mode === "string" ? mode : "fixed";
1768
+ };
1743
1769
  const _isLink = (v) => {
1744
1770
  return Array.isArray(v) && v.length === 2 && typeof v[0] === "string" && typeof v[1] === "number";
1745
1771
  };