From 1da74b385f7be6a536f8ca4874a620f63d453f11 Mon Sep 17 00:00:00 2001 From: "Lex Darlog (DRL)" <3897975+Lex-DRL@users.noreply.github.com> Date: Mon, 21 Jul 2025 03:02:41 +0500 Subject: [PATCH] `funcs_common` --- funcs_common.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 funcs_common.py diff --git a/funcs_common.py b/funcs_common.py new file mode 100644 index 0000000..7bd5789 --- /dev/null +++ b/funcs_common.py @@ -0,0 +1,18 @@ +# encoding: utf-8 +""" +Code shared between various `funcs_*` modules. +""" + +import typing as _t + +from server import PromptServer as _PromptServer + +def _show_text_on_node(text: str = None, unique_id: str = None): + if not text: + # TODO: Planned for the future - currently, there's no point removing the text since it's box is shown anyway + # An odd workaround since `send_progress_text()` doesn't want to update text when '' passed + text = '' + # print(f"{unique_id} text: {text!r}") + + # Snatched from: https://github.com/comfyanonymous/ComfyUI/blob/27870ec3c30e56be9707d89a120eb7f0e2836be1/comfy_extras/nodes_images.py#L581-L582 + _PromptServer.instance.send_progress_text(text, unique_id)