refactor(litegraph): mint clone UUID after configure() instead of up front

Amp-Thread-ID: https://ampcode.com/threads/T-019e3d8c-b6b4-731e-b3fb-9bdb6fefb1ae
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
DrJKL
2026-05-18 20:00:49 -07:00
parent eb805b6760
commit 8f98d8fa6b

View File

@@ -1022,11 +1022,9 @@ export class LGraphNode
// @ts-expect-error Exceptional case: id is removed so that the graph can assign a new one on add.
data.id = undefined
const clonedUuid = LiteGraph.use_uuids ? LiteGraph.uuidv4() : undefined
node.id = this.id
node.configure(data)
if (clonedUuid !== undefined) node.id = clonedUuid
if (LiteGraph.use_uuids) node.id = LiteGraph.uuidv4()
return node
}