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

# Use ComfyUI for presentation images

> Connect Presenton Open Source to a reachable ComfyUI server and an API-format image workflow.

Presenton can send generated image prompts to your own ComfyUI workflow. This supports local or hosted models such as FLUX, Stable Diffusion, and SDXL while keeping the image pipeline under your control.

## Before you start

* Build and test a text-to-image workflow directly in ComfyUI.
* Ensure the Presenton container can reach the ComfyUI server.
* Decide whether to configure the provider in **Settings** or with environment variables.

## 1. Expose ComfyUI to Presenton

Start ComfyUI on an interface reachable from the Presenton container:

```bash theme={null}
python main.py --listen 0.0.0.0
```

The default port is `8188`. Restrict network access with a firewall or private container network; an exposed ComfyUI server can run resource-intensive workflows.

| ComfyUI location       | Example URL from Presenton         |
| ---------------------- | ---------------------------------- |
| Docker host            | `http://host.docker.internal:8188` |
| Compose service        | `http://comfyui:8188`              |
| Another LAN host       | `http://192.168.1.100:8188`        |
| Secured remote service | `https://comfyui.example.com`      |

<Warning>
  `localhost` inside the Presenton container points to Presenton, not to ComfyUI running on the host.
</Warning>

## 2. Mark the prompt node

Presenton must know where to inject each image prompt:

1. Find the positive text-prompt node in ComfyUI.
2. Right-click it and choose **Title**.
3. Rename it to exactly `Input Prompt`.

Presenton searches the exported workflow for `_meta.title` equal to `Input Prompt` (case-insensitive), then replaces its writable prompt text. A compatible node resembles:

```json theme={null}
{
  "6": {
    "inputs": {
      "text": "placeholder prompt",
      "clip": ["4", 1]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "Input Prompt"
    }
  }
}
```

## 3. Export the API workflow

1. Open ComfyUI settings and enable **Dev mode Options**.
2. Open **File** from the ComfyUI menu.
3. Choose **Export (API)**.

Use the API export, not the normal workflow save. Presenton needs the API node graph.

## 4. Configure Presenton

In **Settings → Image provider**, select **ComfyUI**, enter the server URL, paste the complete exported workflow JSON, and save.

For a managed deployment, set the same values as environment variables:

```dotenv theme={null}
IMAGE_PROVIDER=comfyui
COMFYUI_URL=http://host.docker.internal:8188
COMFYUI_WORKFLOW={"6":{"inputs":{"text":"placeholder prompt"},"class_type":"CLIPTextEncode","_meta":{"title":"Input Prompt"}}}
```

`COMFYUI_WORKFLOW` contains the exported JSON itself, not a filesystem path. For Compose, quote or escape the JSON according to your environment-file tooling. The Settings UI is often easier for large workflows.

## 5. Test the integration

Generate a short presentation that requests images, then verify:

* ComfyUI receives a job at `/prompt`.
* The `Input Prompt` node contains the generated prompt.
* The workflow produces an image output rather than only previews or latent data.
* Presenton can read the ComfyUI history and download the output.
* Repeated images use different seeds where supported by the workflow.

## Troubleshooting

| Symptom                            | Check                                                               |
| ---------------------------------- | ------------------------------------------------------------------- |
| Cannot connect                     | Test `COMFYUI_URL` from inside the Presenton container              |
| `Input Prompt` not found           | Re-export after renaming the prompt node                            |
| Workflow rejected                  | Confirm you used **Export (API)** and the workflow runs manually    |
| Job completes but no image appears | Ensure the workflow has a save/output image node                    |
| Every result looks identical       | Confirm the sampler seed is writable and not fixed by a custom node |

<Card title="Images and web search" icon="images" href="/open-source/v0.9.0-beta/configuration/images-and-search">
  Compare ComfyUI with stock, hosted, and OpenAI-compatible image providers.
</Card>
