mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-08 17:10:07 +00:00
When converting single group to subgraph, also convert children (#5217)
* On conversion of single group, convert children If convert to subgraph is called on a selection consisting of a single group, the groups children are also converted to subgraph. * Update locales [skip ci] * Create new set to avoid mutating passed argument --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -1482,6 +1482,12 @@ export class LGraph
|
||||
if (items.size === 0)
|
||||
throw new Error('Cannot convert to subgraph: nothing to convert')
|
||||
const { state, revision, config } = this
|
||||
const firstChild = [...items][0]
|
||||
if (items.size === 1 && firstChild instanceof LGraphGroup) {
|
||||
items = new Set([firstChild])
|
||||
firstChild.recomputeInsideNodes()
|
||||
firstChild.children.forEach((n) => items.add(n))
|
||||
}
|
||||
|
||||
const {
|
||||
boundaryLinks,
|
||||
|
||||
Reference in New Issue
Block a user