mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-12 23:55:05 +08:00
- Add client_id field to QueueTaskItem and TaskHistoryItem models - Implement client-specific WebSocket message routing - Add client filtering to queue status and history endpoints - Follow ComfyUI patterns for session management - Create data_models package for better code organization
22 lines
665 B
Python
22 lines
665 B
Python
import locale
|
|
import sys
|
|
|
|
|
|
def handle_stream(stream, prefix):
|
|
stream.reconfigure(encoding=locale.getpreferredencoding(), errors="replace")
|
|
for msg in stream:
|
|
if (
|
|
prefix == "[!]"
|
|
and ("it/s]" in msg or "s/it]" in msg)
|
|
and ("%|" in msg or "it [" in msg)
|
|
):
|
|
if msg.startswith("100%"):
|
|
print("\r" + msg, end="", file=sys.stderr),
|
|
else:
|
|
print("\r" + msg[:-1], end="", file=sys.stderr),
|
|
else:
|
|
if prefix == "[!]":
|
|
print(prefix, msg, end="", file=sys.stderr)
|
|
else:
|
|
print(prefix, msg, end="")
|