Comfy-Org / Comfy-Org/ComfyUI_frontend

[Bug]: Node outputs not restored when switching workflows or loading from queue context menu

Open
#5,130 0 comments 0 reactions 1 assignee Claimed by @Myestery View on GitHub
area:nodes
Dominant language
TypeScript
Stars
2k
Forks
704
Avg merge
1d 8h
Merged PRs (30d)
512

Description

## Prerequisites

- [x] I am running the latest version of ComfyUI
- [x] I have searched existing issues to make sure this isn't a duplicate
- [x] I have tested with all custom nodes disabled

## What happened?

When switching workflows or loading workflows from the queue context menu, only image/video/audio outputs are restored in the UI. Other forms of node outputs (text, 3D models, custom data) are not restored, even though the workflow executes correctly.

This creates a poor user experience where users lose visibility of their previous results when navigating between workflows in the queue history.

## Steps to Reproduce

1. Create a workflow with nodes that produce non-media outputs (e.g., PreviewAny for text, SaveGLB for 3D files)
2. Queue and execute the workflow - observe that outputs display correctly
3. Switch to a different workflow or create a new one
4. Load the original workflow from the queue context menu (right-click on queue item → "Load Workflow")
5. Observe that only image/video/audio outputs are restored, while text and other outputs are missing

## How is this affecting you?

Feature doesn't work as expected

## ComfyUI Frontend Version

Latest (main branch)

## Browser

Chrome/Chromium

## Console Errors

No console errors - this is a missing feature rather than an error.

## Additional Context

**Technical Analysis:**

The issue occurs because output restoration relies on extensions implementing `onNodeOutputsUpdated()` callback, but most extensions only implement `onExecuted()`.

**Current Implementation (works):**
- `src/extensions/core/uploadAudio.ts:163-180` - Implements `onNodeOutputsUpdated()` for audio restoration

**Missing Implementation (broken):**
- `src/extensions/core/previewAny.ts:34-44` - Only has `onExecuted()`, handles `message.text[0]`
- `src/extensions/core/saveMesh.ts:56-74` - Only has `onExecuted()`, handles `message['3d'][0]`
- `src/extensions/core/load3d.ts:560+` - Only has `onExecuted()`, handles `message.result[0]` and `message.result[1]`

**Root Cause:**
When loading from queue via `TaskItemImpl.loadWorkflow()` in `src/stores/queueStore.ts:376-395`, the system calls:
```typescript
useExtensionService().invokeExtensions('onNodeOutputsUpdated', app.nodeOutputs)
```

Only extensions with `onNodeOutputsUpdated()` callbacks receive this restoration call. Extensions that only implement `onExecuted()` are bypassed during workflow restoration.

**Affected Output Types:**
- Text outputs (PreviewAny nodes)
- 3D model outputs (Load3D, SaveGLB nodes)
- Any custom node outputs that don't implement `onNodeOutputsUpdated()`

**Expected Behavior:**
All node outputs should be restored when loading workflows from queue context menu, maintaining consistency with the behavior after fresh execution.

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-5130-Bug-Node-outputs-not-restored-when-switching-workflows-or-loading-from-queue-contex-2556d73d365081029ca8f9b881473381) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.