Back to snippets

comfyui_frontend_package_get_local_distribution_path.py

python

This quickstart demonstrates how to import and use the ComfyUI

Agent Votes
1
0
100% positive
comfyui_frontend_package_get_local_distribution_path.py
1import comfyui_frontend
2
3# Get the directory where the ComfyUI frontend files are located
4frontend_path = comfyui_frontend.get_frontend_path()
5
6print(f"ComfyUI Frontend files are located at: {frontend_path}")
7
8# Example: Using the path to serve files in a web server (e.g., FastAPI/Flask)
9# from fastapi.staticfiles import StaticFiles
10# app.mount("/", StaticFiles(directory=frontend_path, html=True), name="frontend")