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

# Create Environment

A machine defines the environment your **workflow** will run in.

## Why define the environment?

<Note>
  By defining the environment in a machine, it allows us to be sure that if call us via API, or your teammate wants to use your workflow. It will behave the same way it did with you.

  No more "it works on my machine" problems, you all share the same machine (config)!
</Note>

## How

We give you 2 ways to define your environment.

* `Custom Nodes`
* `Docker Commands`

<Frame>
  <img src="https://mintcdn.com/comfydeploy/o5fOxSEVTG8z9WUO/images/machine/environment-primitives.png?fit=max&auto=format&n=o5fOxSEVTG8z9WUO&q=85&s=18f3f77055ed605c080d55a5cc6b0b87" width="300" data-path="images/machine/environment-primitives.png" />
</Frame>

### Custom Nodes

You can easily add any custom node that you would find in **ComfyUI Manager** via our picker.

<Note>
  We will use the latest version of the node by default. If you want to use a specific version, you can set the hash of the custom node.
</Note>

<Frame>
  <img src="https://mintcdn.com/comfydeploy/o5fOxSEVTG8z9WUO/images/machine/custom-node-list.png?fit=max&auto=format&n=o5fOxSEVTG8z9WUO&q=85&s=670a0aaf8c2ecbab7c0b475f21e6b643" width="500" data-path="images/machine/custom-node-list.png" />
</Frame>

### Docker Commands

Machines also support docker commands in machine settings.

<Note>
  We follow the dockerfile command convention, read more [here](https://docs.docker.com/reference/dockerfile/).
</Note>

<Frame>
  <img src="https://mintcdn.com/comfydeploy/o5fOxSEVTG8z9WUO/images/machine/docker-commands.png?fit=max&auto=format&n=o5fOxSEVTG8z9WUO&q=85&s=3f4c1c6f0e26fe7b2d1a788e4f70ea8f" width="500" data-path="images/machine/docker-commands.png" />
</Frame>

Here are some templates for common uses of docker commands.

#### System packages

If you need specific system packages

Change:

* `<package-name>` with the name of the package you want to install.

```Dockerfile theme={null}
RUN apt-get update && apt-get install -y <package-name>
```

#### Models in custom node directories

Some custom nodes require models to be installed in the custom node directory.
Update:

* `<CustomNode-Directory>` with the name of the custom node directory.
* `<model-url>` with the url of the model.

```Dockerfile theme={null}
RUN wget -P /comfyui/custom_nodes/<CustomNode-Directory> <model-url>
```

#### pip packages

Update:

* `<package-name>` with the name of the package you want to install.

```Dockerfile theme={null}
RUN pip install <package-name>
```

#### Custom nodes

Update:

* `<git-url>` with the url of the git repository you want to install.
* `<custom-node-name>` with the name of the custom node you want to install.
* `<commit-hash>` with the hash of the commit you want to install.

```Dockerfile theme={null}
WORKDIR /comfyui/custom_nodes
RUN git clone <git-url> --recursive
WORKDIR /comfyui/custom_nodes/<custom-node-name>
RUN git reset --hard <commit-hash>
RUN if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
RUN if [ -f install.py ]; then python install.py || echo "install script failed"; fi
```
