Merge 02cf1ac38a9f8c0624469bd74bdf5af95752f9c0 into 1fd306824d35bf2669f6be46fadab37efd7081c4

This commit is contained in:
Yiqun Xu 2025-07-10 10:29:43 +02:00 committed by GitHub
commit 2619dd050e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -290,7 +290,6 @@ class PromptServer():
image = post.get("image")
overwrite = post.get("overwrite")
image_is_duplicate = False
image_upload_type = post.get("type")
upload_dir, image_upload_type = get_dir_by_type(image_upload_type)
@ -529,6 +528,7 @@ class PromptServer():
"ram_total": ram_total,
"ram_free": ram_free,
"comfyui_version": __version__,
"workflows_templates_version": get_workflow_templates_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",
@ -548,6 +548,26 @@ class PromptServer():
}
return web.json_response(system_stats)
def get_workflow_templates_version():
"""Reads the version number of comfyui-workflow-templates from the requirements.txt file."""
try:
current_dir = os.path.dirname(__file__)
requirements_path = os.path.join(current_dir, 'requirements.txt')
version = "not_found"
with open(requirements_path, 'r', encoding='utf-8') as f:
for line in f:
if line.startswith('comfyui-workflow-templates=='):
version = line.strip().split('==')[1]
break
except FileNotFoundError:
version = "requirements.txt not found"
except Exception as e:
logging.info(f"Error reading version in get_workflow_templates_version: {e}")
version = "unknown"
return version
@routes.get("/prompt")
async def get_prompt(request):
return web.json_response(self.get_queue_info())