Update frontend to 1.16 (Install templates as pip package) (#7623)

* install templates as pip package

* Update requirements.txt

* bump templates version to include hidream

---------

Co-authored-by: Chenlei Hu <hcl@comfy.org>
This commit is contained in:
Christian Byrne 2025-04-18 02:25:33 +08:00 committed by GitHub
parent eba7a25e7a
commit 05d5a75cdc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 1 deletions

View File

@ -184,6 +184,27 @@ comfyui-frontend-package is not installed.
)
sys.exit(-1)
@classmethod
def templates_path(cls) -> str:
try:
import comfyui_workflow_templates
return str(
importlib.resources.files(comfyui_workflow_templates) / "templates"
)
except ImportError:
logging.error(
f"""
********** ERROR ***********
comfyui-workflow-templates is not installed.
{frontend_install_warning_message()}
********** ERROR ***********
""".strip()
)
@classmethod
def parse_version_string(cls, value: str) -> tuple[str, str, str]:
"""

View File

@ -1,4 +1,5 @@
comfyui-frontend-package==1.15.13
comfyui-frontend-package==1.16.8
comfyui-workflow-templates==0.1.1
torch
torchsde
torchvision

View File

@ -736,6 +736,12 @@ class PromptServer():
for name, dir in nodes.EXTENSION_WEB_DIRS.items():
self.app.add_routes([web.static('/extensions/' + name, dir)])
workflow_templates_path = FrontendManager.templates_path()
if workflow_templates_path:
self.app.add_routes([
web.static('/templates', workflow_templates_path)
])
self.app.add_routes([
web.static('/', self.web_root),
])