|
1 | | -import { LGraphCanvas, LiteGraph } from '@comfyorg/litegraph' |
| 1 | +import { LiteGraph } from '@comfyorg/litegraph' |
2 | 2 | import { LGraphNode, type NodeId } from '@comfyorg/litegraph/dist/LGraphNode' |
3 | 3 |
|
4 | 4 | import { t } from '@/i18n' |
@@ -1583,57 +1583,6 @@ export class GroupNodeHandler { |
1583 | 1583 | } |
1584 | 1584 | } |
1585 | 1585 |
|
1586 | | -function addConvertToGroupOptions() { |
1587 | | - // @ts-expect-error fixme ts strict error |
1588 | | - function addConvertOption(options, index) { |
1589 | | - const selected = Object.values(app.canvas.selected_nodes ?? {}) |
1590 | | - const disabled = |
1591 | | - selected.length < 2 || |
1592 | | - selected.find((n) => GroupNodeHandler.isGroupNode(n)) |
1593 | | - options.splice(index, null, { |
1594 | | - content: `Convert to Group Node`, |
1595 | | - disabled, |
1596 | | - callback: convertSelectedNodesToGroupNode |
1597 | | - }) |
1598 | | - } |
1599 | | - |
1600 | | - // @ts-expect-error fixme ts strict error |
1601 | | - function addManageOption(options, index) { |
1602 | | - const groups = app.graph.extra?.groupNodes |
1603 | | - const disabled = !groups || !Object.keys(groups).length |
1604 | | - options.splice(index, null, { |
1605 | | - content: `Manage Group Nodes`, |
1606 | | - disabled, |
1607 | | - callback: () => manageGroupNodes() |
1608 | | - }) |
1609 | | - } |
1610 | | - |
1611 | | - // Add to canvas |
1612 | | - const getCanvasMenuOptions = LGraphCanvas.prototype.getCanvasMenuOptions |
1613 | | - LGraphCanvas.prototype.getCanvasMenuOptions = function () { |
1614 | | - // @ts-expect-error fixme ts strict error |
1615 | | - const options = getCanvasMenuOptions.apply(this, arguments) |
1616 | | - const index = options.findIndex((o) => o?.content === 'Add Group') |
1617 | | - const insertAt = index === -1 ? options.length - 1 : index + 2 |
1618 | | - addConvertOption(options, insertAt) |
1619 | | - addManageOption(options, insertAt + 1) |
1620 | | - return options |
1621 | | - } |
1622 | | - |
1623 | | - // Add to nodes |
1624 | | - const getNodeMenuOptions = LGraphCanvas.prototype.getNodeMenuOptions |
1625 | | - LGraphCanvas.prototype.getNodeMenuOptions = function (node) { |
1626 | | - // @ts-expect-error fixme ts strict error |
1627 | | - const options = getNodeMenuOptions.apply(this, arguments) |
1628 | | - if (!GroupNodeHandler.isGroupNode(node)) { |
1629 | | - const index = options.findIndex((o) => o?.content === 'Properties') |
1630 | | - const insertAt = index === -1 ? options.length - 1 : index |
1631 | | - addConvertOption(options, insertAt) |
1632 | | - } |
1633 | | - return options |
1634 | | - } |
1635 | | -} |
1636 | | - |
1637 | 1586 | const replaceLegacySeparators = (nodes: ComfyNode[]): void => { |
1638 | 1587 | for (const node of nodes) { |
1639 | 1588 | if (typeof node.type === 'string' && node.type.startsWith('workflow/')) { |
@@ -1723,9 +1672,6 @@ const ext: ComfyExtension = { |
1723 | 1672 | } |
1724 | 1673 | } |
1725 | 1674 | ], |
1726 | | - setup() { |
1727 | | - addConvertToGroupOptions() |
1728 | | - }, |
1729 | 1675 | async beforeConfigureGraph( |
1730 | 1676 | graphData: ComfyWorkflowJSON, |
1731 | 1677 | missingNodeTypes: string[] |
|
0 commit comments