mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-09 15:20:06 +00:00
refactor: add prompt_id as hidden type, fix imports, add docstrings
- Add PROMPT_ID as a new hidden type in the Hidden enum, HiddenHolder, HiddenInputTypeDict, and execution engine resolution (both V3 and legacy) - Refactor GetImageSize to use cls.hidden.prompt_id instead of manually calling get_executing_context() — addresses reviewer feedback - Remove lazy import of get_executing_context from nodes_images.py - Add docstrings to send_progress_text, _display_text, HiddenHolder, and HiddenHolder.from_dict Amp-Thread-ID: https://ampcode.com/threads/T-019ca1cb-0150-7549-8b1b-6713060d3408
This commit is contained in:
@@ -437,6 +437,17 @@ def _display_text(
|
||||
status: str | int | None = None,
|
||||
price: float | None = None,
|
||||
) -> None:
|
||||
"""Send a progress text message to the client for display on a node.
|
||||
|
||||
Assembles status, price, and text lines, then sends them via WebSocket.
|
||||
Automatically retrieves the current prompt_id from the execution context.
|
||||
|
||||
Args:
|
||||
node_cls: The ComfyNode class sending the progress text.
|
||||
text: Optional text content to display.
|
||||
status: Optional status string or code to display.
|
||||
price: Optional price in dollars to display as credits.
|
||||
"""
|
||||
display_lines: list[str] = []
|
||||
if status:
|
||||
display_lines.append(f"Status: {status.capitalize() if isinstance(status, str) else status}")
|
||||
|
||||
Reference in New Issue
Block a user