{"id":23234128,"url":"https://github.com/bentoml/comfy-pack","last_synced_at":"2025-12-13T16:26:29.361Z","repository":{"id":261227475,"uuid":"883629255","full_name":"bentoml/comfy-pack","owner":"bentoml","description":"A comprehensive toolkit for reliably locking, packing and deploying environments for ComfyUI workflows.","archived":false,"fork":false,"pushed_at":"2025-05-13T02:47:44.000Z","size":475,"stargazers_count":145,"open_issues_count":9,"forks_count":14,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-13T03:15:28.015Z","etag":null,"topics":["ai-art","comfyui","comfyui-api","comfyui-manager","comfyui-nodes","comfyui-workflow","genai"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bentoml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-05T09:55:59.000Z","updated_at":"2025-05-08T07:44:00.000Z","dependencies_parsed_at":"2024-11-20T14:18:37.429Z","dependency_job_id":"07331377-6c79-4d4a-8f5f-be77d8279141","html_url":"https://github.com/bentoml/comfy-pack","commit_stats":null,"previous_names":["bentoml/comfyui-bentoml","bentoml/comfyui-idl","bentoml/comfy-pack"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2Fcomfy-pack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2Fcomfy-pack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2Fcomfy-pack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2Fcomfy-pack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bentoml","download_url":"https://codeload.github.com/bentoml/comfy-pack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254592395,"owners_count":22097013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-art","comfyui","comfyui-api","comfyui-manager","comfyui-nodes","comfyui-workflow","genai"],"created_at":"2024-12-19T03:02:14.258Z","updated_at":"2025-12-13T16:26:29.353Z","avatar_url":"https://github.com/bentoml.png","language":"Python","funding_links":[],"categories":["Workflows (3395) sorted by GitHub Stars","All Workflows Sorted by GitHub Stars"],"sub_categories":[],"readme":"# Comfy-Pack: Making ComfyUI Workflows Shareable\n\n![banner2](https://github.com/user-attachments/assets/14a7e469-6683-4818-9d54-5e5a8d0aa454)\n\n\ncomfy-pack is a comprehensive toolkit for reliably packing and unpacking environments for ComfyUI workflows. \n\n\n- 📦 **Pack workflow environments as artifacts:** Saves the workflow environment in a `.cpack.zip` artifact with Python package versions, ComfyUI and custom node revisions, and model hashes.\n- ✨ **Unpack artifacts to recreate workflow environments:** Unpacks the `.cpack.zip` artifact to recreate the same environment with the exact Python package versions, ComfyUI and custom node revisions, and model weights.\n- 🚀 **Deploy workflows as APIs:** Deploys the workflow as a RESTful API with customizable input and output parameters.\n\n## Motivations\nComfyUI Manager is great for find missing custom nodes. But when sharing ComfyUI workflows to others(your audience or team members), you've still likely heard these responses:\n\n- \"Custom Node not found\"\n- \"Cannot find the correct model file\"\n- \"Missing Python dependencies\"\n\nThese are fundamental challenges in workflow sharing – every component should match exactly: custom nodes, model files, and Python dependencies. Modern pacakge managers like npm and poetry introduced \"lock\" feature, which means record the exact version for every requirement. ComfyUI Manager isn't designed for that.\n\nWe learned it from our community and developed comfy-pack to address these problems. With a single click, it captures and locks your entire workflow environment into a `.cpack.zip` file, including Python packages, custom nodes, model hashes, and required assets.\n\nUsers can recreate the exact environment with one command:\n\n```bash\ncomfy-pack unpack workflow.cpack.zip\n```\n\nThis means you can focus on your creative work while comfy-pack handles the rest.\n\n## Usages\n\n### Installation\n\nWe recommend you use ComfyUI Manager to install comfy-pack. Simply search for `comfy-pack` and click **Install**. Restart the server and refresh your ComfyUI interface to apply changes.\n\n![install_node](https://github.com/user-attachments/assets/dbfb730d-edff-4a52-b6c4-695e3ec70368)\n\nAlternatively, clone the project repository through `git`.\n\n```bash\ncd ComfyUI/custom_nodes\ngit clone https://github.com/bentoml/comfy-pack.git\n```\n\nTo install the comfy-pack CLI, run:\n\n```bash\npip install comfy-pack\n```\n\n### Pack a ComfyUI workflow and its environment\n\nYou can package a workflow and the environment required to run the workflow into an artifact that can be unpacked elsewhere.\n\n1. Click the **Package** button to create a `.cpack.zip` artifact.\n2. (Optional) Select the models that you want to include (only model hash will be recorded, so you won't get a 100GB zip file).\n\n![pack](https://github.com/user-attachments/assets/e08bbed2-84dc-474e-a701-6c6db16edf76)\n\n### Unpack the ComfyUI environments\n\nUnpacking a `.cpack.zip` artifact will restore the ComfyUI environment for the workflow. During unpacking, comfy-pack will perform the following steps.\n\n1. Prepare a Python virtual environment with the exact packages used to run the workflow.\n2. Clone ComfyUI and custom nodes from the exact revisions required by the workflow.\n3. Search for and download models from common registries like Hugging Face and Civitai. Unpacking workflows using the same model will not cause the model to be downloaded multiple times. Instead, model weights will be symbolically linked.\n\nTo unpack:\n\n```bash\ncomfy-pack unpack workflow.cpack.zip\n```\n\nHuggingface gated models can be accessed by setting your `HF_TOKEN` as an environment variable before unpacking:\n\n```bash\nexport HF_TOKEN=hf_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx\ncomfy-pack unpack workflow.cpack.zip\n```\n\nFor example cpack files, check our [examples folder](examples/).\n\n### Deploy a workflow as an API\n\nYou can turn a ComfyUI workflow into an API endpoint callable using any clients through HTTP.\n\n\u003cdetails\u003e\n\u003csummary\u003e 1. Annotate input \u0026 output \u003c/summary\u003e\n\nUse custom nodes provided by comfy-pack to annotate the fields to be used as input and output parameters. To add a comfy-pack node, right-click and select **Add Node** \u003e **ComfyPack** \u003e **output/input** \u003e [Select a type]\n\nInput nodes:\n\n- ImageInput: Accepts `image` type input, similar to the official `LoadImage` node\n- StringInput: Accepts `string` type input (e.g., prompts)\n- IntInput: Accepts `int` type input (e.g., dimensions, seeds)\n- AnyInput: Accepts `combo` type and more input (e.g., custom nodes)\n\n![input](https://github.com/user-attachments/assets/44264007-0ac8-4e23-8dc0-e60aa0ebcea2)\n\nOutput nodes:\n\n- ImageOutput: Outputs `image` type, similar to the official `SaveImage` node\n- FileOutput: Outputs file path as `string` type and saves the file under that path\n\n![output](https://github.com/user-attachments/assets/a4526661-8930-4575-bacc-33b6887f6271)\n\nMore field types are under way.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e 2. Serve the workflow \u003c/summary\u003e\n\nStart an HTTP server at `http://127.0.0.1:3000` (default) to serve the workflow under the `/generate` path.\n\n![serve](https://github.com/user-attachments/assets/8d4c92c5-d6d7-485e-bc71-e4fc0fe8bf35)\n\nYou can call the `/generate` endpoint by specifying parameters configured through your comfy-pack nodes, such as prompt, width, height, and seed.\n\n\u003e [!NOTE]\n\u003e The name of a comfy-pack node is the parameter name used for API calls.\n\nExamples to call the endpoint:\n\nCURL\n\n```bash\ncurl -X 'POST' \\\n  'http://127.0.0.1:3000/generate' \\\n  -H 'accept: application/octet-stream' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"prompt\": \"rocks in a bottle\",\n  \"width\": 512, \n  \"height\": 512,\n  \"seed\": 1\n}'\n```\n\nBentoML client\n\nUnder the hood, comfy-pack leverages [BentoML](https://github.com/bentoml/BentoML), the unified model serving framework. You can invoke the endpoint using [the BentoML Python client](https://docs.bentoml.com/en/latest/build-with-bentoml/clients.html):\n\n```python\nimport bentoml\n\nwith bentoml.SyncHTTPClient(\"http://127.0.0.1:3000\") as client:\n        result = client.generate(\n            prompt=\"rocks in a bottle\",\n            width=512,\n            height=512,\n            seed=1\n        )\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e 3. (Optional) Pack the workflow and environment \u003c/summary\u003e\n\nPack the workflow and environment into an artifact that can be unpacked elsewhere to recreate the workflow.\n\n```bash\n# Get the workflow input spec\ncomfy-pack run workflow.cpack.zip --help\n\n# Run\ncomfy-pack run workflow.cpack.zip --src-image image.png --video video.mp4\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e \n\u003csummary\u003e 4. (Optional) Deploy to the cloud \u003c/summary\u003e\n\nDeploy to [BentoCloud](https://www.bentoml.com/) with access to a variety of GPUs and blazing fast scaling.\n\nFollow [the instructions here](https://docs.bentoml.com/en/latest/scale-with-bentocloud/manage-api-tokens.html) to get your BentoCloud access token. If you don’t have a BentoCloud account, you can [sign up for free](https://bentoml.com/).\n\n![image](https://github.com/user-attachments/assets/1ffa31fc-1f50-4ea7-a47e-7dae3b874273)\n\n\u003c/details\u003e\n\n## Security Guidelines\n\nA cpack file only contains the metadata of the workflow environment, such as Python package versions, ComfyUI and custom node revisions, and model hashes. It does not contain any sensitive information like API keys, passwords, or user data. However, unpacking a cpack file will install custom nodes and Python dependencies. It is recommended to unpack cpack files from trusted sources.\n\ncomfy-pack has a strict mode for unpacking. You can enable it by setting the `CPACK_STRICT_MODE` environment variable to `true`. It will sacrifice some flexibility and compatibility for security. For now, comfy-pack will:\n\n* Use more strict index strategy in Python package installation\n\nMore security features are under way.\n\n\n## Roadmap\n\nThis project is under active development. Currently we are working on:\n\n- Enhanced user experience\n- Docker support\n- Local `.cpack` file management with version control\n- Enhanced service capabilities\n\n## Community\n\ncomfy-pack is actively maintained by the BentoML team. Feel free to reach out 👉 [Join our Slack community!](https://l.bentoml.com/join-slack)\n\n## Contributing\n\nAs an open-source project, we welcome contributions of all kinds, such as new features, bug fixes, and documentation. Here are some of the ways to contribute:\n\n- Repost a bug by creating a [GitHub issue](https://github.com/bentoml/comfy-pack/issues).\n- Submit a [pull request](https://github.com/bentoml/comfy-pack/pulls) or help review other developers’ pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentoml%2Fcomfy-pack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbentoml%2Fcomfy-pack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentoml%2Fcomfy-pack/lists"}