> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-train-lora-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to install ComfyUI manually in different systems

For the installation of ComfyUI, it is mainly divided into several steps:

1. Create a virtual environment(avoid polluting the system-level Python environment)
2. Clone the ComfyUI code repository
3. Install dependencies
4. Start ComfyUI

You can also refer to [ComfyUI CLI](comfy-cli/getting-started) to install ComfyUI, it is a command line tool that can easily install ComfyUI and manage its dependencies.

## Create a virtual environment

<Tip>
  Independent virtual environments are necessary because ComfyUI's dependencies may conflict with other dependencies on the system, and it can also avoid polluting the system-level Python environment.
</Tip>

[Install Miniconda](https://docs.anaconda.com/free/miniconda/index.html#latest-miniconda-installer-links). This will help you install the correct versions of Python and other libraries needed by ComfyUI.

Create an environment with Conda.

```
conda create -n comfyenv
conda activate comfyenv
```

## Clone the ComfyUI code repository

You need to ensure that you have installed [Git](https://git-scm.com/downloads) on your system. First, you need to open the terminal (command line), then clone the code repository.

<Tabs>
  <Tab title="Windows">
    <Warning>If you have not installed Microsoft Visual C++ Redistributable, please install it [here.](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170)</Warning>
  </Tab>

  <Tab title="Linux">
    Open Terminal application.
  </Tab>

  <Tab title="MacOS">
    Open [Terminal application](https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac).
  </Tab>
</Tabs>

```bash
git clone git@github.com:comfyanonymous/ComfyUI.git
```

## Install GPU and ComfyUI dependencies

<Steps>
  <Step title="Install GPU dependencies">
    Install GPU Dependencies

    <Accordion title="Nvidia">
      ```
      conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
      ```

      Alternatively, you can install the nightly version of PyTorch.

      <Accordion title="Install Nightly">
        <Warning>Install Nightly version (might be more risky)</Warning>

        ```
        conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch-nightly -c nvidia
        ```
      </Accordion>
    </Accordion>

    <Accordion title="AMD">
      ```
      pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.0
      ```

      Alternatively, you can install the nightly version of PyTorch.

      <Accordion title="Install Nightly">
        <Warning>Install Nightly version (might be more risky)</Warning>

        ```
        pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.0
        ```
      </Accordion>
    </Accordion>

    <Accordion title="Mac ARM Silicon">
      ```bash
      conda install pytorch-nightly::pytorch torchvision torchaudio -c pytorch-nightly
      ```
    </Accordion>
  </Step>

  <Step title="Install ComfyUI dependencies">
    ```bash
    cd ComfyUI
    pip install -r requirements.txt
    ```
  </Step>

  <Step title="Start ComfyUI">
    Start the application

    ```
    cd ComfyUI
    python main.py
    ```
  </Step>
</Steps>

## How to update ComfyUI

<Steps>
  <Step title="pull the latest code">
    Use the command line to enter the installation path of ComfyUI, then pull the latest code.

    ```bash
    cd <installation path>/ComfyUI
    git pull
    ```
  </Step>

  <Step title="install the dependencies">
    Use the command line to enter the installation path of ComfyUI, then install the dependencies.

    <Warning>
      You need to ensure that the current Python environment is the ComfyUI virtual environment, otherwise the dependencies will be installed to the system-level Python environment, polluting the system-level Python environment.
    </Warning>

    ```bash
        pip install -r requirements.txt
    ```
  </Step>
</Steps>
