n8n-nodes-comfyui-all 2.4.3 → 2.4.6

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.
package/README.md CHANGED
@@ -4,15 +4,32 @@
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
+ ## 📖 Table of Contents
8
+
9
+ - [Overview](#-overview)
10
+ - [Installation](#-installation)
11
+ - [Nodes Comparison](#-nodes-comparison)
12
+ - [Quick Start](#-quick-start)
13
+ - [ComfyUI Tool Node](#-comfyui-tool-node)
14
+ - [ComfyUI Node](#-comfyui-node)
15
+ - [Advanced Usage](#-advanced-usage)
16
+ - [Troubleshooting](#-troubleshooting)
17
+ - [Configuration Reference](#-configuration-reference)
18
+
19
+ ## 🎯 Overview
20
+
21
+ This package provides two specialized nodes for integrating ComfyUI with n8n:
22
+
23
+ ### 🌟 Key Features
8
24
 
9
25
  - 🎨 **Universal Workflow Support** - Works with any ComfyUI workflow in API format
10
- - 🔄 **Dynamic Parameters** - Override workflow parameters dynamically
26
+ - 🔄 **Dynamic Parameters** - Override workflow parameters at runtime
11
27
  - 🎬 **Multi-Modal Support** - Supports images and videos for both input and output
12
- - 🤖 **AI Agent Ready** - Can be used as a tool in AI Agent workflows
28
+ - 🤖 **AI Agent Ready** - Optimized nodes for AI Agent and standard workflows
13
29
  - 📊 **Flexible Configuration** - JSON mode or single parameter mode
14
- - 🔗 **URL Image Support** - Load images from URLs or binary data
15
- - 🏷️ **Customizable Output** - Customize binary output property names
30
+ - 🏷️ **Customizable Output** - Flexible output format (URLs or binary data)
31
+
32
+ ---
16
33
 
17
34
  ## 📦 Installation
18
35
 
@@ -32,286 +49,590 @@ npm install n8n-nodes-comfyui-all
32
49
 
33
50
  Or via n8n interface: **Settings** → **Community Nodes** → **Install** → `n8n-nodes-comfyui-all`
34
51
 
35
- > Restart n8n after installation.
52
+ > ⚠️ **Restart n8n after installation**
53
+
54
+ ---
55
+
56
+ ## 🔍 Nodes Comparison
57
+
58
+ ### Quick Reference
59
+
60
+ | Feature | ComfyUI Tool 🤖 | ComfyUI 🔧 |
61
+ |---------|----------------|------------|
62
+ | **Primary Use Case** | AI Agent Workflows | Standard Workflows |
63
+ | **Image Input** | URL only | Binary or URL |
64
+ | **Binary Output** | ❌ No | ✅ Yes |
65
+ | **URL Output** | ✅ Yes | ✅ Yes |
66
+ | **Parameter Overrides** | ✅ Yes | ✅ Yes (Advanced) |
67
+ | **LLM Context** | ✅ Lightweight (URLs only) | ⚠️ Not optimized |
68
+ | **Node Configuration** | Simple | Advanced |
69
+
70
+ ### Which Node Should I Use?
71
+
72
+ ```
73
+ ┌─────────────────────────────────────────────────────────────┐
74
+ │ Your Scenario │
75
+ └─────────────────────────────────────────────────────────────┘
76
+
77
+ ┌───────────────┴───────────────┐
78
+ │ │
79
+ Using AI Agent? Standard Workflow?
80
+ │ │
81
+ ▼ ▼
82
+ ┌───────────────┐ ┌──────────────┐
83
+ │ ComfyUI Tool │ │ ComfyUI │
84
+ └───────────────┘ └──────────────┘
85
+ │ │
86
+ Image Input: URL Image Input:
87
+ • Binary
88
+ • URL
89
+ ```
90
+
91
+ #### Use ComfyUI Tool When:
92
+ - ✅ Building AI Agent workflows
93
+ - ✅ Integrating with chat interfaces
94
+ - ✅ Processing images from URLs
95
+ - ✅ Minimizing LLM token usage
96
+ - ✅ Need simple URL-based configuration
97
+
98
+ #### Use ComfyUI Node When:
99
+ - ✅ Building standard n8n workflows
100
+ - ✅ Processing binary data from previous nodes
101
+ - ✅ Working with file uploads/webhooks
102
+ - ✅ Need advanced parameter configuration
103
+ - ✅ Want binary output for further processing
104
+
105
+ ---
36
106
 
37
107
  ## 🚀 Quick Start
38
108
 
39
- ### 1. Prerequisites
109
+ ### Prerequisites
110
+
111
+ - ✅ ComfyUI server running (default: `http://127.0.0.1:8188`)
112
+ - ✅ n8n instance (version 2.x or higher)
113
+ - ✅ Basic understanding of ComfyUI workflows
40
114
 
41
- - ComfyUI server running (default: `http://127.0.0.1:8188`)
42
- - n8n instance (version 2.x or higher)
115
+ ### 3-Step Setup
43
116
 
44
- ### 2. Create Your Workflow in ComfyUI
117
+ #### 1. Create Your Workflow in ComfyUI
45
118
 
46
- 1. Design your workflow in ComfyUI
47
- 2. Click **Save (API Format)** to export
119
+ ```
120
+ In ComfyUI:
121
+ 1. Design your workflow
122
+ 2. Click "Save (API Format)"
48
123
  3. Copy the generated JSON
124
+ ```
125
+
126
+ #### 2. Add Node to n8n
127
+
128
+ ```
129
+ In n8n:
130
+ 1. Add either "ComfyUI Tool" or "ComfyUI" node
131
+ 2. Paste your Workflow JSON
132
+ 3. Configure ComfyUI URL
133
+ 4. (Optional) Set up parameters
134
+ ```
49
135
 
50
- ### 3. Configure n8n Node
136
+ #### 3. Execute
51
137
 
52
- 1. Add **ComfyUI** node to your n8n workflow
53
- 2. Set **ComfyUI URL**: `http://127.0.0.1:8188`
54
- 3. Paste your **Workflow JSON**
55
- 4. Optionally configure **Node Parameters**
138
+ ```
139
+ Run your workflow and enjoy! 🎉
140
+ ```
56
141
 
57
- ## 📖 Usage
142
+ ---
58
143
 
59
- ### Basic Example: Text to Image
144
+ ## 🤖 ComfyUI Tool Node
60
145
 
61
- **Node Configuration:**
62
- - **ComfyUI URL**: `http://127.0.0.1:8188`
63
- - **Workflow JSON**: Your ComfyUI workflow in API format
146
+ ### Overview
64
147
 
65
- **Optional Node Parameters (Single Parameter Mode):**
66
- - Node ID: `6` (your CLIP text node)
67
- - Parameter Name: `text`
68
- - Type: `Text`
69
- - Value: `a beautiful landscape, high quality`
148
+ **Optimized for AI Agent workflows** - URL-based image input, simple configuration, LLM-friendly.
70
149
 
71
- ### Parameter Configuration Modes
150
+ ### Why URL-Based Input?
72
151
 
73
- #### 1. Multiple Parameters Mode (JSON)
152
+ ```
153
+ ❌ Base64 Image:
154
+ - Size: ~100KB - 1MB per image
155
+ - Tokens: ~130K - 1.3M tokens
156
+ - Result: 💥 Explodes LLM context
157
+
158
+ ✅ Image URL:
159
+ - Size: ~100 bytes
160
+ - Tokens: ~30 tokens
161
+ - Result: ✅ Lightweight and efficient
162
+ ```
163
+
164
+ ### Configuration
74
165
 
75
- Configure multiple parameters at once using JSON:
166
+ #### Basic Setup
167
+
168
+ ```
169
+ ┌─────────────────────────────────────────────────┐
170
+ │ ComfyUI Tool │
171
+ ├─────────────────────────────────────────────────┤
172
+ │ ComfyUI URL: http://127.0.0.1:8188 │
173
+ │ Workflow JSON: [Your ComfyUI workflow] │
174
+ │ Timeout: 300 │
175
+ │ Load Image Node ID: │
176
+ │ (for image workflows) │
177
+ │ Image URL: [URL or {{ $json.imageUrl }}] │
178
+ └─────────────────────────────────────────────────┘
179
+ ```
180
+
181
+ #### Parameters
182
+
183
+ | Parameter | Description | Example |
184
+ |-----------|-------------|---------|
185
+ | **ComfyUI URL** | ComfyUI server address | `http://127.0.0.1:8188` |
186
+ | **Workflow JSON** | ComfyUI workflow in API format | `{ "3": {...} }` |
187
+ | **Timeout** | Max wait time (seconds) | `300` (5 min) |
188
+ | **Load Image Node ID** | LoadImage node ID for image workflows | `107` |
189
+ | **Image URL** | URL of image to process | `https://...` |
190
+ | **Parameter Overrides** | Override workflow parameters | See below |
191
+
192
+ ### Output Format
76
193
 
77
194
  ```json
78
195
  {
79
- "width": 1024,
80
- "height": 1024,
81
- "batch_size": 1,
82
- "seed": 12345
196
+ "success": true,
197
+ "imageUrls": [
198
+ "http://127.0.0.1:8188/view?filename=ComfyUI_00001.png"
199
+ ],
200
+ "videoUrls": [],
201
+ "imageCount": 1,
202
+ "videoCount": 0
83
203
  }
84
204
  ```
85
205
 
86
- #### 2. Single Parameter Mode
206
+ ### AI Agent Integration Example
207
+
208
+ ```
209
+ Workflow:
210
+ [Chat Input] → [AI Agent] → [ComfyUI Tool]
211
+
212
+ Passes imageUrl
213
+
214
+ Downloads image
215
+
216
+ Processes in ComfyUI
217
+
218
+ Returns result URLs
219
+ ```
220
+
221
+ **Chat Example:**
87
222
 
88
- Configure one parameter at a time with type validation:
223
+ ```
224
+ User: Transform this image (https://example.com/photo.png)
225
+ to oil painting style
89
226
 
90
- - **Parameter Name**: `steps`
91
- - **Type**: `Number`
92
- - **Value**: `25`
227
+ AI Agent:
228
+ 1. Extracts URL from message
229
+ 2. Calls ComfyUI Tool
230
+ 3. ComfyUI Tool downloads image
231
+ 4. Processes in ComfyUI
232
+ 5. Returns result URLs
233
+ 6. AI Agent shows result to user
234
+ ```
93
235
 
94
- ### Image Input Options
236
+ ---
95
237
 
96
- The node supports two methods for uploading images to ComfyUI:
238
+ ## 🔧 ComfyUI Node
97
239
 
98
- #### Method 1: Binary Data
240
+ ### Overview
99
241
 
100
- Upload images from n8n binary data:
242
+ **Full-featured node for standard workflows** - Supports binary and URL inputs with advanced configuration.
101
243
 
102
- - **Type**: `Image`
103
- - **Image Input Type**: `Binary`
104
- - **Value**: Binary property name (e.g., `data`, `image`, `file`)
244
+ ### Configuration
105
245
 
106
- #### Method 2: URL
246
+ #### Basic Setup
107
247
 
108
- Download and upload images from a URL:
248
+ ```
249
+ ┌─────────────────────────────────────────────────┐
250
+ │ ComfyUI │
251
+ ├─────────────────────────────────────────────────┤
252
+ │ ComfyUI URL: http://127.0.0.1:8188 │
253
+ │ Workflow JSON: [Your ComfyUI workflow] │
254
+ │ Timeout: 300 │
255
+ │ Output Binary Key: data │
256
+ ├─────────────────────────────────────────────────┤
257
+ │ Node Parameters: │
258
+ │ [Multiple parameter configurations] │
259
+ └─────────────────────────────────────────────────┘
260
+ ```
261
+
262
+ #### Parameters
263
+
264
+ | Parameter | Description | Example |
265
+ |-----------|-------------|---------|
266
+ | **ComfyUI URL** | ComfyUI server address | `http://127.0.0.1:8188` |
267
+ | **Workflow JSON** | ComfyUI workflow in API format | `{ "3": {...} }` |
268
+ | **Timeout** | Max wait time (seconds) | `300` (5 min) |
269
+ | **Output Binary Key** | First output binary property name | `data`, `image` |
270
+ | **Node Parameters** | Override workflow parameters | See below |
271
+
272
+ ### Image Input Methods
273
+
274
+ #### Method 1: Binary Data
109
275
 
110
- - **Type**: `Image`
111
- - **Image Input Type**: `URL`
112
- - **Image URL**: Full URL of the image (e.g., `https://example.com/image.png`)
276
+ ```
277
+ Node Parameters:
278
+ Node ID: 107
279
+ Parameter Mode: Single Parameter
280
+ Parameter Name: image
281
+ Type: Image
282
+ Image Input Type: Binary ← Binary mode
283
+ Value: data
284
+ ```
113
285
 
114
- The node will automatically download the image from the URL and upload it to ComfyUI.
286
+ **Use when:** Previous node outputs binary data (HTTP Request, Webhook, etc.)
115
287
 
116
- ### Custom Output Binary Key
288
+ #### Method 2: URL
117
289
 
118
- By default, the first output image/video uses `data` as the binary property name. You can customize this:
290
+ ```
291
+ Node Parameters:
292
+ Node ID: 107
293
+ Parameter Mode: Single Parameter
294
+ Parameter Name: image
295
+ Type: Image
296
+ Image Input Type: URL ← URL mode
297
+ Image URL: https://example.com/image.png
298
+ ```
299
+
300
+ **Use when:** Downloading from web or using URL
119
301
 
120
- - **Output Binary Key**: Property name for the first output (e.g., `image`, `output`, `result`)
121
- - Default: `data`
302
+ ### Output Format
122
303
 
123
- **Example:**
124
304
  ```json
125
305
  {
306
+ "json": {
307
+ "success": true,
308
+ "imageCount": 1,
309
+ "imageUrls": ["http://..."],
310
+ "data": { ... }
311
+ },
126
312
  "binary": {
127
- "myImage": { "data": "...", "mimeType": "image/png" }
313
+ "data": {
314
+ "data": "base64...",
315
+ "mimeType": "image/png",
316
+ "fileName": "ComfyUI_00001.png"
317
+ }
128
318
  }
129
319
  }
130
320
  ```
131
321
 
132
- ## 🤖 AI Agent Integration
322
+ ---
133
323
 
134
- Use ComfyUI as a tool in AI Agent workflows.
324
+ ## 📚 Advanced Usage
135
325
 
136
- ### Quick Setup
326
+ ### 1. Text-to-Image with Dynamic Prompts
137
327
 
138
- **Step 1: Create AI Agent**
139
- 1. Add **OpenAI Conversational Agent** node
140
- 2. Configure Chat Model (GPT-4/GPT-3.5)
141
- 3. Add Memory (optional but recommended)
328
+ **ComfyUI Node Setup:**
142
329
 
143
- **Step 2: Add ComfyUI Tool**
144
- 1. Click AI Agent node
145
- 2. In **Tools** section, click **+ Add Tool**
146
- 3. Search and select **ComfyUI**
147
- 4. Configure:
148
- - **ComfyUI URL**: `http://127.0.0.1:8188`
149
- - **Workflow JSON**: Your ComfyUI workflow (API format)
150
- - **Node Parameters**: Configure text parameter override
330
+ ```
331
+ Node Parameters:
332
+ Node ID: 6 (CLIP Text Encode)
333
+ Parameter Mode: Single Parameter
334
+ Parameter Name: text
335
+ Type: Text
336
+ Value: {{ $json.prompt }}
337
+ ```
151
338
 
152
- **Step 3: Start Chatting**
153
- Execute workflow and start conversing!
339
+ **Input:**
340
+ ```json
341
+ {
342
+ "prompt": "a beautiful landscape at sunset"
343
+ }
344
+ ```
154
345
 
155
- ### Example Conversations
346
+ ### 2. Image-to-Image Processing
156
347
 
157
- **Basic Image Generation:**
348
+ **ComfyUI Tool Setup:**
158
349
 
159
- **User:**
160
350
  ```
161
- Generate a picture of a cute cat sitting on a fence
351
+ Load Image Node ID: 107
352
+ Image URL: {{ $json.imageUrl }}
353
+ Parameter Overrides:
354
+ - Node ID: 6
355
+ Param Path: inputs.text
356
+ Value: {{ $json.prompt }}
162
357
  ```
163
358
 
164
- **AI:**
165
- ```
166
- I'll generate that for you.
167
- [Executes ComfyUI with prompt: "a cute cat sitting on a fence"]
168
- Done! Here's the image.
359
+ **Input:**
360
+ ```json
361
+ {
362
+ "imageUrl": "https://example.com/input.png",
363
+ "prompt": "Transform to oil painting style"
364
+ }
169
365
  ```
170
366
 
171
- **With Parameters:**
367
+ ### 3. Multiple Parameters Override
368
+
369
+ **ComfyUI Node Setup:**
172
370
 
173
- **User:**
174
371
  ```
175
- Create a cyberpunk city, size:1024x768, steps:30
372
+ Node Parameters:
373
+ Node ID: 3
374
+ Parameter Mode: Multiple Parameters
375
+ Parameters JSON:
376
+ {
377
+ "width": 1024,
378
+ "height": 1024,
379
+ "steps": 30,
380
+ "cfg": 7.5,
381
+ "seed": 123456
382
+ }
176
383
  ```
177
384
 
178
- **Supported Parameters:**
179
- - `size:WIDTHxHEIGHT` - Image dimensions
180
- - `steps:N` - Sampling steps
181
- - `cfg:N` - CFG strength
182
- - `seed:N` - Random seed
183
- - `negative:TEXT` - Negative prompt
385
+ ### 4. Video Generation
184
386
 
185
- **Negative Prompts:**
387
+ **Setup:** Similar to image generation, just use a video workflow in ComfyUI.
186
388
 
187
- **User:**
188
- ```
189
- Draw a beautiful sunset, negative: blurry, low quality
389
+ **Output:**
390
+ ```json
391
+ {
392
+ "videoUrls": ["http://127.0.0.1:8188/view?filename=video.mp4"],
393
+ "videoCount": 1
394
+ }
190
395
  ```
191
396
 
192
- ### Configuring Node Parameters for AI Agent
397
+ ---
193
398
 
194
- In the ComfyUI node, configure parameter overrides:
399
+ ## 🤖 AI Agent Workflows
195
400
 
196
- - **Node ID**: `6` (your CLIP text node)
197
- - **Parameter Mode**: Single Parameter
198
- - **Parameter Name**: `text`
199
- - **Type**: Text
200
- - **Value**: [Leave empty - AI Agent will fill this]
401
+ ### Example 1: Image Generation Chat
201
402
 
202
- ### Tool Mode Output Format
403
+ ```
404
+ Workflow:
405
+ [Chat Interface] → [AI Agent] → [ComfyUI Tool]
406
+
407
+ Configuration:
408
+ - Model: GPT-4
409
+ - Tools: ComfyUI Tool
410
+ - Workflow: Text-to-Image
411
+
412
+ Conversation:
413
+ User: "Generate a picture of a cute cat"
414
+ AI: [Calls ComfyUI Tool]
415
+ AI: "Here's your image! 😊"
416
+ ```
203
417
 
204
- When used as an AI Agent tool, ComfyUI returns both binary data and URL information:
418
+ ### Example 2: Image Editing
205
419
 
206
- **Binary Output:**
207
- - Images are returned as binary data (base64-encoded) in the `binary` object
208
- - First image: `binary.data`
209
- - Additional images: `binary.image_1`, `binary.image_2`, etc.
210
- - Videos: `binary.video_0`, `binary.video_1`, etc.
420
+ ```
421
+ Workflow:
422
+ [Chat Interface] [AI Agent] → [ComfyUI Tool]
423
+
424
+ Configuration:
425
+ - ComfyUI Tool:
426
+ - Workflow: Image-to-Image
427
+ - Load Image Node ID: 107
428
+ - Image URL: {{ $json.imageUrl }}
429
+
430
+ Conversation:
431
+ User: "Transform this image (URL) to watercolor style"
432
+ AI: [Extracts URL, downloads image, processes in ComfyUI]
433
+ AI: "Done! Here's the watercolor version 🎨"
434
+ ```
211
435
 
212
- **JSON Output (with URLs):**
213
- - `json.images`: Array of image paths
214
- - `json.imageUrls`: Array of complete image URLs (e.g., `http://127.0.0.1:8188/view?filename=...`)
215
- - `json.videos`: Array of video paths
216
- - `json.videoUrls`: Array of complete video URLs
217
- - `json.imageCount`: Number of images generated
218
- - `json.videoCount`: Number of videos generated
436
+ ### Example 3: Multi-Modal Workflow
219
437
 
220
- This ensures compatibility with both workflow mode (binary data) and tool mode (URLs for AI Agent).
438
+ ```
439
+ Workflow:
440
+ [Chat Input] → [AI Agent] → [ComfyUI Tool] → [Chat Model]
441
+ ↓ ↓
442
+ Generate Image Write Poem
443
+ ↓ ↓
444
+ Return Combined Result
445
+
446
+ Conversation:
447
+ User: "Create an image of a futuristic city
448
+ and write a poem about it"
449
+
450
+ AI: [1. Generates image via ComfyUI Tool]
451
+ [2. Writes poem about the image]
452
+ [3. Returns both to user]
453
+ ```
221
454
 
222
- ### Best Practices
455
+ ---
223
456
 
224
- **1. Clear Prompts**
457
+ ## ⚙️ Best Practices
225
458
 
226
- **Good:** "Generate a landscape painting of mountains at sunset"
459
+ ### 1. URL Selection
227
460
 
228
- **Bad:** "Make a picture"
461
+ **Good:**
462
+ ```
463
+ https://cdn.example.com/images/photo.png
464
+ https://storage.googleapis.com/bucket/image.jpg
465
+ https://s3.amazonaws.com/bucket/photo.png
466
+ ```
229
467
 
230
- **2. Use Specific Parameters**
468
+ **Avoid:**
469
+ ```
470
+ file:///local/path/image.png ← Not accessible
471
+ http://localhost:8080/image.png ← Private network
472
+ ```
231
473
 
232
- **Good:** "Create a portrait, size:512x768, steps:25"
474
+ ### 2. Parameter Naming
233
475
 
234
- **Bad:** "Create a high-quality portrait"
476
+ **Use Clear Names:**
477
+ ```
478
+ Node ID: 6
479
+ Parameter Name: text ← Matches ComfyUI node input
480
+ ```
235
481
 
236
- **3. Negative Prompts**
482
+ **Vague Names:**
483
+ ```
484
+ Node ID: node_6
485
+ Parameter Name: param1 ← Unclear what it does
486
+ ```
237
487
 
238
- Always use negative prompts for better quality:
488
+ ### 3. Timeout Settings
239
489
 
240
490
  ```
241
- A beautiful landscape, negative: blurry, distorted, low quality
491
+ Simple workflows: 60-120 seconds
492
+ Complex workflows: 300-600 seconds
493
+ Video generation: 600-1800 seconds
242
494
  ```
243
495
 
244
- ### Advanced Usage
496
+ ### 4. Error Handling
245
497
 
246
- **Style Transfer:**
498
+ ```javascript
499
+ // Always validate inputs
500
+ if (!workflowJson) {
501
+ throw new Error('Workflow JSON is required');
502
+ }
247
503
 
248
- **User:**
249
- ```
250
- Transform this image to oil painting style
504
+ // Check ComfyUI server availability
505
+ // Use appropriate timeouts
506
+ // Handle network errors gracefully
251
507
  ```
252
508
 
253
- Setup:
254
- - Upload input image as binary data
255
- - Configure style parameters
509
+ ---
256
510
 
257
- **Multi-Modal Workflows:**
511
+ ## 🔧 Troubleshooting
258
512
 
259
- Combine ComfyUI with other tools:
513
+ ### Common Issues
260
514
 
261
- **User:**
262
- ```
263
- Generate an image of a futuristic city, then write a poem about it
264
- ```
515
+ #### ❌ "Invalid ComfyUI URL"
265
516
 
266
- AI Agent:
267
- 1. Calls ComfyUI to generate image
268
- 2. Calls Chat Model to write poem
269
- 3. Returns both results
517
+ **Solution:**
518
+ - Check ComfyUI is running
519
+ - Verify URL format: `http://127.0.0.1:8188`
520
+ - Try accessing ComfyUI in browser first
521
+
522
+ #### ❌ "Workflow execution timeout"
523
+
524
+ **Solutions:**
525
+ - Increase timeout value
526
+ - Check workflow complexity
527
+ - Verify ComfyUI server performance
528
+ - Check ComfyUI logs for errors
529
+
530
+ #### ❌ "Node ID not found in workflow"
270
531
 
271
- ### Troubleshooting
532
+ **Solutions:**
533
+ - Open workflow JSON
534
+ - Find the correct node ID
535
+ - Note: IDs are strings like "6", "13", not numbers
272
536
 
273
- **AI Agent Doesn't Call ComfyUI**
537
+ #### "Failed to download image from URL"
274
538
 
275
- **Check:**
276
- 1. ComfyUI tool added to Tools list?
277
- 2. Workflow JSON configured?
278
- 3. ComfyUI server running?
539
+ **Solutions:**
540
+ - Verify URL is publicly accessible
541
+ - Check URL doesn't require authentication
542
+ - Ensure URL returns image (not HTML)
543
+ - Test URL in browser first
279
544
 
280
- **Images Don't Match Prompts**
545
+ #### ❌ "AI Agent doesn't call ComfyUI"
281
546
 
282
- **Check:**
283
- 1. Correct node ID (e.g., `6` for CLIP text)
284
- 2. Parameter name matches workflow (`text`)
285
- 3. Workflow uses dynamic text input
547
+ **Solutions:**
548
+ - Ensure ComfyUI Tool is added to Agent's tools
549
+ - Check tool description is clear
550
+ - Verify workflow JSON is configured
551
+ - Check Agent logs
286
552
 
287
- ## 🔧 Configuration Reference
553
+ ---
288
554
 
289
- | Field | Description |
290
- |-------|-------------|
291
- | **ComfyUI URL** | URL of your ComfyUI server |
292
- | **Workflow JSON** | ComfyUI workflow in API format |
293
- | **Timeout** | Maximum wait time in seconds (default: 300) |
294
- | **Output Binary Key** | Property name for first output binary data (default: `data`) |
295
- | **Node Parameters** | Override workflow parameters |
555
+ ## 📖 Configuration Reference
296
556
 
297
- #### Node Parameter Fields
557
+ ### ComfyUI Tool Node
298
558
 
299
- | Field | Description |
300
- |-------|-------------|
301
- | **Node ID** | The node ID in your workflow (e.g., `6`, `13`) |
302
- | **Parameter Mode** | Single Parameter or Multiple Parameters (JSON) |
303
- | **Type** | Data type: Text, Number, Boolean, or Image |
304
- | **Image Input Type** | (When Type=Image) Binary or URL |
305
- | **Image URL** | (When Image Input Type=URL) URL to download image from |
306
- | **Parameter Name** | (Single mode) Parameter name to override |
307
- | **Parameters JSON** | (Multiple mode) JSON object with parameters |
308
- | **Value** | Value to set (varies by Type) |
559
+ | Field | Type | Required | Default | Description |
560
+ |-------|------|----------|---------|-------------|
561
+ | **ComfyUI URL** | String | | `http://127.0.0.1:8188` | ComfyUI server address |
562
+ | **Workflow JSON** | String | | - | ComfyUI workflow in API format |
563
+ | **Timeout** | Number | | `300` | Max wait time (seconds) |
564
+ | **Load Image Node ID** | String | | - | LoadImage node ID for image workflows |
565
+ | **Image URL** | String | | - | URL of image to process |
566
+ | **Parameter Overrides** | Collection | | - | Override workflow parameters |
567
+
568
+ ### ComfyUI Node
569
+
570
+ | Field | Type | Required | Default | Description |
571
+ |-------|------|----------|---------|-------------|
572
+ | **ComfyUI URL** | String | ✅ | `http://127.0.0.1:8188` | ComfyUI server address |
573
+ | **Workflow JSON** | String | ✅ | - | ComfyUI workflow in API format |
574
+ | **Timeout** | Number | ❌ | `300` | Max wait time (seconds) |
575
+ | **Output Binary Key** | String | ❌ | `data` | First output binary property name |
576
+ | **Node Parameters** | Collection | ❌ | - | Override workflow parameters |
577
+
578
+ ### Node Parameter Fields
579
+
580
+ | Field | Description | Options |
581
+ |-------|-------------|---------|
582
+ | **Node ID** | Node ID from workflow JSON | e.g., `6`, `13`, `107` |
583
+ | **Parameter Mode** | How to configure parameters | Single / Multiple |
584
+ | **Type** | Parameter data type | Text / Number / Boolean / Image |
585
+ | **Image Input Type** | How to input image (when Type=Image) | Binary / URL |
586
+ | **Parameter Name** | Parameter to override (single mode) | e.g., `text`, `seed`, `steps` |
587
+ | **Parameters JSON** | JSON object with parameters (multiple mode) | `{"width": 1024}` |
588
+ | **Value** | Value to set | Text / Number / Boolean |
589
+
590
+ ---
309
591
 
310
592
  ## 💡 Tips
311
593
 
312
- - **First time**: Start with a simple text-to-image workflow
313
- - **Parameter overrides**: Use Node Parameters instead of modifying workflow JSON
314
- - **Seed control**: Fixed seeds produce reproducible results
315
- - **Optimization**: 20-30 sampling steps are usually sufficient
316
- - **Image input**: Use Image type with Binary source for n8n binary data, or URL source to download from web
317
- - **Output naming**: Customize Output Binary Key to match your workflow's expected property names
594
+ ### 🎯 Performance
595
+
596
+ - Start with simple workflows to test setup
597
+ - Use appropriate timeout values
598
+ - Monitor ComfyUI resource usage
599
+ - Use specific prompts for better results
600
+
601
+ ### 🔒 Security
602
+
603
+ - Don't expose ComfyUI server publicly
604
+ - Use secure URLs for images
605
+ - Validate user inputs in production
606
+ - Keep workflow JSON private if needed
607
+
608
+ ### 📝 Workflow Design
609
+
610
+ - Document your ComfyUI workflows
611
+ - Use consistent node IDs
612
+ - Test workflows in ComfyUI first
613
+ - Keep workflows simple and modular
614
+
615
+ ---
616
+
617
+ ## 🤝 Contributing
618
+
619
+ Contributions are welcome! Please feel free to submit issues or pull requests.
620
+
621
+ ## 📄 License
622
+
623
+ MIT License - see LICENSE file for details
624
+
625
+ ## 🙏 Acknowledgments
626
+
627
+ - [ComfyUI](https://github.com/comfyanonymous/ComfyUI) - Powerful UI for Stable Diffusion
628
+ - [n8n](https://n8n.io) - Workflow automation tool
629
+
630
+ ---
631
+
632
+ **Need Help?**
633
+
634
+ - 📖 Check the [Documentation](https://docs.n8n.io)
635
+ - 💬 Join the [Community](https://community.n8n.io)
636
+ - 🐛 Report [Issues](https://github.com/your-repo/issues)
637
+
638
+ **Happy Automating! 🚀**