mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-25 23:25:02 +00:00
## Summary Muted (NEVER mode) subgraph nodes throw "No inner node DTO found" during prompt serialization because `resolveOutput()` falls through to subgraph resolution for nodes whose inner DTOs were never registered. ## Changes - **What**: Add early return in `ExecutableNodeDTO.resolveOutput()` for `NEVER` mode nodes, matching the existing `BYPASS` mode guard. Add 5 tests covering muted, bypassed, and normal mode resolution. ## Review Focus The fix is a single-line early return. The key insight is that `graphToPrompt` in `executionUtil.ts` correctly skips `getInnerNodes()` for muted/bypassed nodes, so their inner DTOs are never in the map — but `resolveOutput()` was missing the corresponding guard for `NEVER` mode. Fixes #8986 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9302-fix-return-undefined-for-muted-node-output-resolution-3156d73d3650811e9697c7281f11cf96) by [Unito](https://www.unito.io)
31 lines
875 B
TypeScript
31 lines
875 B
TypeScript
import { createTestingPinia } from '@pinia/testing'
|
|
import { setActivePinia } from 'pinia'
|
|
import { beforeEach, describe, expect, it } from 'vitest'
|
|
|
|
import {
|
|
LGraph,
|
|
LGraphNode,
|
|
LGraphEventMode
|
|
} from '@/lib/litegraph/src/litegraph'
|
|
|
|
import { ExecutableGroupNodeDTO } from './executableGroupNodeDto'
|
|
|
|
describe('Muted group node output resolution', () => {
|
|
beforeEach(() => {
|
|
setActivePinia(createTestingPinia({ stubActions: false }))
|
|
})
|
|
|
|
it('should return undefined for NEVER mode group nodes', () => {
|
|
const graph = new LGraph()
|
|
const node = new LGraphNode('Muted Group')
|
|
node.addOutput('out', 'IMAGE')
|
|
node.mode = LGraphEventMode.NEVER
|
|
graph.add(node)
|
|
|
|
const dto = new ExecutableGroupNodeDTO(node, [], new Map(), undefined)
|
|
const resolved = dto.resolveOutput(0, 'IMAGE', new Set())
|
|
|
|
expect(resolved).toBeUndefined()
|
|
})
|
|
})
|