comfy-cli


Namecomfy-cli JSON
Version 1.3.5 PyPI version JSON
download
home_pageNone
SummaryA CLI tool for installing and using ComfyUI.
upload_time2025-01-03 23:37:12
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseGPL-3.0-only
keywords comfyui stable diffusion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Comfy-Cli: A Command Line Tool for ComfyUI

[![Test ComfyUI Example Workflows](https://github.com/Comfy-Org/ComfyUI-Mirror/actions/workflows/test-workflows.yaml/badge.svg)](https://github.com/Comfy-Org/ComfyUI-Mirror/actions/workflows/test-workflows.yaml)

[![codecov](https://codecov.io/github/Comfy-Org/comfy-cli/graph/badge.svg?token=S64WJWD2ZX)](https://codecov.io/github/Comfy-Org/comfy-cli)

comfy-cli is a command line tool that helps users easily install and manage
[ComfyUI](https://github.com/comfyanonymous/ComfyUI), a powerful open-source
machine learning framework. With comfy-cli, you can quickly set up ComfyUI,
install packages, and manage custom nodes, all from the convenience of your
terminal.

## Demo

<img src="https://github.com/yoland68/comfy-cli/raw/main/assets/comfy-demo.gif" width="400" alt="Comfy Command Demo">

## Features

- 🚀 Easy installation of ComfyUI with a single command
- 📦 Seamless package management for ComfyUI extensions and dependencies
- 🔧 Custom node management for extending ComfyUI's functionality
- 🗄️ Download checkpoints and save model hash
- 💻 Cross-platform compatibility (Windows, macOS, Linux)
- 📖 Comprehensive documentation and examples

## Installation

1. (Recommended, but not necessary) Enable virtual environment ([venv](https://docs.python.org/3/library/venv.html)/[conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html))

2. To install comfy-cli, make sure you have Python 3.9 or higher installed on your system. Then, run the following command:

   `pip install comfy-cli`

### Shell Autocomplete

To install autocompletion hints in your shell run:

`comfy --install-completion`

This enables you to type `comfy [TAP]` to autocomplete commands and options

## Usage

### Installing ComfyUI

To install ComfyUI using comfy, simply run:

`comfy install`

This command will download and set up the latest version of ComfyUI and ComfyUI-Manager on your
system. If you run in a ComfyUI repo that has already been setup. The command
will simply update the comfy.yaml file to reflect the local setup

- `comfy install --skip-manager`: Install ComfyUI without ComfyUI-Manager.
- `comfy --workspace=<path> install`: Install ComfyUI into `<path>/ComfyUI`.
- For `comfy install`, if no path specification like `--workspace, --recent, or --here` is provided, it will be implicitly installed in `<HOME>/comfy`.

### Specifying execution path

- You can specify the path of ComfyUI where the command will be applied through path indicators as follows:
  - `comfy --workspace=<path>`: Run from the ComfyUI installed in the specified workspace.
  - `comfy --recent`: Run from the recently executed or installed ComfyUI.
  - `comfy --here`: Run from the ComfyUI located in the current directory.
- --workspace, --recent, and --here options cannot be used simultaneously.
- If there is no path indicator, the following priority applies:

  - Run from the default ComfyUI at the path specified by `comfy set-default <path>`.
  - Run from the recently executed or installed ComfyUI.
  - Run from the ComfyUI located in the current directory.

- Example 1: To run the recently executed ComfyUI:
  - `comfy --recent launch`
- Example 2: To install a package on the ComfyUI in the current directory:
  - `comfy --here node install ComfyUI-Impact-Pack`
- Example 3: To update the automatically selected path of ComfyUI and custom nodes based on priority:

  - `comfy node update all`

- You can use the `comfy which` command to check the path of the target workspace.
  - e.g `comfy --recent which`, `comfy --here which`, `comfy which`, ...

### Default Setup

The default sets the option that will be executed by default when no specific workspace's ComfyUI has been set for the command.

`comfy set-default <workspace path> ?[--launch-extras="<extra args>"]`

- `--launch-extras` option specifies extra args that are applied only during launch by default. However, if extras are specified at the time of launch, this setting is ignored.

### Launch ComfyUI

Comfy provides commands that allow you to easily run the installed ComfyUI.

`comfy launch`

- To run with default ComfyUI options:

  `comfy launch -- <extra args...>`

  `comfy launch -- --cpu --listen 0.0.0.0`

  - When you manually configure the extra options, the extras set by set-default will be overridden.

- To run background

  `comfy launch --background`

  `comfy --workspace=~/comfy launch --background -- --listen 10.0.0.10 --port 8000`

  - Instances launched with `--background` are displayed in the "Background ComfyUI" section of `comfy env`, providing management functionalities for a single background instance only.
  - Since "Comfy Server Running" in `comfy env` only shows the default port 8188, it doesn't display ComfyUI running on a different port.
  - Background-running ComfyUI can be stopped with `comfy stop`.

### Managing Custom Nodes

comfy provides a convenient way to manage custom nodes for extending ComfyUI's functionality. Here are some examples:

- Show custom nodes' information:

```
comfy node [show|simple-show] [installed|enabled|not-installed|disabled|all|snapshot|snapshot-list]
                             ?[--channel <channel name>]
                             ?[--mode [remote|local|cache]]
```

- `comfy node show all --channel recent`

  `comfy node simple-show installed`

  `comfy node update all`

  `comfy node install ComfyUI-Impact-Pack`

- Managing snapshot:

  `comfy node save-snapshot`

  `comfy node restore-snapshot <snapshot name>`

- Install dependencies:

  `comfy node install-deps --deps=<deps .json file>`

  `comfy node install-deps --workflow=<workflow .json/.png file>`

- Generate deps:

  `comfy node deps-in-workflow --workflow=<workflow .json/.png file> --output=<output deps .json file>`

#### Bisect custom nodes

If you encounter bugs only with custom nodes enabled, and want to find out which custom node(s) causes the bug,
the bisect tool can help you pinpoint the custom node that causes the issue.

- `comfy node bisect start`: Start a new bisect session with optional ComfyUI launch args. It automatically marks the starting state as bad, and takes all enabled nodes when the command executes as the test set.
- `comfy node bisect good`: Mark the current active set as good, indicating the problem is not within the test set.
- `comfy node bisect bad`: Mark the current active set as bad, indicating the problem is within the test set.
- `comfy node bisect reset`: Reset the current bisect session.

### Managing Models

- Model downloading

  `comfy model download --url <URL> ?[--relative-path <PATH>] ?[--set-civitai-api-token <TOKEN>]`

  - URL: CivitAI, huggingface file url, ...

- Model remove

  `comfy model remove ?[--relative-path <PATH>] --model-names <model names>`

- Model list

  `comfy model list ?[--relative-path <PATH>]`

### Managing ComfyUI-Manager

- disable GUI of ComfyUI-Manager (disable Manager menu and Server)

  `comfy manager disable-gui`

- enable GUI of ComfyUI-Manager

  `comfy manager enable-gui`

- Clear reserved startup action:

  `comfy manager clear`

## Beta Feature: format of comfy-lock.yaml (WIP)

```
basic:

models:
  - model: [name of the model]
    url: [url of the source, e.g. https://huggingface.co/...]
    paths: [list of paths to the model]
      - path: [path to the model]
      - path: [path to the model]
    hashes: [hashes for the model]
      - hash: [hash]
        type: [AutoV1, AutoV2, SHA256, CRC32, and Blake3]
    type: [type of the model, e.g. diffuser, lora, etc.]

  - model:
  ...

# compatible with ComfyUI-Manager's .yaml snapshot
custom_nodes:
  comfyui: [commit hash]
  file_custom_nodes:
  - disabled: [bool]
    filename: [.py filename]
    ...
  git_custom_nodes:
    [git-url]:
      disabled: [bool]
      hash: [commit hash]
    ...
```

## Analytics

We track analytics using Mixpanel to help us understand usage patterns and know where to prioritize our efforts. When you first download the cli, it will ask you to give consent. If at any point you wish to opt out:

```
comfy tracking disable
```

Check out the usage here: [Mixpanel Board](https://mixpanel.com/p/13hGfPfEPdRkjPtNaS7BYQ)

## Contributing

We welcome contributions to comfy-cli! If you have any ideas, suggestions, or
bug reports, please open an issue on our [GitHub
repository](https://github.com/yoland68/comfy-cli/issues). If you'd like to contribute code,
please fork the repository and submit a pull request.

Check out the [Dev Guide](/DEV_README.md) for more details.

## License

comfy is released under the [GNU General Public License v3.0](https://github.com/yoland68/comfy-cli/blob/master/LICENSE).

## Support

If you encounter any issues or have questions about comfy-cli, please [open an issue](https://github.com/comfy-cli/issues) on our GitHub repository or contact us on [Discord](https://discord.gg/comfycontrib). We'll be happy to assist you!

Happy diffusing with ComfyUI and comfy-cli! 🎉

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "comfy-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Yoland Yan <yoland@drip.art>, James Kwon <hongilkwon316@gmail.com>, Robin Huang <robin@drip.art>, \"Dr.Lt.Data\" <dr.lt.data@gmail.com>",
    "keywords": "comfyui, stable diffusion",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/89/8f/575051d54374fc7840ae846f776ca6daf823b763addbc644bd4bc338f8e1/comfy_cli-1.3.5.tar.gz",
    "platform": null,
    "description": "# Comfy-Cli: A Command Line Tool for ComfyUI\n\n[![Test ComfyUI Example Workflows](https://github.com/Comfy-Org/ComfyUI-Mirror/actions/workflows/test-workflows.yaml/badge.svg)](https://github.com/Comfy-Org/ComfyUI-Mirror/actions/workflows/test-workflows.yaml)\n\n[![codecov](https://codecov.io/github/Comfy-Org/comfy-cli/graph/badge.svg?token=S64WJWD2ZX)](https://codecov.io/github/Comfy-Org/comfy-cli)\n\ncomfy-cli is a command line tool that helps users easily install and manage\n[ComfyUI](https://github.com/comfyanonymous/ComfyUI), a powerful open-source\nmachine learning framework. With comfy-cli, you can quickly set up ComfyUI,\ninstall packages, and manage custom nodes, all from the convenience of your\nterminal.\n\n## Demo\n\n<img src=\"https://github.com/yoland68/comfy-cli/raw/main/assets/comfy-demo.gif\" width=\"400\" alt=\"Comfy Command Demo\">\n\n## Features\n\n- \ud83d\ude80 Easy installation of ComfyUI with a single command\n- \ud83d\udce6 Seamless package management for ComfyUI extensions and dependencies\n- \ud83d\udd27 Custom node management for extending ComfyUI's functionality\n- \ud83d\uddc4\ufe0f Download checkpoints and save model hash\n- \ud83d\udcbb Cross-platform compatibility (Windows, macOS, Linux)\n- \ud83d\udcd6 Comprehensive documentation and examples\n\n## Installation\n\n1. (Recommended, but not necessary) Enable virtual environment ([venv](https://docs.python.org/3/library/venv.html)/[conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html))\n\n2. To install comfy-cli, make sure you have Python 3.9 or higher installed on your system. Then, run the following command:\n\n   `pip install comfy-cli`\n\n### Shell Autocomplete\n\nTo install autocompletion hints in your shell run:\n\n`comfy --install-completion`\n\nThis enables you to type `comfy [TAP]` to autocomplete commands and options\n\n## Usage\n\n### Installing ComfyUI\n\nTo install ComfyUI using comfy, simply run:\n\n`comfy install`\n\nThis command will download and set up the latest version of ComfyUI and ComfyUI-Manager on your\nsystem. If you run in a ComfyUI repo that has already been setup. The command\nwill simply update the comfy.yaml file to reflect the local setup\n\n- `comfy install --skip-manager`: Install ComfyUI without ComfyUI-Manager.\n- `comfy --workspace=<path> install`: Install ComfyUI into `<path>/ComfyUI`.\n- For `comfy install`, if no path specification like `--workspace, --recent, or --here` is provided, it will be implicitly installed in `<HOME>/comfy`.\n\n### Specifying execution path\n\n- You can specify the path of ComfyUI where the command will be applied through path indicators as follows:\n  - `comfy --workspace=<path>`: Run from the ComfyUI installed in the specified workspace.\n  - `comfy --recent`: Run from the recently executed or installed ComfyUI.\n  - `comfy --here`: Run from the ComfyUI located in the current directory.\n- --workspace, --recent, and --here options cannot be used simultaneously.\n- If there is no path indicator, the following priority applies:\n\n  - Run from the default ComfyUI at the path specified by `comfy set-default <path>`.\n  - Run from the recently executed or installed ComfyUI.\n  - Run from the ComfyUI located in the current directory.\n\n- Example 1: To run the recently executed ComfyUI:\n  - `comfy --recent launch`\n- Example 2: To install a package on the ComfyUI in the current directory:\n  - `comfy --here node install ComfyUI-Impact-Pack`\n- Example 3: To update the automatically selected path of ComfyUI and custom nodes based on priority:\n\n  - `comfy node update all`\n\n- You can use the `comfy which` command to check the path of the target workspace.\n  - e.g `comfy --recent which`, `comfy --here which`, `comfy which`, ...\n\n### Default Setup\n\nThe default sets the option that will be executed by default when no specific workspace's ComfyUI has been set for the command.\n\n`comfy set-default <workspace path> ?[--launch-extras=\"<extra args>\"]`\n\n- `--launch-extras` option specifies extra args that are applied only during launch by default. However, if extras are specified at the time of launch, this setting is ignored.\n\n### Launch ComfyUI\n\nComfy provides commands that allow you to easily run the installed ComfyUI.\n\n`comfy launch`\n\n- To run with default ComfyUI options:\n\n  `comfy launch -- <extra args...>`\n\n  `comfy launch -- --cpu --listen 0.0.0.0`\n\n  - When you manually configure the extra options, the extras set by set-default will be overridden.\n\n- To run background\n\n  `comfy launch --background`\n\n  `comfy --workspace=~/comfy launch --background -- --listen 10.0.0.10 --port 8000`\n\n  - Instances launched with `--background` are displayed in the \"Background ComfyUI\" section of `comfy env`, providing management functionalities for a single background instance only.\n  - Since \"Comfy Server Running\" in `comfy env` only shows the default port 8188, it doesn't display ComfyUI running on a different port.\n  - Background-running ComfyUI can be stopped with `comfy stop`.\n\n### Managing Custom Nodes\n\ncomfy provides a convenient way to manage custom nodes for extending ComfyUI's functionality. Here are some examples:\n\n- Show custom nodes' information:\n\n```\ncomfy node [show|simple-show] [installed|enabled|not-installed|disabled|all|snapshot|snapshot-list]\n                             ?[--channel <channel name>]\n                             ?[--mode [remote|local|cache]]\n```\n\n- `comfy node show all --channel recent`\n\n  `comfy node simple-show installed`\n\n  `comfy node update all`\n\n  `comfy node install ComfyUI-Impact-Pack`\n\n- Managing snapshot:\n\n  `comfy node save-snapshot`\n\n  `comfy node restore-snapshot <snapshot name>`\n\n- Install dependencies:\n\n  `comfy node install-deps --deps=<deps .json file>`\n\n  `comfy node install-deps --workflow=<workflow .json/.png file>`\n\n- Generate deps:\n\n  `comfy node deps-in-workflow --workflow=<workflow .json/.png file> --output=<output deps .json file>`\n\n#### Bisect custom nodes\n\nIf you encounter bugs only with custom nodes enabled, and want to find out which custom node(s) causes the bug,\nthe bisect tool can help you pinpoint the custom node that causes the issue.\n\n- `comfy node bisect start`: Start a new bisect session with optional ComfyUI launch args. It automatically marks the starting state as bad, and takes all enabled nodes when the command executes as the test set.\n- `comfy node bisect good`: Mark the current active set as good, indicating the problem is not within the test set.\n- `comfy node bisect bad`: Mark the current active set as bad, indicating the problem is within the test set.\n- `comfy node bisect reset`: Reset the current bisect session.\n\n### Managing Models\n\n- Model downloading\n\n  `comfy model download --url <URL> ?[--relative-path <PATH>] ?[--set-civitai-api-token <TOKEN>]`\n\n  - URL: CivitAI, huggingface file url, ...\n\n- Model remove\n\n  `comfy model remove ?[--relative-path <PATH>] --model-names <model names>`\n\n- Model list\n\n  `comfy model list ?[--relative-path <PATH>]`\n\n### Managing ComfyUI-Manager\n\n- disable GUI of ComfyUI-Manager (disable Manager menu and Server)\n\n  `comfy manager disable-gui`\n\n- enable GUI of ComfyUI-Manager\n\n  `comfy manager enable-gui`\n\n- Clear reserved startup action:\n\n  `comfy manager clear`\n\n## Beta Feature: format of comfy-lock.yaml (WIP)\n\n```\nbasic:\n\nmodels:\n  - model: [name of the model]\n    url: [url of the source, e.g. https://huggingface.co/...]\n    paths: [list of paths to the model]\n      - path: [path to the model]\n      - path: [path to the model]\n    hashes: [hashes for the model]\n      - hash: [hash]\n        type: [AutoV1, AutoV2, SHA256, CRC32, and Blake3]\n    type: [type of the model, e.g. diffuser, lora, etc.]\n\n  - model:\n  ...\n\n# compatible with ComfyUI-Manager's .yaml snapshot\ncustom_nodes:\n  comfyui: [commit hash]\n  file_custom_nodes:\n  - disabled: [bool]\n    filename: [.py filename]\n    ...\n  git_custom_nodes:\n    [git-url]:\n      disabled: [bool]\n      hash: [commit hash]\n    ...\n```\n\n## Analytics\n\nWe track analytics using Mixpanel to help us understand usage patterns and know where to prioritize our efforts. When you first download the cli, it will ask you to give consent. If at any point you wish to opt out:\n\n```\ncomfy tracking disable\n```\n\nCheck out the usage here: [Mixpanel Board](https://mixpanel.com/p/13hGfPfEPdRkjPtNaS7BYQ)\n\n## Contributing\n\nWe welcome contributions to comfy-cli! If you have any ideas, suggestions, or\nbug reports, please open an issue on our [GitHub\nrepository](https://github.com/yoland68/comfy-cli/issues). If you'd like to contribute code,\nplease fork the repository and submit a pull request.\n\nCheck out the [Dev Guide](/DEV_README.md) for more details.\n\n## License\n\ncomfy is released under the [GNU General Public License v3.0](https://github.com/yoland68/comfy-cli/blob/master/LICENSE).\n\n## Support\n\nIf you encounter any issues or have questions about comfy-cli, please [open an issue](https://github.com/comfy-cli/issues) on our GitHub repository or contact us on [Discord](https://discord.gg/comfycontrib). We'll be happy to assist you!\n\nHappy diffusing with ComfyUI and comfy-cli! \ud83c\udf89\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-only",
    "summary": "A CLI tool for installing and using ComfyUI.",
    "version": "1.3.5",
    "project_urls": {
        "Repository": "https://github.com/drip-art/comfy-cli.git"
    },
    "split_keywords": [
        "comfyui",
        " stable diffusion"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0a8ad28328a30e457e05690325876f649a172c2fd77292741cdbd46f358c8c8",
                "md5": "3f36d725a6ce289aedabed143977dd13",
                "sha256": "56c9abed64c20a122fa22a93520d5ee1c6e43f978dff3b3423507d3811b14d49"
            },
            "downloads": -1,
            "filename": "comfy_cli-1.3.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3f36d725a6ce289aedabed143977dd13",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 77410,
            "upload_time": "2025-01-03T23:37:11",
            "upload_time_iso_8601": "2025-01-03T23:37:11.194105Z",
            "url": "https://files.pythonhosted.org/packages/b0/a8/ad28328a30e457e05690325876f649a172c2fd77292741cdbd46f358c8c8/comfy_cli-1.3.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "898f575051d54374fc7840ae846f776ca6daf823b763addbc644bd4bc338f8e1",
                "md5": "8b71844e98d018d29cac66aa00c029d3",
                "sha256": "9d234cccd51d50fac431e39b95ba8422a3f8b2c1c434648ff41805dca0388665"
            },
            "downloads": -1,
            "filename": "comfy_cli-1.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "8b71844e98d018d29cac66aa00c029d3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 71288,
            "upload_time": "2025-01-03T23:37:12",
            "upload_time_iso_8601": "2025-01-03T23:37:12.667241Z",
            "url": "https://files.pythonhosted.org/packages/89/8f/575051d54374fc7840ae846f776ca6daf823b763addbc644bd4bc338f8e1/comfy_cli-1.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-03 23:37:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "drip-art",
    "github_project": "comfy-cli",
    "github_not_found": true,
    "lcname": "comfy-cli"
}
        
Elapsed time: 0.53343s