# Custom Nodes and Models

If you want to install custom nodes and modes, you can create custom ComfyUI environments called "**Machines"** which contains the models, custom nodes you want.

### 1. Install custom nodes

To define the custom nodes you want to install in your machine, you need a **`snapshot.json`**. The format of the json should look like this:

```json
{
  "git_custom_nodes": {
    "https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite": {},
    "https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved": {}
  }
}
```

Optionally, you can define the version of comfyui and custom nodes in `hash` . Otherwise it will just use the latest comfyui and custom nodes versions:

```json
{
  "comfyui": "b249862080d4c046bd7f2680898c2f348c792a12",
  "git_custom_nodes": {
    "https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved": {
      "hash": "72482e70f73336a3dd61cbf9cc7d973137e9b33d"
    }
  }
}
```

#### \[Optional] Get snapshot from ComfyUI-Manager

You can manually write snapshot.json or you can get snapshot.json from ComfyUI-Manager, which includes the custom nodes and versions you currently installed in your local ComfyUI.

<figure><img src="https://294092636-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7fltFYqYEvPsIC3Q4T3z%2Fuploads%2FYjrXtqBBMQNPHwj5zIJ3%2FScreenshot%202024-07-23%20at%2011.25.45%20PM%20(1).png?alt=media&#x26;token=dc0e90ca-4573-43be-92d6-0f945c0f3c92" alt="" width="375"><figcaption><p>Export snapshot.json from ComfyUI-Manager</p></figcaption></figure>

After saving, your snapshot.json will be under `ComfyUI/custom_nodes/ComfyUI-Manager/snapshots`

### 2. Create ComfyUI machine

open <https://www.nodecafe.co/machine> → Create Machine → paste the snapshot.json you prepared in last step → Create

<figure><img src="https://294092636-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7fltFYqYEvPsIC3Q4T3z%2Fuploads%2FgoIPTZvyJ7QCrFXjSPTm%2FScreenshot%202024-07-23%20at%2011.24.59%20PM.png?alt=media&#x26;token=25f9d377-16c9-4af4-939b-c3bd27e264fc" alt="" width="563"><figcaption></figcaption></figure>

Wait for around 10 to 30 minutes until the build is finished. The more models and nodes you install in the machine, the slower it will take. So try to keep only the necessary ones.

Refresh the machine page until you see that Server status is ready and “Open ComfyUI” button is clickable

<figure><img src="https://294092636-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7fltFYqYEvPsIC3Q4T3z%2Fuploads%2Fk2WaHorNjj00Ji1VvJ0D%2FScreenshot%202024-07-23%20at%2011.40.23%20PM.png?alt=media&#x26;token=66b13b50-5a56-42e6-90d2-3f5ceb5b29c5" alt=""><figcaption></figcaption></figure>

Click “Open ComfyUI” button and it should open up the ComfyUI with your custom nodes installed 🎉

<figure><img src="https://294092636-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7fltFYqYEvPsIC3Q4T3z%2Fuploads%2Fw8r3eFkyVrh0hYDH7m6D%2FScreenshot%202024-08-23%20at%205.05.12%20PM.png?alt=media&#x26;token=a285dc65-ae3f-4e2a-b0b9-1dbf36bb96b7" alt=""><figcaption></figcaption></figure>

### 3. Install Models

#### Install to network volume (Recommended)

If you want to install models, you need to connect a "live GPU session", where you will connect to a exclusive GPU server and pay for the entire period when you are connected. &#x20;

<figure><img src="https://294092636-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7fltFYqYEvPsIC3Q4T3z%2Fuploads%2FvwvMmyNqIpi1fdpeh6AE%2FScreenshot%202024-09-12%20at%204.49.20%20PM.png?alt=media&#x26;token=643fcb30-ba90-45b6-8557-9052bf03a0bc" alt=""><figcaption></figcaption></figure>

Wait for 1 or 2 minutes til ComfyUI server started and click the "Open ComfyUI" button on  `nodecafe.co/job/your-job-id` page

<figure><img src="https://294092636-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7fltFYqYEvPsIC3Q4T3z%2Fuploads%2Fn2iaG99lUXdl6EeCfMAB%2FScreenshot%202024-09-12%20at%204.53.51%20PM.png?alt=media&#x26;token=05edd7e2-6370-4631-b57d-a34980320519" alt=""><figcaption></figcaption></figure>

Once you opened the ComfyUI, click "Models" then you can "Upload File" to it.

<figure><img src="https://294092636-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7fltFYqYEvPsIC3Q4T3z%2Fuploads%2FcMMhcYxtGOVlAoJeXfGS%2FScreenshot%202024-09-12%20at%205.08.39%20PM.png?alt=media&#x26;token=8da85196-418a-4e5d-8034-09f18ad9a44c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://294092636-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7fltFYqYEvPsIC3Q4T3z%2Fuploads%2F0pOf0Q2kioDg5Zb9EgZA%2FScreenshot%202024-09-12%20at%204.59.14%20PM.png?alt=media&#x26;token=525a51a7-e79a-4222-9ec8-2d12d455a108" alt="" width="375"><figcaption></figcaption></figure>

#### \[Optional] Install to docker image

Optionally, you can bake models into the docker image which will give you faster model loading speed than installing models on network volume. To bake models into docker image, you can add the model download url into your snapshot.json of your machine snapsho in [#id-2.-create-comfyui-machine](#id-2.-create-comfyui-machine "mention")

```json
{
  "models": {
    "checkpoints/cardosAnime_v20.safetensors": {
      "url": "https://huggingface.co/ckpt/cardos-anime/resolve/main/cardosAnime_v20.safetensors"
    }
  },
  "git_custom_nodes": {
    "https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved": {
      "hash": "72482e70f73336a3dd61cbf9cc7d973137e9b33d"
    }
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nodecafe.gitbook.io/doc/custom-nodes-and-models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
