mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +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)
|
if (items.size === 0)
|
||||||
throw new Error('Cannot convert to subgraph: nothing to convert')
|
throw new Error('Cannot convert to subgraph: nothing to convert')
|
||||||
const { state, revision, config } = this
|
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 {
|
const {
|
||||||
boundaryLinks,
|
boundaryLinks,
|
||||||
|
|||||||
Reference in New Issue
Block a user