Comfy-Org / Comfy-Org/ComfyUI_frontend

Switching workflow tabs during a batch run queues the wrong workflow

Open
#13,453 2 comments 0 reactions 0 assignees View on GitHub
area:queue area:workflows Potential Bug
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

### Prerequisites

- [x] I am running the latest version of ComfyUI
- [ ] I have custom nodes enabled

### What happened?

I noticed that if I start a multi-batch run on one workflow and then switch to another workflow tab while the run is still being queued, some of the later queued prompts can come from the newly selected workflow instead.

I expected the whole batch to stay tied to the workflow where I clicked Run. Instead, the queue seems to follow the currently active tab.

This also seems to happen with Run Instant: if I start Run Instant on one workflow and then switch tabs, later instant queues can target the workflow I switched to.

Screenshots

Batch Run:

https://github.com/user-attachments/assets/b78b927e-e27b-4766-8205-af435938c450

Batch Run (Instant):

https://github.com/user-attachments/assets/f277379a-c4f7-4e42-9c7f-22521c8dcbf3

### Steps to Reproduce

1. Open two different workflow tabs.
2. In the first workflow, set the Batch Count to something greater than 1 (A higher number makes this easier to see).
3. Click Run.
4. While the batch is still being queued, switch to the second workflow tab.
5. Check the queued prompts.

Expected: all queued prompts come from the first workflow.
Actual: some later prompts can come from the second workflow.

### How is this affecting you?

Feature doesn't work as expected

### ComfyUI Frontend Version

1.47.6

### Browser

Chrome/Chromium

### Console Errors

```javascript

```

### Logs

```shell

```

### Additional Context

This is easiest to reproduce with a high Batch Count or when queueing is slow enough that there is time to switch tabs before all prompts are queued.
It does not seem tied to any specific custom node, GPU, or OS. The issue looks related to queueing using the currently active workflow tab instead of the workflow that was active when Run or Run Instant was started.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with two workflow tabs, a batch count greater than one, and Run or Run Instant, then trace the frontend queueing path used by those actions. Done means every queued prompt remains tied to the workflow that was active when the run started, even after switching tabs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.