npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-comfyui-all

v2.5.3

Published

n8n community nodes for ComfyUI workflow execution with dynamic parameter support

Readme

n8n-nodes-comfyui-all

Execute ComfyUI workflows in n8n - Generate images, videos, and more with AI!

npm version

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

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!

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/YOUR_API_KEY
# 48G GPU: https://www.runninghub.cn/proxy-plus/YOUR_API_KEY

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):

  • 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 interactions

Action 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

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:

  • Manual mode selection conflicts with high-confidence detection
  • Helps prevent configuration mistakes
  • Always shows detection results for transparency

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/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 |

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 mountains

AI: 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 Mode

Node 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": "base64_encoded_image",
      "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 Detect

Node 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/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 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

  • 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

Usage Tips

  • 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

✅ 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:

  • 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

✅ 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

  • 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

"Invalid ComfyUI URL"

  • Make sure ComfyUI is running
  • Check the URL format: http://127.0.0.1:8188 or http://localhost:8188

"Workflow execution timeout"

  • Increase the timeout value in node settings
  • Check if ComfyUI is processing the workflow

"Node ID not found"

  • Check your workflow JSON
  • Node IDs are strings like "6", "3", "13"
  • Make sure the node exists in your workflow

"Failed to download image"

  • Make sure to URL is publicly accessible
  • Cannot use localhost URLs in Tool mode
  • Check network connectivity

"Workflow execution cancelled"

  • Task was cancelled by user or system
  • Check n8n logs for cancellation details
  • This is normal behavior and not an error

"Binary property not found"

  • Check the previous node's "Output Binary Key" setting
  • Make sure binary data exists in input
  • Verify the property name matches

"AI Agent doesn't call ComfyUI"

  • 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"

"Tool mode doesn't support binary input"

  • Use URL input instead of binary in Tool mode
  • Or switch to Action mode if you need binary support

Architecture & Improvements

Recent Enhancements (v2.4.15)

🎯 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

What's New

Latest Updates (v2.4.15+)

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

Need Help?


License

MIT


Happy automating with ComfyUI! 🚀