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.
- package/dist/{ServeApp-BSA5yzxZ.js → ServeApp-qXcQfdgT.js} +3 -3
- package/dist/ServeApp-qXcQfdgT.js.map +1 -0
- package/dist/cli.js +58 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +37 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -11
- package/dist/index.js.map +1 -1
- package/dist/{run-run-DnaMLCFn.js → run-run-tg82jUIk.js} +3 -3
- package/dist/{run-run-DnaMLCFn.js.map → run-run-tg82jUIk.js.map} +1 -1
- package/dist/{run-serve-CbKxIu6i.js → run-serve-DaXzoVTS.js} +58 -12
- package/dist/run-serve-DaXzoVTS.js.map +1 -0
- package/dist/{run-tui-B0AQWbad.js → run-tui-Bw7BA75d.js} +3 -3
- package/dist/{run-tui-B0AQWbad.js.map → run-tui-Bw7BA75d.js.map} +1 -1
- package/dist/serve-web.js +56 -48
- package/dist/{state-C2oDiQ26.js → state-zTow5ucI.js} +38 -12
- package/dist/state-zTow5ucI.js.map +1 -0
- package/dist/web.js +37 -11
- package/dist/web.js.map +1 -1
- package/package.json +2 -2
- package/src/cli/bunHop.ts +49 -0
- package/src/cli/comfy-ts-cli.ts +4 -4
- package/src/cli/serve/run-serve.ts +51 -13
- package/src/cli/serve/web/components/App.tsx +2 -0
- package/src/cli/serve/web/components/DialogLayer.tsx +55 -0
- package/src/cli/serve/web/components/DraftTabs.tsx +8 -3
- package/src/cli/serve/web/components/PromptEnhancer.tsx +15 -9
- package/src/cli/serve/web/components/SideMenu.tsx +16 -8
- package/src/cli/serve/web/state/WebSt.ts +10 -1
- package/src/cli/serve/web/state/dialog.ts +59 -0
- package/src/cli/serve/web/state/keptLines.ts +1 -1
- package/src/cli/serve/web/styles.ts +8 -0
- package/src/litegraph/convertFlowToLiteGraphJSON.ts +38 -20
- package/src/promptEnhancers.ts +1 -1
- package/dist/ServeApp-BSA5yzxZ.js.map +0 -1
- package/dist/run-serve-CbKxIu6i.js.map +0 -1
- 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.
|
|
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 (
|
|
1711
|
-
const
|
|
1712
|
-
|
|
1713
|
-
name
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
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(
|
|
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
|
};
|