Skip to content

Add method to stream text to node UI #8018

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

Merged

Conversation

christian-byrne
Copy link
Collaborator

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

Add PromptServer method that can be called by nodes to send text progress to client UI 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("test message", unique_id)
        return (,)

which can be used with LLM nodes or to show messages when a node is executing/executed

@comfyanonymous comfyanonymous merged commit 235d390 into comfyanonymous:master May 11, 2025
5 checks passed
@christian-byrne christian-byrne deleted the text-progress-prev branch May 11, 2025 03:36
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.

2 participants