Description
n8n-nodes-comfyui-all
> Execute ComfyUI workflows in n8n – Generate images, videos, and more with AI!

Video Tutorials
| Platform | Link | Description |
|———-|——|————-|
| πΊ YouTube | Watch Tutorial | English tutorial |
| πΊ Bilibili | θ§ηζη¨ | δΈζζη¨ |
What This Does
This package adds one intelligent node to n8n that automatically detects how it’s being used:
ComfyUI Node – Universal ComfyUI workflow executor
- β Auto-detects execution mode (Tool for AI Agents or Action for workflows)
- β Manual mode override available
- β Works with AI Agents as a tool
- β Works in regular workflows with full binary support
- β Supports URL and binary image input
- β Dynamic parameter overrides
- Generate images from text prompts
- Process and edit images
- Generate videos
- Use AI Agents to create images automatically
- And much more with any ComfyUI workflow!
You can use this node to:
—
Quick Setup
1. Install
n8n Cloud: Settings β Community Nodes β Install β n8n-nodes-comfyui-all
Self-hosted:
cd ~/.n8n
npm install n8n-nodes-comfyui-all
2. Run ComfyUI
Option A: Local ComfyUI
Default: http://127.0.0.1:8188
Option B: RunningHub Cloud Service
RunningHub provides cloud ComfyUI service
Get your API key from: https://www.runninghub.cn/?inviteCode=rh-v1052
Use one of these URLs:
24G GPU: https://www.runninghub.cn/proxy/YOURAPIKEY
48G GPU: https://www.runninghub.cn/proxy-plus/YOURAPIKEY
3. Use in n8n
Add the ComfyUI node to your workflow! It will automatically detect of best execution mode.
—
How It Works
Execution Modes
The ComfyUI node supports three execution modes:
Auto Detect (default):
Tool Mode (for AI Agents):
[Chat Input] β [AI Agent] β [ComfyUI]
Action Mode (for regular workflows):
[HTTP Request] β [ComfyUI] β [Save File]
Detection Priority
When using Auto Detect mode, the node checks in this order:
1. n8n API – Checks if called by AI Agent via isToolExecution()
2. Execution Context – Checks for chat mode context
3. Input Data – Checks for AI Agent markers in input data
4. Heuristics – Analyzes input characteristics
5. Default – Falls back to Action mode
Smart Warnings
The node provides intelligent warnings when:
—
Parameters Explained
Main Parameters
| Parameter | What It Does | Example |
|———–|————–|———|
| ComfyUI URL | Where ComfyUI is running | http://127.0.0.1:8188 (local) or https://www.runninghub.cn/proxy/YOURAPIKEY (RunningHub) |
| Workflow JSON | Your ComfyUI workflow (API format) | {...} |
| Timeout | Max wait time for execution (seconds) | 300 (5 minutes) |
| Output Binary Key | Property name for output binary data | data |
| Execution Mode | Auto/Tool/Action mode selection | Auto Detect |
| Node Parameters | Dynamic workflow parameter overrides | See below |
Node Parameters
These allow you to dynamically override any value in your ComfyUI workflow.
| Field | What It Does |
|——-|————–|
| Node ID | The ComfyUI node to change (e.g., “6”, “13”) |
| Parameter Mode | “Single” for one parameter, “Multiple” for JSON object |
| Type | Text, Number, Boolean, Image, or File |
| Value | The value to set (for single mode) |
| Image Input Type | URL or Binary (for image or file type) |
| Image URL | URL of image (when using URL input) |
| Parameters JSON | JSON object with multiple parameters |
—
Usage Examples
Example 1: Generate Image with AI Agent
Workflow:
[Chat Interface] β [AI Agent] β [ComfyUI]
Setup:
1. Add ComfyUI to AI Agent tools
2. Configure ComfyUI node:
– ComfyUI URL: http://127.0.0.1:8188
– Workflow JSON: Your text-to-image workflow
– Execution Mode: Auto Detect
– Timeout: 300
Chat:
You: Generate an image of a sunset over mountainsAI: I'll generate that image for you!
[Automatically uses Tool mode]
Done! Here's your image π¨
[Returns image URL]
Output:
{
"success": true,
"imageUrls": ["http://127.0.0.1:8188/view?filename=image.png"],
"imageCount": 1
}
—
Example 2: Process Image in Workflow
Workflow:
[HTTP Request] β [ComfyUI] β [Save to File]
Setup:
ComfyUI URL: http://127.0.0.1:8188
Workflow JSON: [Your image processing workflow]
Execution Mode: Action ModeNode Parameters:
Node ID: 107
Type: Image
Image Input Type: URL
Image URL: https://example.com/image.png
Output (Action mode with binary):
{
"success": true,
"data": {...},
"binary": {
"data": {
"data": "base64encodedimage",
"mimeType": "image/png",
"fileName": "ComfyUI_00001.png"
}
},
"imageCount": 1
}
—
Example 3: Dynamic Text Prompt
Setup:
ComfyUI Node:
ComfyUI URL: http://127.0.0.1:8188
Workflow JSON: [Text-to-Image workflow]
Execution Mode: Auto DetectNode Parameters:
Node ID: 6 (CLIP Text node)
Type: Text
Value: {{ $json.prompt }}
Input:
{ "prompt": "a cyberpunk city at night, neon lights" }
—
Example 4: Multiple Parameters
Setup:
Node Parameters:
Node ID: 3
Parameter Mode: Multiple Parameters
Parameters JSON:
{
"width": 1024,
"height": 1024,
"steps": 30,
"cfg_scale": 8
}
—
Example 5: Generate Video
Same as image generation, just use a video workflow!
Output:
{
"success": true,
"videoUrls": ["http://127.0.0.1:8188/view?filename=video.mp4"],
"videoCount": 1
}
—
How to Get Your Workflow JSON
1. Open ComfyUI
2. Create or load your workflow
3. Click “Save (API Format)” (not “Save”)
4. Copy the JSON
5. Paste it in the node’s Workflow JSON field
—
RunningHub Cloud Service
RunningHub provides cloud ComfyUI service that is fully compatible with this node.
Getting Started
1. Get Your API Key
– International users (outside China): https://www.runninghub.ai/?inviteCode=rh-v1052
– China mainland users: https://www.runninghub.cn/?inviteCode=rh-v1052
– Register using either link above
2. Choose Your GPU Plan
– 24G GPU: Standard performance
– 48G GPU: High performance (for complex workflows)
3. Configure ComfyUI Node
– International users: Use one of:
– 24G: https://www.runninghub.ai/proxy/YOURAPIKEY
– 48G: https://www.runninghub.ai/proxy-plus/YOURAPIKEY
– China mainland users: Use one of:
– 24G: https://www.runninghub.cn/proxy/YOURAPIKEY
– 48G: https://www.runninghub.cn/proxy-plus/YOURAPIKEY
– Replace YOURAPIKEY with your actual API key
4. Model Management
– Browse models in RunningHub’s model library
– Click “β
” to favorite models you want to use
– Favorited models will be available in your workflows
5. π Bonus Rewards
– Use invite code rh-v1052 when registering
– Get 1000 RH coins as bonus reward
– Coins can be used for premium features on RunningHub
– Works for both international and China mainland users
Advantages of RunningHub
Usage Tips
—
Tips & Tricks
β Find Your Node ID
Open your workflow JSON and look for:
{
"6": {
"inputs": {...},
"class_type": "KSampler"
}
}
The "6" is your Node ID!
β URL vs Binary Input
Use URL when:
Use Binary when:
β Test First
Always test your workflow in ComfyUI before using it in n8n!
β Use Appropriate Timeouts
Simple workflows: 60-120 seconds
Complex workflows: 300-600 seconds
Video generation: 600-1800 seconds
β Execution Mode Tips
—
Troubleshooting
“Invalid ComfyUI URL”
http://127.0.0.1:8188 or http://localhost:8188“Workflow execution timeout”
“Node ID not found”
“Failed to download image”
“Workflow execution cancelled”
“Binary property not found”
“AI Agent doesn’t call ComfyUI”
“Tool mode doesn’t support binary input”
—
Architecture & Improvements
Recent Enhancements (v2.4.15)
π― Execution Mode Control
π€ Smart Mode Detection
isToolExecution()π¦ Modular Architecture
ImageProcessor – Dedicated image handlingParameterTypeHandler – Type conversion logicParameterProcessor – Main coordinatorexecutionModeDetector – Multi-layer mode detectionComfyUiClient – HTTP client with retry logicβ Code Quality
—
What’s New
Latest Updates (v2.4.15+)
Bug Fixes (Commit: 3891f1b1):
Recent Enhancements:
—
Need Help?
—
License
MIT
—
Happy automating with ComfyUI! π