n8n-nodes-comfyui-all 2.4.5 → 2.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +273 -210
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,319 +1,382 @@
1
1
  # n8n-nodes-comfyui-all
2
2
 
3
- > n8n community node for integrating ComfyUI workflows into n8n automation platform.
3
+ > Execute ComfyUI workflows in n8n - Generate images, videos, and more with AI!
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/n8n-nodes-comfyui-all.svg)](https://www.npmjs.com/package/n8n-nodes-comfyui-all)
6
6
 
7
- ## ✨ Features
7
+ ## Video Tutorials
8
8
 
9
- - 🎨 **Universal Workflow Support** - Works with any ComfyUI workflow in API format
10
- - 🔄 **Dynamic Parameters** - Override workflow parameters dynamically
11
- - 🎬 **Multi-Modal Support** - Supports images and videos for both input and output
12
- - 🤖 **AI Agent Ready** - Two specialized nodes for different use cases:
13
- - **ComfyUI Tool** - Optimized for AI Agent workflows (URL-based image input)
14
- - **ComfyUI** - Full-featured node for standard workflows (binary & URL support)
15
- - 📊 **Flexible Configuration** - JSON mode or single parameter mode
16
- - 🔗 **Multiple Image Input Methods** - URL, binary data
17
- - 🏷️ **Customizable Output** - Customize binary output property names
9
+ - 📺 [YouTube Tutorial](https://youtu.be/wsbo3hBKsPM)
10
+ - 📺 [哔哩哔哩教程](https://www.bilibili.com/video/BV1ffrFBTEdQ/?vd_source=6485fe2fae664d8b09cb2e2fd7df5ef7)
18
11
 
19
- ## 📦 Installation
12
+ ## What This Does
20
13
 
21
- ### n8n Cloud
14
+ This package adds **two nodes** to n8n that let you run ComfyUI workflows:
22
15
 
23
- 1. Go to **Settings** → **Community Nodes**
24
- 2. Click **Install**
25
- 3. Enter: `n8n-nodes-comfyui-all`
26
- 4. Click **Install**
16
+ 1. **ComfyUI Tool** - For AI Agents (URL-based image input)
17
+ 2. **ComfyUI** - For standard workflows (supports binary & URL)
27
18
 
28
- ### Self-Hosted n8n
19
+ You can use these nodes to:
20
+ - Generate images from text prompts
21
+ - Process and edit images
22
+ - Generate videos
23
+ - Use AI Agents to create images automatically
24
+ - And much more with any ComfyUI workflow!
29
25
 
30
- ```bash
31
- cd ~/.n8n
32
- npm install n8n-nodes-comfyui-all
33
- ```
34
-
35
- Or via n8n interface: **Settings** → **Community Nodes** → **Install** → `n8n-nodes-comfyui-all`
26
+ ---
36
27
 
37
- > Restart n8n after installation.
28
+ ## Quick Setup
38
29
 
39
- ## 🚀 Quick Start
30
+ ### 1. Install
40
31
 
41
- ### 1. Prerequisites
32
+ ```bash
33
+ # n8n Cloud: Settings → Community Nodes → Install → n8n-nodes-comfyui-all
42
34
 
43
- - ComfyUI server running (default: `http://127.0.0.1:8188`)
44
- - n8n instance (version 2.x or higher)
35
+ # Self-hosted:
36
+ cd ~/.n8n
37
+ npm install n8n-nodes-comfyui-all
38
+ ```
45
39
 
46
- ### 2. Create Your Workflow in ComfyUI
40
+ ### 2. Run ComfyUI
47
41
 
48
- 1. Design your workflow in ComfyUI
49
- 2. Click **Save (API Format)** to export
50
- 3. Copy the generated JSON
42
+ Make sure ComfyUI is running:
43
+ ```bash
44
+ # Default: http://127.0.0.1:8188
45
+ ```
51
46
 
52
- ### 3. Configure n8n Node
47
+ ### 3. Use in n8n
53
48
 
54
- 1. Add **ComfyUI** node to your n8n workflow
55
- 2. Set **ComfyUI URL**: `http://127.0.0.1:8188`
56
- 3. Paste your **Workflow JSON**
57
- 4. Optionally configure **Node Parameters**
49
+ Add either **ComfyUI Tool** or **ComfyUI** node to your workflow!
58
50
 
59
- ## 📖 Usage
51
+ ---
60
52
 
61
- ### Basic Example: Text to Image
53
+ ## ComfyUI Tool vs ComfyUI Node
62
54
 
63
- **Node Configuration:**
64
- - **ComfyUI URL**: `http://127.0.0.1:8188`
65
- - **Workflow JSON**: Your ComfyUI workflow in API format
55
+ ### ComfyUI Tool 🤖
66
56
 
67
- **Optional Node Parameters (Single Parameter Mode):**
68
- - Node ID: `6` (your CLIP text node)
69
- - Parameter Name: `text`
70
- - Type: `Text`
71
- - Value: `a beautiful landscape, high quality`
57
+ **Use for: AI Agent workflows**
72
58
 
73
- ### Parameter Configuration Modes
59
+ ```
60
+ Example:
61
+ [Chat Input] → [AI Agent] → [ComfyUI Tool]
62
+ ```
74
63
 
75
- #### 1. Multiple Parameters Mode (JSON)
64
+ **Features:**
65
+ - ✅ Simple URL-based image input
66
+ - ✅ Works great with AI Agents
67
+ - ✅ Doesn't bloat LLM context (URLs are small!)
68
+ - ✅ Automatic image download
76
69
 
77
- Configure multiple parameters at once using JSON:
70
+ **How to use:**
71
+ 1. Add to AI Agent as a tool
72
+ 2. Set ComfyUI URL
73
+ 3. Paste your ComfyUI workflow JSON
74
+ 4. Set Load Image Node ID (if using images)
75
+ 5. Pass image URL: `{{ $json.imageUrl }}`
78
76
 
77
+ **Example:**
79
78
  ```json
80
79
  {
81
- "width": 1024,
82
- "height": 1024,
83
- "batch_size": 1,
84
- "seed": 12345
80
+ "imageUrl": "https://example.com/image.png",
81
+ "prompt": "Transform to oil painting"
85
82
  }
86
83
  ```
87
84
 
88
- #### 2. Single Parameter Mode
89
-
90
- Configure one parameter at a time with type validation:
85
+ ---
91
86
 
92
- - **Parameter Name**: `steps`
93
- - **Type**: `Number`
94
- - **Value**: `25`
87
+ ### ComfyUI Node 🔧
95
88
 
96
- ### Image Input Options
89
+ **Use for: Standard n8n workflows**
97
90
 
98
- The node supports two methods for uploading images to ComfyUI:
91
+ ```
92
+ Example:
93
+ [HTTP Request] → [ComfyUI] → [Save File]
94
+ ```
99
95
 
100
- #### Method 1: Binary Data
96
+ **Features:**
97
+ - ✅ Supports binary data (from previous nodes)
98
+ - ✅ Supports URL download
99
+ - ✅ Advanced parameter configuration
100
+ - ✅ Binary output for further processing
101
101
 
102
- Upload images from n8n binary data:
102
+ **How to use:**
103
103
 
104
- - **Type**: `Image`
105
- - **Image Input Type**: `Binary`
106
- - **Value**: Binary property name (e.g., `data`, `image`, `file`)
104
+ **Option 1: Binary Input**
105
+ ```
106
+ ComfyUI URL: http://127.0.0.1:8188
107
+ Workflow JSON: [Your workflow]
108
+
109
+ Node Parameters:
110
+ Node ID: 107
111
+ Type: Image
112
+ Image Input Type: Binary
113
+ Value: data
114
+ ```
107
115
 
108
- #### Method 2: URL
116
+ **Option 2: URL Input**
117
+ ```
118
+ ComfyUI URL: http://127.0.0.1:8188
119
+ Workflow JSON: [Your workflow]
120
+
121
+ Node Parameters:
122
+ Node ID: 107
123
+ Type: Image
124
+ Image Input Type: URL
125
+ Image URL: https://example.com/image.png
126
+ ```
109
127
 
110
- Download and upload images from a URL:
128
+ **Option 3: Text Input**
129
+ ```
130
+ Node Parameters:
131
+ Node ID: 6
132
+ Type: Text
133
+ Value: {{ $json.prompt }}
134
+ ```
111
135
 
112
- - **Type**: `Image`
113
- - **Image Input Type**: `URL`
114
- - **Image URL**: Full URL of the image (e.g., `https://example.com/image.png`)
136
+ ---
115
137
 
116
- The node will automatically download the image from the URL and upload it to ComfyUI.
138
+ ## Common Workflows
117
139
 
118
- ### Custom Output Binary Key
140
+ ### 1. Generate Image from Text
119
141
 
120
- By default, the first output image/video uses `data` as the binary property name. You can customize this:
142
+ **Setup:**
143
+ ```
144
+ ComfyUI Node:
145
+ ComfyUI URL: http://127.0.0.1:8188
146
+ Workflow JSON: [Text-to-Image workflow]
147
+
148
+ Node Parameters:
149
+ Node ID: 6 (your CLIP Text node)
150
+ Type: Text
151
+ Value: {{ $json.prompt }}
152
+ ```
121
153
 
122
- - **Output Binary Key**: Property name for the first output (e.g., `image`, `output`, `result`)
123
- - Default: `data`
154
+ **Input:**
155
+ ```json
156
+ { "prompt": "a beautiful sunset over mountains" }
157
+ ```
124
158
 
125
- **Example:**
159
+ **Output:**
126
160
  ```json
127
161
  {
128
- "binary": {
129
- "myImage": { "data": "...", "mimeType": "image/png" }
130
- }
162
+ "imageUrls": ["http://127.0.0.1:8188/view?filename=image.png"]
131
163
  }
132
164
  ```
133
165
 
134
- ## 🤖 AI Agent Integration
135
-
136
- Use ComfyUI as a tool in AI Agent workflows.
137
-
138
- ### Quick Setup
139
-
140
- **Step 1: Create AI Agent**
141
- 1. Add **OpenAI Conversational Agent** node
142
- 2. Configure Chat Model (GPT-4/GPT-3.5)
143
- 3. Add Memory (optional but recommended)
144
-
145
- **Step 2: Add ComfyUI Tool**
146
- 1. Click AI Agent node
147
- 2. In **Tools** section, click **+ Add Tool**
148
- 3. Search and select **ComfyUI**
149
- 4. Configure:
150
- - **ComfyUI URL**: `http://127.0.0.1:8188`
151
- - **Workflow JSON**: Your ComfyUI workflow (API format)
152
- - **Node Parameters**: Configure text parameter override
166
+ ---
153
167
 
154
- **Step 3: Start Chatting**
155
- Execute workflow and start conversing!
168
+ ### 2. Process Image with AI Agent
156
169
 
157
- ### Example Conversations
158
-
159
- **Basic Image Generation:**
160
-
161
- **User:**
170
+ **Workflow:**
162
171
  ```
163
- Generate a picture of a cute cat sitting on a fence
172
+ [Chat Interface] → [AI Agent] → [ComfyUI Tool]
164
173
  ```
165
174
 
166
- **AI:**
175
+ **ComfyUI Tool Setup:**
167
176
  ```
168
- I'll generate that for you.
169
- [Executes ComfyUI with prompt: "a cute cat sitting on a fence"]
170
- Done! Here's the image.
177
+ ComfyUI URL: http://127.0.0.1:8188
178
+ Workflow JSON: [Image-to-Image workflow]
179
+ Load Image Node ID: 107
180
+ Image URL: {{ $json.imageUrl }}
171
181
  ```
172
182
 
173
- **With Parameters:**
174
-
175
- **User:**
183
+ **Chat:**
176
184
  ```
177
- Create a cyberpunk city, size:1024x768, steps:30
185
+ You: Transform this image https://example.com/photo.png
186
+ to watercolor style
187
+
188
+ AI: I'll transform that image for you!
189
+ [Downloads image, processes in ComfyUI]
190
+ Done! Here's your watercolor image 🎨
178
191
  ```
179
192
 
180
- **Supported Parameters:**
181
- - `size:WIDTHxHEIGHT` - Image dimensions
182
- - `steps:N` - Sampling steps
183
- - `cfg:N` - CFG strength
184
- - `seed:N` - Random seed
185
- - `negative:TEXT` - Negative prompt
193
+ ---
186
194
 
187
- **Negative Prompts:**
195
+ ### 3. Edit Image with Parameters
188
196
 
189
- **User:**
197
+ **ComfyUI Node Setup:**
190
198
  ```
191
- Draw a beautiful sunset, negative: blurry, low quality
199
+ Node Parameters:
200
+ Node ID: 3
201
+ Parameter Mode: Multiple Parameters
202
+ Parameters JSON:
203
+ {
204
+ "width": 1024,
205
+ "height": 1024,
206
+ "steps": 30
207
+ }
192
208
  ```
193
209
 
194
- ### Configuring Node Parameters for AI Agent
210
+ ---
195
211
 
196
- In the ComfyUI node, configure parameter overrides:
212
+ ### 4. Generate Video
213
+
214
+ Same as image generation, just use a video workflow in ComfyUI!
215
+
216
+ **Output:**
217
+ ```json
218
+ {
219
+ "videoUrls": ["http://127.0.0.1:8188/view?filename=video.mp4"],
220
+ "videoCount": 1
221
+ }
222
+ ```
197
223
 
198
- - **Node ID**: `6` (your CLIP text node)
199
- - **Parameter Mode**: Single Parameter
200
- - **Parameter Name**: `text`
201
- - **Type**: Text
202
- - **Value**: [Leave empty - AI Agent will fill this]
224
+ ---
203
225
 
204
- ### Tool Mode Output Format
226
+ ## How to Get Your Workflow JSON
205
227
 
206
- When used as an AI Agent tool, ComfyUI returns both binary data and URL information:
228
+ 1. Open ComfyUI
229
+ 2. Create or load your workflow
230
+ 3. Click **"Save (API Format)"** (not "Save")
231
+ 4. Copy the JSON
232
+ 5. Paste it in the node's **Workflow JSON** field
207
233
 
208
- **Binary Output:**
209
- - Images are returned as binary data (base64-encoded) in the `binary` object
210
- - First image: `binary.data`
211
- - Additional images: `binary.image_1`, `binary.image_2`, etc.
212
- - Videos: `binary.video_0`, `binary.video_1`, etc.
234
+ ---
213
235
 
214
- **JSON Output (with URLs):**
215
- - `json.images`: Array of image paths
216
- - `json.imageUrls`: Array of complete image URLs (e.g., `http://127.0.0.1:8188/view?filename=...`)
217
- - `json.videos`: Array of video paths
218
- - `json.videoUrls`: Array of complete video URLs
219
- - `json.imageCount`: Number of images generated
220
- - `json.videoCount`: Number of videos generated
236
+ ## Parameters Explained
221
237
 
222
- This ensures compatibility with both workflow mode (binary data) and tool mode (URLs for AI Agent).
238
+ ### ComfyUI Tool Node
223
239
 
224
- ### Best Practices
240
+ | Parameter | What It Does | Example |
241
+ |-----------|--------------|---------|
242
+ | **ComfyUI URL** | Where ComfyUI is running | `http://127.0.0.1:8188` |
243
+ | **Workflow JSON** | Your ComfyUI workflow (API format) | `{...}` |
244
+ | **Timeout** | Max wait time (seconds) | `300` |
245
+ | **Load Image Node ID** | Which LoadImage node to use | `107` |
246
+ | **Image URL** | URL of image to process | `https://...` |
247
+ | **Parameter Overrides** | Change workflow values | See below |
225
248
 
226
- **1. Clear Prompts**
249
+ ### ComfyUI Node
227
250
 
228
- **Good:** "Generate a landscape painting of mountains at sunset"
251
+ | Parameter | What It Does | Example |
252
+ |-----------|--------------|---------|
253
+ | **ComfyUI URL** | Where ComfyUI is running | `http://127.0.0.1:8188` |
254
+ | **Workflow JSON** | Your ComfyUI workflow (API format) | `{...}` |
255
+ | **Timeout** | Max wait time (seconds) | `300` |
256
+ | **Output Binary Key** | Name for output binary | `data` |
257
+ | **Node Parameters** | Configure workflow parameters | See below |
229
258
 
230
- **Bad:** "Make a picture"
259
+ ### Node Parameters
231
260
 
232
- **2. Use Specific Parameters**
261
+ | Field | What It Does |
262
+ |-------|--------------|
263
+ | **Node ID** | The ComfyUI node to change (e.g., "6", "13") |
264
+ | **Parameter Mode** | "Single" for one parameter, "Multiple" for JSON |
265
+ | **Type** | Text, Number, Boolean, or Image |
266
+ | **Value** | The value to set |
233
267
 
234
- **Good:** "Create a portrait, size:512x768, steps:25"
268
+ ---
235
269
 
236
- **Bad:** "Create a high-quality portrait"
270
+ ## Tips & Tricks
237
271
 
238
- **3. Negative Prompts**
272
+ ### ✅ Use URLs with AI Agents
239
273
 
240
- Always use negative prompts for better quality:
274
+ URLs are much smaller than base64 images:
275
+ ```
276
+ Base64: ~100KB - 1MB per image
277
+ URL: ~100 bytes
241
278
 
279
+ Better for LLM context and costs!
242
280
  ```
243
- A beautiful landscape, negative: blurry, distorted, low quality
281
+
282
+ ### ✅ Find Your Node ID
283
+
284
+ Open your workflow JSON and look for:
285
+ ```json
286
+ {
287
+ "6": {
288
+ "inputs": {...},
289
+ "class_type": "KSampler"
290
+ }
291
+ }
244
292
  ```
293
+ The `"6"` is your Node ID!
294
+
295
+ ### ✅ Test First
245
296
 
246
- ### Advanced Usage
297
+ Always test your workflow in ComfyUI before using it in n8n!
247
298
 
248
- **Style Transfer:**
299
+ ### ✅ Use Appropriate Timeouts
249
300
 
250
- **User:**
251
301
  ```
252
- Transform this image to oil painting style
302
+ Simple workflows: 60-120 seconds
303
+ Complex workflows: 300-600 seconds
304
+ Video generation: 600-1800 seconds
253
305
  ```
254
306
 
255
- Setup:
256
- - Upload input image as binary data
257
- - Configure style parameters
307
+ ---
308
+
309
+ ## Troubleshooting
310
+
311
+ ### "Invalid ComfyUI URL"
312
+ Make sure ComfyUI is running and URL is correct: `http://127.0.0.1:8188`
313
+
314
+ ### "Workflow execution timeout"
315
+ Increase the timeout value in node settings
316
+
317
+ ### "Node ID not found"
318
+ Check your workflow JSON - Node IDs are strings like "6", not numbers
319
+
320
+ ### "Failed to download image"
321
+ Make sure the URL is public and accessible (not localhost or file://)
322
+
323
+ ### "AI Agent doesn't call ComfyUI"
324
+ - Make sure ComfyUI Tool is added to Agent's tools
325
+ - Check the workflow JSON is set
326
+ - Try being more specific in your chat
258
327
 
259
- **Multi-Modal Workflows:**
328
+ ---
260
329
 
261
- Combine ComfyUI with other tools:
330
+ ## Examples
262
331
 
263
- **User:**
332
+ ### Example 1: Simple Text to Image
333
+
334
+ ```
335
+ [Manual Trigger] → [ComfyUI] → [Save to File]
336
+
337
+ ComfyUI Node:
338
+ Workflow: Text-to-Image
339
+ Node ID: 6
340
+ Type: Text
341
+ Value: a cute cat in a garden
264
342
  ```
265
- Generate an image of a futuristic city, then write a poem about it
343
+
344
+ ### Example 2: AI Image Generator
345
+
266
346
  ```
347
+ [Chat Trigger] → [AI Agent + ComfyUI Tool] → [Display Image]
267
348
 
268
- AI Agent:
269
- 1. Calls ComfyUI to generate image
270
- 2. Calls Chat Model to write poem
271
- 3. Returns both results
349
+ Agent says: "Generate a picture of..."
350
+ Calls: ComfyUI Tool
351
+ Returns: Image URL
352
+ Shows: Result to user
353
+ ```
272
354
 
273
- ### Troubleshooting
355
+ ### Example 3: Batch Process Images
274
356
 
275
- **AI Agent Doesn't Call ComfyUI**
357
+ ```
358
+ [Spreadsheet] → [Loop] → [ComfyUI] → [Save]
276
359
 
277
- **Check:**
278
- 1. ComfyUI tool added to Tools list?
279
- 2. Workflow JSON configured?
280
- 3. ComfyUI server running?
360
+ For each row:
361
+ - Get image URL
362
+ - Process in ComfyUI
363
+ - Save result
364
+ ```
281
365
 
282
- **Images Don't Match Prompts**
366
+ ---
283
367
 
284
- **Check:**
285
- 1. Correct node ID (e.g., `6` for CLIP text)
286
- 2. Parameter name matches workflow (`text`)
287
- 3. Workflow uses dynamic text input
368
+ ## Need Help?
288
369
 
289
- ## 🔧 Configuration Reference
370
+ - 📖 [n8n Documentation](https://docs.n8n.io)
371
+ - 💬 [n8n Community](https://community.n8n.io)
372
+ - 🐛 [Report Issues](https://github.com/your-repo/issues)
290
373
 
291
- | Field | Description |
292
- |-------|-------------|
293
- | **ComfyUI URL** | URL of your ComfyUI server |
294
- | **Workflow JSON** | ComfyUI workflow in API format |
295
- | **Timeout** | Maximum wait time in seconds (default: 300) |
296
- | **Output Binary Key** | Property name for first output binary data (default: `data`) |
297
- | **Node Parameters** | Override workflow parameters |
374
+ ---
298
375
 
299
- #### Node Parameter Fields
376
+ ## License
300
377
 
301
- | Field | Description |
302
- |-------|-------------|
303
- | **Node ID** | The node ID in your workflow (e.g., `6`, `13`) |
304
- | **Parameter Mode** | Single Parameter or Multiple Parameters (JSON) |
305
- | **Type** | Data type: Text, Number, Boolean, or Image |
306
- | **Image Input Type** | (When Type=Image) Binary or URL |
307
- | **Image URL** | (When Image Input Type=URL) URL to download image from |
308
- | **Parameter Name** | (Single mode) Parameter name to override |
309
- | **Parameters JSON** | (Multiple mode) JSON object with parameters |
310
- | **Value** | Value to set (varies by Type) |
378
+ MIT
311
379
 
312
- ## 💡 Tips
380
+ ---
313
381
 
314
- - **First time**: Start with a simple text-to-image workflow
315
- - **Parameter overrides**: Use Node Parameters instead of modifying workflow JSON
316
- - **Seed control**: Fixed seeds produce reproducible results
317
- - **Optimization**: 20-30 sampling steps are usually sufficient
318
- - **Image input**: Use Image type with Binary source for n8n binary data, or URL source to download from web
319
- - **Output naming**: Customize Output Binary Key to match your workflow's expected property names
382
+ **Happy automating with ComfyUI! 🚀**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-comfyui-all",
3
- "version": "2.4.5",
3
+ "version": "2.4.7",
4
4
  "description": "n8n community nodes for ComfyUI workflow execution with dynamic parameter support",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",