n8n-nodes-comfyui
v0.0.9
Published
n8n node to integrate with ComfyUI stable diffusion workflows
Maintainers
Readme

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
Prerequisites
- n8n (version 1.0.0 or later)
- ComfyUI instance running and accessible
- Node.js 22.16 or newer
Installation
pnpm install n8n-nodes-comfyuiOr 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
- JPEG / PNG / WebP — images are decoded and re-encoded via sharp
- Raw (Original) — files are downloaded as-is without any conversion; useful for formats sharp doesn't support, or when you want to preserve the original file exactly
Outputs
Each output item contains:
JSON fields
filename— original filename from ComfyUItype—outputortempsubfolder— subfolder path if anymediaType—imageorvideo
Binary (data)
- The file content as binary data, with correct
mimeTypeandfileExtensionset
Multiple 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
- Export your workflow from ComfyUI via Save (API Format)
- Add the ComfyUI node to your n8n workflow
- Paste the workflow JSON into the Workflow JSON field
- Set the API URL in the credentials
- Execute — generated images and videos will appear as binary outputs
Error Handling
The node handles:
- API connection failures
- Invalid workflow JSON
- ComfyUI execution errors (with node ID and error message)
- Timeout conditions
- Individual file download failures (non-fatal; returns error in
json.error)
Development
# Install dependencies
pnpm install
# Build
pnpm build
# Watch mode
pnpm dev
# Lint
pnpm lint