show text progress preview

This commit is contained in:
bymyself 2025-05-08 23:15:31 -07:00
parent cc33cd3422
commit 25e9031ab9

View File

@ -32,12 +32,13 @@ from app.frontend_management import FrontendManager
from app.user_manager import UserManager
from app.model_manager import ModelFileManager
from app.custom_node_manager import CustomNodeManager
from typing import Optional
from typing import Optional, Union
from api_server.routes.internal.internal_routes import InternalRoutes
class BinaryEventTypes:
PREVIEW_IMAGE = 1
UNENCODED_PREVIEW_IMAGE = 2
TEXT = 3
async def send_socket_catch_exception(function, message):
try:
@ -878,3 +879,8 @@ class PromptServer():
logging.warning(traceback.format_exc())
return json_data
def send_progress_text(self, text: Union[bytes, bytearray, str], sid=None):
if isinstance(text, str):
text = text.encode("utf-8")
self.send_sync(BinaryEventTypes.TEXT, text, sid)