Description
n8n-nodes-comfyui
This package provides an n8n node to integrate with ComfyUI — a powerful and modular stable diffusion GUI with a graph/nodes interface.
Features
- Execute ComfyUI workflows directly from n8n
- Support for multiple input items (each item runs its own workflow)
- Automatic retrieval of generated images and videos
- Output format conversion: JPEG, PNG, WebP, or Raw (no conversion)
- Quality control for JPEG and WebP output
- Progress monitoring and error handling
- Optional API key authentication
- Configurable timeout
- n8n (version 1.0.0 or later)
- ComfyUI instance running and accessible
- Node.js 22.16 or newer
Prerequisites
Installation
pnpm install n8n-nodes-comfyui
Or via the n8n community nodes panel: search for n8n-nodes-comfyui.
Node Configuration
Credentials
| Field | Description |
|———|———————————————————-|
| API URL | URL of your ComfyUI instance (e.g. http://127.0.0.1:8188) |
| API Key | Optional — required if your ComfyUI has authentication enabled |
Parameters
| Parameter | Description |
|—————-|—————————————————————————–|
| Workflow JSON | ComfyUI workflow exported as JSON (API format) |
| Output Format | JPEG / PNG / WebP / Raw (Original) — applies to image outputs only |
| JPEG Quality | Quality 1–100 (shown when Output Format is JPEG) |
| WebP Quality | Quality 1–100 (shown when Output Format is WebP) |
| Timeout | Maximum minutes to wait for workflow completion (default: 30) |
Output Format notes
Outputs
Each output item contains:
JSON fields
filename — original filename from ComfyUItype — output or tempsubfolder — subfolder path if anymediaType — image or videoBinary (data)
mimeType and fileExtension setMultiple Input Items
When multiple items are passed into this node, each item is processed sequentially — one ComfyUI workflow execution per item. This allows expressions in the Workflow JSON field to reference each item’s data (e.g. {{ $json.prompt }}).
Usage
1. Export your workflow from ComfyUI via Save (API Format)
2. Add the ComfyUI node to your n8n workflow
3. Paste the workflow JSON into the Workflow JSON field
4. Set the API URL in the credentials
5. Execute — generated images and videos will appear as binary outputs
Error Handling
The node handles:
json.error)Development
Install dependencies
pnpm installBuild
pnpm buildWatch mode
pnpm devLint
pnpm lint