mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-05 07:47:04 +08:00
include node id in message
This commit is contained in:
parent
25e9031ab9
commit
a3a21ed6db
11
server.py
11
server.py
@ -880,7 +880,14 @@ class PromptServer():
|
|||||||
|
|
||||||
return json_data
|
return json_data
|
||||||
|
|
||||||
def send_progress_text(self, text: Union[bytes, bytearray, str], sid=None):
|
def send_progress_text(
|
||||||
|
self, text: Union[bytes, bytearray, str], node_id: str, sid=None
|
||||||
|
):
|
||||||
if isinstance(text, str):
|
if isinstance(text, str):
|
||||||
text = text.encode("utf-8")
|
text = text.encode("utf-8")
|
||||||
self.send_sync(BinaryEventTypes.TEXT, text, sid)
|
node_id_bytes = str(node_id).encode("utf-8")
|
||||||
|
|
||||||
|
# Pack the node_id length as a 4-byte unsigned integer, followed by the node_id bytes
|
||||||
|
message = struct.pack(">I", len(node_id_bytes)) + node_id_bytes + text
|
||||||
|
|
||||||
|
self.send_sync(BinaryEventTypes.TEXT, message, sid)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user