fix: use getTitle() to find nodes by display name in getNodeRefsByTitle

The getNodeRefsByTitle function was using n.title === title, which only
works for nodes with an explicitly set title property. Nodes without a
custom title (most nodes) fall back to constructor.title, which is set
from the node's display_name during registration.

Using getTitle() instead properly returns this.title || this.constructor.title,
allowing selectNodes to work with display names like 'VAE Decode' and
'Load Checkpoint'.

Amp-Thread-ID: https://ampcode.com/threads/T-019c17d8-6930-748a-bd55-2370f17af8ea
This commit is contained in:
bymyself
2026-01-31 22:21:40 -08:00
parent be2693f3b5
commit 0ff153693e

View File

@@ -1605,7 +1605,7 @@ export class ComfyPage {
(
await this.page.evaluate((title) => {
return window['app'].graph.nodes
.filter((n: LGraphNode) => n.title === title)
.filter((n: LGraphNode) => n.getTitle() === title)
.map((n: LGraphNode) => n.id)
}, title)
).map((id: NodeId) => this.getNodeRefById(id))