n8n community nodes for ComfyUI workflow execution with dynamic parameter support
npm install n8n-nodes-comfyui-all> Execute ComfyUI workflows in n8n - Generate images, videos, and more with AI!

| Platform | Link | Description |
|----------|------|-------------|
| πΊ YouTube | Watch Tutorial | English tutorial |
| πΊ Bilibili | θ§ηζη¨ | δΈζζη¨ |
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
You can use this node to:
- 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!
---
bash
n8n Cloud: Settings β Community Nodes β Install β n8n-nodes-comfyui-all
Self-hosted:
cd ~/.n8n
npm install n8n-nodes-comfyui-all
`$3
Option A: Local ComfyUI
`bash
Default: http://127.0.0.1:8188
`Option B: RunningHub Cloud Service
`bash
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/YOUR_API_KEY
48G GPU: https://www.runninghub.cn/proxy-plus/YOUR_API_KEY
`$3
Add the ComfyUI node to your workflow! It will automatically detect of best execution mode.
---
How It Works
$3
The ComfyUI node supports three execution modes:
Auto Detect (default):
- Automatically detects the best mode based on context
- Uses Tool mode when called by AI Agents
- Uses Action mode for regular workflows
Tool Mode (for AI Agents):
`
[Chat Input] β [AI Agent] β [ComfyUI]
`
- Detects AI Agent context
- Returns image URLs (compact, LLM-friendly)
- Supports URL image input
- Dynamic parameter overrides
- Optimized for AI Agent interactionsAction Mode (for regular workflows):
`
[HTTP Request] β [ComfyUI] β [Save File]
`
- Used in standard workflows
- Returns full binary data
- Supports URL and binary image input
- Full workflow integration$3
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$3
The node provides intelligent warnings when:
- Manual mode selection conflicts with high-confidence detection
- Helps prevent configuration mistakes
- Always shows detection results for transparency
---
Parameters Explained
$3
| Parameter | What It Does | Example |
|-----------|--------------|---------|
| ComfyUI URL | Where ComfyUI is running |
http://127.0.0.1:8188 (local) or https://www.runninghub.cn/proxy/YOUR_API_KEY (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 |$3
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
$3
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: 300Chat:
`
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:
`json
{
"success": true,
"imageUrls": ["http://127.0.0.1:8188/view?filename=image.png"],
"imageCount": 1
}
`---
$3
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):
`json
{
"success": true,
"data": {...},
"binary": {
"data": {
"data": "base64_encoded_image",
"mimeType": "image/png",
"fileName": "ComfyUI_00001.png"
}
},
"imageCount": 1
}
`---
$3
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:
`json
{ "prompt": "a cyberpunk city at night, neon lights" }
`---
$3
Setup:
`
Node Parameters:
Node ID: 3
Parameter Mode: Multiple Parameters
Parameters JSON:
{
"width": 1024,
"height": 1024,
"steps": 30,
"cfg_scale": 8
}
`---
$3
Same as image generation, just use a video workflow!
Output:
`json
{
"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.
$3
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/YOUR_API_KEY
- 48G: https://www.runninghub.ai/proxy-plus/YOUR_API_KEY
- China mainland users: Use one of:
- 24G: https://www.runninghub.cn/proxy/YOUR_API_KEY
- 48G: https://www.runninghub.cn/proxy-plus/YOUR_API_KEY
- Replace YOUR_API_KEY with your actual API key4. 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$3
- β
No local setup required - No need to install ComfyUI locally
- β
High performance - Cloud GPUs with fast processing
- β
Easy integration - Just change the URL in n8n
- β
Full compatibility - Works exactly like local ComfyUI
- β
Model library - Access to pre-installed models
- β
Auto-scaling - Handles complex workflows automatically
$3
- For simple workflows, 24G GPU is sufficient
- For complex workflows (video, high-res images), use 48G GPU
- The node automatically handles RunningHub's response format
- Works in both Tool mode (URLs only) and Action mode (full binary)
---
Tips & Tricks
$3
Open your workflow JSON and look for:
`json
{
"6": {
"inputs": {...},
"class_type": "KSampler"
}
}
`
The "6" is your Node ID!$3
Use URL when:
- Working with AI Agents (smaller context)
- Images are publicly accessible
- Processing multiple images
- Tool Mode execution
Use Binary when:
- Images are from previous n8n nodes
- Working with local files
- Need full image data in workflow
- Action Mode execution
$3
Always test your workflow in ComfyUI before using it in n8n!
$3
`
Simple workflows: 60-120 seconds
Complex workflows: 300-600 seconds
Video generation: 600-1800 seconds
`$3
- Use Auto Detect for most cases
- Use Tool Mode when specifically working with AI Agents
- Use Action Mode for standard workflow processing
- Check n8n logs for detection results and warnings
---
Troubleshooting
$3
- Make sure ComfyUI is running
- Check the URL format: http://127.0.0.1:8188 or http://localhost:8188$3
- Increase the timeout value in node settings
- Check if ComfyUI is processing the workflow$3
- Check your workflow JSON
- Node IDs are strings like "6", "3", "13"
- Make sure the node exists in your workflow$3
- Make sure to URL is publicly accessible
- Cannot use localhost URLs in Tool mode
- Check network connectivity$3
- Task was cancelled by user or system
- Check n8n logs for cancellation details
- This is normal behavior and not an error$3
- Check the previous node's "Output Binary Key" setting
- Make sure binary data exists in input
- Verify the property name matches$3
- Make sure ComfyUI is added to Agent's tools
- Check the workflow JSON is set
- Try being more specific in your chat: "Generate an image of..." instead of "Help me with images"$3
- Use URL input instead of binary in Tool mode
- Or switch to Action mode if you need binary support---
Architecture & Improvements
$3
π― Execution Mode Control
- Auto Detect mode for smart detection
- Manual Tool/Action mode override
- Intelligent warnings on mode conflicts
π€ Smart Mode Detection
- Primary: n8n API
isToolExecution()
- Secondary: Execution context (chat mode)
- Tertiary: AI Agent metadata markers
- Fallback: Heuristic analysis
- Default: Action modeπ¦ Modular Architecture
-
ImageProcessor - Dedicated image handling
- ParameterTypeHandler - Type conversion logic
- ParameterProcessor - Main coordinator
- executionModeDetector - Multi-layer mode detection
- ComfyUiClient` - HTTP client with retry logicβ
Code Quality
- ESLint v9 flat config
- Zero non-null assertions
- Comprehensive type validation
- All ES6 imports
- Config object pattern
---
Bug Fixes (Commit: 3891f1b1):
- β
Fixed video processing loop index error
- β
Added null check for videoBuffer to prevent undefined errors
- β
Tool mode and Action mode now have identical UI (both support parameters)
Recent Enhancements:
- β
Execution Mode parameter (Auto/Tool/Action)
- β
Multi-layer detection strategy (5 levels)
- β
Smart warning system for mode conflicts
- β
UI text optimization
---
- π n8n Documentation
- π¬ n8n Community
- π Report Issues
- π§ Email: ksxh0524@outlook.com
---
MIT
---
Happy automating with ComfyUI! π