Skip to content

Commit ced55b1

Browse files
committed
Remove deprecated group node conversion menu
1 parent bdae544 commit ced55b1

File tree

1 file changed

+1
-55
lines changed

1 file changed

+1
-55
lines changed

src/extensions/core/groupNode.ts

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LGraphCanvas, LiteGraph } from '@comfyorg/litegraph'
1+
import { LiteGraph } from '@comfyorg/litegraph'
22
import { LGraphNode, type NodeId } from '@comfyorg/litegraph/dist/LGraphNode'
33

44
import { t } from '@/i18n'
@@ -1583,57 +1583,6 @@ export class GroupNodeHandler {
15831583
}
15841584
}
15851585

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-
16371586
const replaceLegacySeparators = (nodes: ComfyNode[]): void => {
16381587
for (const node of nodes) {
16391588
if (typeof node.type === 'string' && node.type.startsWith('workflow/')) {
@@ -1723,9 +1672,6 @@ const ext: ComfyExtension = {
17231672
}
17241673
}
17251674
],
1726-
setup() {
1727-
addConvertToGroupOptions()
1728-
},
17291675
async beforeConfigureGraph(
17301676
graphData: ComfyWorkflowJSON,
17311677
missingNodeTypes: string[]

0 commit comments

Comments
 (0)