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

# Local ComfyUI setup

> Run API-format workflow JSON against a ComfyUI installation on your machine.

# Local ComfyUI setup

## What this lets you do

Run your own ComfyUI workflow through DreamLayer WebUI, the SDKs, or an orchestrator.

## What you need

* A local ComfyUI installation
* Every checkpoint, LoRA, and custom node required by the workflow
* A DreamLayer clone running on the same machine

## Steps

### 1. Start ComfyUI

Run ComfyUI on its loopback address. DreamLayer does not install ComfyUI, models, checkpoints, LoRAs, or custom nodes.

### 2. Export API-format JSON

In ComfyUI, use the developer option to save the workflow in API format. The normal browser workflow format is not executable through the transport.

### 3. Create the runtime configuration

Copy the shipped example, then set the workflow path, output node, supported operations, and any DreamLayer placeholders used by your graph.

```bash theme={null}
cp examples/comfyui/runtime-config.example.json comfyui-config.json
```

Use `__DREAMLAYER_PROMPT__`, `__DREAMLAYER_WIDTH__`, and `__DREAMLAYER_HEIGHT__` in the exported graph. Add `__DREAMLAYER_INPUT_IMAGE__` only when the workflow declares `image_to_image`.

### 4. Save the configuration and validate

```bash theme={null}
./dreamlayer configure --name DREAMLAYER_COMFYUI_CONFIG
./dreamlayer doctor
```

When prompted, enter the absolute path to `comfyui-config.json`.

### 5. Map inputs and output

The workflow registration declares which node inputs accept prompt, width, height, and an optional reference image, plus which node produces the final image.

## Confirm it worked

`./dreamlayer doctor` reports the ComfyUI configuration as ready, the configured workflow appears in DreamLayer WebUI, and one turn returns the mapped final image.

## Common errors

An unavailable checkpoint, custom node, input mapping, or output mapping fails visibly before DreamLayer reports a completed result. No silent substitution occurs.

## Troubleshooting

Confirm that ComfyUI answers at `http://127.0.0.1:8188`, the file is API-format JSON, and all referenced nodes are installed. DreamLayer does not validate every model and hardware combination.

## Next steps

* [Create a turn in DreamLayer WebUI](/webui)
* [Build your own orchestrator](/orchestrators)
* [Review provider compatibility](/connectors)
