diff --git a/requirements.txt b/requirements.txt index d8745105..4c2c0b2b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,6 @@ Pillow scipy tqdm psutil -toml #non essential dependencies: kornia>=0.7.1 diff --git a/server.py b/server.py index ccbea28d..a8c37a3e 100644 --- a/server.py +++ b/server.py @@ -20,7 +20,6 @@ from io import BytesIO import aiohttp from aiohttp import web -import toml import logging import mimetypes @@ -28,6 +27,7 @@ from comfy.cli_args import args import comfy.utils import comfy.model_management import node_helpers +from version import __version__ from app.frontend_management import FrontendManager from app.user_manager import UserManager from app.model_manager import ModelFileManager @@ -45,15 +45,6 @@ async def send_socket_catch_exception(function, message): except (aiohttp.ClientError, aiohttp.ClientPayloadError, ConnectionResetError, BrokenPipeError, ConnectionError) as err: logging.warning("send error: {}".format(err)) -def get_comfyui_version(): - """ Get the version of ComfyUI from the pyproject.toml file. - - Note: - Use Python's built-in `tomllib` from Python 3.11 or later when available. - """ - with open("pyproject.toml", "r", encoding="utf-8") as f: - return toml.load(f)["project"]["version"] - @web.middleware async def cache_control(request: web.Request, handler): response: web.Response = await handler(request) @@ -513,7 +504,7 @@ class PromptServer(): "os": os.name, "ram_total": ram_total, "ram_free": ram_free, - "comfyui_version": get_comfyui_version(), + "comfyui_version": __version__, "python_version": sys.version, "pytorch_version": comfy.model_management.torch_version, "embedded_python": os.path.split(os.path.split(sys.executable)[0])[1] == "python_embeded", diff --git a/version.py b/version.py new file mode 100644 index 00000000..7cccc753 --- /dev/null +++ b/version.py @@ -0,0 +1,3 @@ +# This file is automatically generated by the build process when version is +# updated in pyproject.toml. +__version__ = "0.3.10"