Skip to content

Show text progress messages on executing nodes#3824

Merged
huchenlei merged 6 commits intomainfrom
render-progress-text
May 10, 2025
Merged

Show text progress messages on executing nodes#3824
huchenlei merged 6 commits intomainfrom
render-progress-text

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented May 9, 2025

Adds a new websocket message type for text progress reports from a node. When receiving such messages, render a Vue DOM widget to display the text on the iniating node.

The websocket message follows format:

[4 bytes: event type = 3 (int)][4 bytes: length of node id][n bytes: node id (utf-8 string)][... text (utf-8 string)]

The messages can be sent from a node like:

from server import PromptServer

class Node:
    @classmethod
    def INPUT_TYPES(cls):
        return {
            "hidden" : {
                "unique_id": "UNIQUE_ID",
            }
        }

    RETURN_TYPES = (,)
    FUNCTION = "send_message"

    def send_message(self, unique_id=None):
        PromptServer.instance.send_progress_text("Loading...", unique_id)
        time.sleep(2)
        PromptServer.instance.send_progress_text("result: foo bar", unique_id)
        return (,)

Resolves #3793


Related:

┆Issue is synchronized with this Notion page by Unito

@christian-byrne christian-byrne marked this pull request as ready for review May 9, 2025 21:34
@christian-byrne christian-byrne requested a review from a team as a code owner May 9, 2025 21:34
@christian-byrne
Copy link
Contributor Author

How it appears in UI:

text-progress.mp4

@huchenlei huchenlei merged commit 992c2ba into main May 10, 2025
10 checks passed
@huchenlei huchenlei deleted the render-progress-text branch May 10, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Support text previews binary message type

2 participants