Skip to content

Tab-Graph-Prompt State Sync Issues #3377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
christian-byrne opened this issue Apr 10, 2025 · 5 comments
Open

Tab-Graph-Prompt State Sync Issues #3377

christian-byrne opened this issue Apr 10, 2025 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@christian-byrne
Copy link
Contributor

christian-byrne commented Apr 10, 2025

After a prompt is queued from the frontend, the backend will send various messages about the status of the job.

These status messages are used for various dynamic frontend components/features, such as:

  • in-node output displays (app.nodeOutputs)
  • latent previews displays (app.nodePreviewImages)
  • execution progress (progress bar)
  • currently executing node (browser title)

The frontend workspace can have multiple tabs, each corresponding to its own graph. The frontend does not currently make an attempt to associate each prompt/job with its initiating tab/graph. As a result, the frontend defaults to assuming the status messages relate to the active graph/tab, which can be wrong (e.g., you initiate a job with tab A, then switch to tab B, then get a status message about the job after switching).

This causes various minor (for now) bugs. For this issue, a more comprehensive solution seems necessary, as it will need to be maintainable and extendable in the future.

┆Issue is synchronized with this Notion page by Unito

@christian-byrne
Copy link
Contributor Author

christian-byrne commented Apr 10, 2025

@QuietNoise
Copy link

Working on extension that uses the affecting and affected mechanisms and I have a chance to observe the problem up close. Backend websocket messages from PromptServer don't include information about worklow the server is currently processing (i.e. workflow id).
On front-end similarly the events are dispatched globally and consumed by nodes on whatever workflow is currently active. Other than node type, events do not include any other identifying information or option to filter out events that shouldn't be consumed.

I reckon on server side solution might be trivial by just adding workflow id to messages.
On front end it might require more serious consideration. I believe the easiest approach would be by dispatching frontend api events only when active workflow ID matched the id of the workflow from server message?

@christian-byrne
Copy link
Contributor Author

I reckon on server side solution might be trivial by just adding workflow id to messages.

That's a good suggestion. The only hiccup might be that there could be cases where there are multiple tabs with the same workflow. We may need a new concept along the lines of "tab" or "workspace".

@QuietNoise
Copy link

QuietNoise commented May 12, 2025

Yes. Multiple browser tabs is another landmine I'm trying to wrap my head around. I.e. we can have same workflows open in multiple tabs overwriting each other when saving to the file, and when you open new tab it recreates the last workspace adding another copy of these open workflows to the "whose gona last in the saved file" race.
Multi session is always a headache for any software, justifies writing a book about it on its own 😂

P.S. The good thing is that every generated PNG is workflow's save file, so at least in this department eveyone is covered since they recover any historical version of the prompt and generated PNGs serve as is cover image :D

@nadimaj
Copy link

nadimaj commented May 21, 2025

I had to go back to an October 2024 release in the end. I rely heavily upon multiple browser tabs to work on different workflows. I'm not interested in saving all images especially when generating large batches. If I like the look of an image in the ImagePreview window, I'd click it to expand then right click to Save. Looks like no one ever realized this beautiful way of working! and thus missed a trick with the latest UI updates :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants