[fix] Update Search & Replace to support nodes in subgraphs (#4576)

This commit is contained in:
Christian Byrne
2025-07-29 00:10:56 -07:00
committed by GitHub
parent 00cd9fadec
commit dd14144f47
5 changed files with 24 additions and 8 deletions

View File

@@ -1,11 +1,14 @@
import type { LGraphNode } from '@comfyorg/litegraph'
import type { LGraph, Subgraph } from '@comfyorg/litegraph'
import { formatDate } from '@/utils/formatUtil'
import { collectAllNodes } from '@/utils/graphTraversalUtil'
export function applyTextReplacements(
allNodes: LGraphNode[],
graph: LGraph | Subgraph,
value: string
): string {
const allNodes = collectAllNodes(graph)
return value.replace(/%([^%]+)%/g, function (match, text) {
const split = text.split('.')
if (split.length !== 2) {