mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-25 15:55:18 +00:00
Merge 672200e087
into d0f3752e33
This commit is contained in:
commit
3916b3d456
11
pyproject.toml
Normal file
11
pyproject.toml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[project]
|
||||||
|
name = "ComfyUI"
|
||||||
|
version = "0.3.10"
|
||||||
|
readme = "README.md"
|
||||||
|
license = { file = "LICENSE" }
|
||||||
|
requires-python = ">=3.9"
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
homepage = "https://www.comfy.org/"
|
||||||
|
repository = "https://github.com/comfyanonymous/ComfyUI"
|
||||||
|
documentation = "https://docs.comfy.org/"
|
@ -13,6 +13,7 @@ Pillow
|
|||||||
scipy
|
scipy
|
||||||
tqdm
|
tqdm
|
||||||
psutil
|
psutil
|
||||||
|
toml
|
||||||
|
|
||||||
#non essential dependencies:
|
#non essential dependencies:
|
||||||
kornia>=0.7.1
|
kornia>=0.7.1
|
||||||
|
21
server.py
21
server.py
@ -20,6 +20,7 @@ from io import BytesIO
|
|||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
import toml
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import mimetypes
|
import mimetypes
|
||||||
@ -45,19 +46,13 @@ async def send_socket_catch_exception(function, message):
|
|||||||
logging.warning("send error: {}".format(err))
|
logging.warning("send error: {}".format(err))
|
||||||
|
|
||||||
def get_comfyui_version():
|
def get_comfyui_version():
|
||||||
comfyui_version = "unknown"
|
""" Get the version of ComfyUI from the pyproject.toml file.
|
||||||
repo_path = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
try:
|
Note:
|
||||||
import pygit2
|
Use Python's built-in `tomllib` from Python 3.11 or later when available.
|
||||||
repo = pygit2.Repository(repo_path)
|
"""
|
||||||
comfyui_version = repo.describe(describe_strategy=pygit2.GIT_DESCRIBE_TAGS)
|
with open("pyproject.toml", "r", encoding="utf-8") as f:
|
||||||
except Exception:
|
return toml.load(f)["project"]["version"]
|
||||||
try:
|
|
||||||
import subprocess
|
|
||||||
comfyui_version = subprocess.check_output(["git", "describe", "--tags"], cwd=repo_path).decode('utf-8')
|
|
||||||
except Exception as e:
|
|
||||||
logging.warning(f"Failed to get ComfyUI version: {e}")
|
|
||||||
return comfyui_version.strip()
|
|
||||||
|
|
||||||
@web.middleware
|
@web.middleware
|
||||||
async def cache_control(request: web.Request, handler):
|
async def cache_control(request: web.Request, handler):
|
||||||
|
Loading…
Reference in New Issue
Block a user