> ## 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.

# ComfyUI Integration

> Generate presentation images using your local ComfyUI server

Presenton can connect to your ComfyUI server to generate images for presentations. Instead of using cloud services like DALL-E or Pexels, you can use your own local setup with any model (FLUX, Stable Diffusion, SDXL, etc.).

***

### 🛠️ Step 1: Start ComfyUI with Network Access

Launch ComfyUI with the `--listen` flag to allow external connections:

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

***

### 🎨 Step 2: Create and Test Your Workflow

Open ComfyUI in your browser and create a text-to-image workflow. **Test it first** — make sure it generates images successfully before proceeding.

***

### ✏️ Step 3: Rename Your Prompt Node

This is the **most important** step. Presenton needs to know which node to inject the prompt into.

1. Find your prompt node (the node where you enter your text prompt)
2. Right-click on it → **Title**
3. Rename it to exactly **"Input Prompt"**

> ⚠️ **Why is this required?**
>
> When Presenton generates an image, it needs to replace the prompt text in your workflow. It searches for a node with the title "Input Prompt" to know exactly where to inject the prompt.
>
> Without this, Presenton cannot determine which text field to modify.

***

### 📦 Step 4: Export Workflow in API Format

1. Click the **gear icon** (⚙️) in ComfyUI
2. Enable **"Enable Dev mode Options"**
3. Click on ComfyUI Logo at top left → **File**
4. Click **"Export (API)"** — this downloads a JSON file

> 📝 **Note:** You must use **"Export (API)"**, not the regular "Save" button. The API format contains the node structure that Presenton needs.

***

### ⚙️ Step 5: Configure Presenton

1. Go to **Settings** in Presenton
2. Select **"ComfyUI"** as image provider
3. Enter your **ComfyUI Server URL**
4. Paste the **workflow JSON** content
5. Save

***

## Server URL

Enter the URL where your ComfyUI server is running:

| Setup            | URL Format                | Example                       |
| ---------------- | ------------------------- | ----------------------------- |
| Local ComfyUI    | `http://<YOUR_IP>:<PORT>` | `http://192.168.1.100:8188`   |
| Deployed ComfyUI | Your deployment URL       | `https://comfyui.example.com` |

> 💡 The default ComfyUI port is **8188**. To find your IP address, run `hostname -I` on Linux/Mac or `ipconfig` on Windows.

***

## Node Requirement

For Presenton to work with your workflow:

| Requirement | Value                                 |
| ----------- | ------------------------------------- |
| Node Title  | **"Input Prompt"** (case-insensitive) |

### How It Works

1. Presenton parses your workflow JSON
2. It searches for a node where `_meta.title` equals "Input Prompt"
3. It replaces the `text` input with the generated prompt
4. The modified workflow is sent to ComfyUI for image generation

### What the JSON Looks Like

Your exported workflow should have a node like this:

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

Presenton will replace `"your placeholder text"` with the actual prompt.

***

## ✅ Checklist

Before using ComfyUI with Presenton, verify:

* [ ] ComfyUI is running with `--listen 0.0.0.0`
* [ ] Your workflow generates images successfully when tested manually
* [ ] Your prompt node is renamed to **"Input Prompt"**
* [ ] You exported using **"Export (API)"**
* [ ] You can access ComfyUI from the URL you're using
