Overview
This node enables image-to-image conversion using a ComfyUI workflow. It takes an input image, uploads it to the ComfyUI API, runs a user-defined workflow on it, and returns the processed output image(s). This is useful for automating image transformations such as style transfer, enhancement, or other AI-driven modifications defined by the ComfyUI workflow.
Typical use cases include:
- Applying custom AI workflows to images in automation pipelines.
- Batch processing images with complex workflows without manual intervention.
- Integrating ComfyUI-based image generation into larger n8n workflows.
Properties
| Name | Meaning |
|---|---|
| Workflow JSON | The ComfyUI workflow definition in JSON format that specifies how the image will be processed. |
| Input Type | The type of input image provided. Options: URL (image URL), Base64 (base64 encoded image), Binary (binary data from previous node). |
| Input Image | The input image data as a URL or base64 string. Required if Input Type is url or base64. |
| Binary Property | The name of the binary property containing the image data when Input Type is binary. |
| Timeout | Maximum time in minutes to wait for the image generation process before timing out. |
Output
The node outputs an array of items where each item contains:
json:mimeType: MIME type of the generated image (e.g.,image/png,image/jpeg).fileName: Filename of the generated image.data: Base64-encoded string of the image content.status: Status object returned from ComfyUI about the generation process.
binary:data: Binary representation of the generated image including metadata:fileName: Filename of the image.data: Base64-encoded image data.fileType: Always"image".fileSize: Size of the image file in kilobytes (e.g.,"123.4 kB").fileExtension: File extension (e.g.,png,jpg).mimeType: MIME type of the image.
If multiple images are generated, only the first output image is returned.
Dependencies
- Requires access to a ComfyUI API endpoint with an API URL and an API key credential.
- The node expects the ComfyUI API to support endpoints for system stats, image upload, prompt submission, and history retrieval.
- The node uses HTTP requests to communicate with the ComfyUI API.
- Requires n8n helper functions for HTTP requests and binary data handling.
Troubleshooting
- Invalid workflow JSON: If the workflow JSON is malformed or not a valid object, the node throws an error. Ensure the JSON syntax is correct and the structure matches ComfyUI expectations.
- No LoadImage node found: The workflow must contain a
LoadImagenode with an image input. Without this, the node cannot inject the uploaded image. - Binary property not found or invalid: When using binary input, if the specified binary property does not exist or is not an image, the node tries to find an alternative image property. If none is found, it errors out.
- Image generation timeout: If the ComfyUI API does not complete image generation within the specified timeout, the node throws a timeout error.
- API connection issues: Errors connecting to the ComfyUI API or missing/invalid API key will cause failures. Verify API URL and credentials.
- Image file not found: If the generated image file is missing on the server, an error is thrown.
- Unsupported media type: Only image MIME types are supported for input binary data.
Links and References
- ComfyUI GitHub Repository — For understanding workflow structure and capabilities.
- n8n Documentation — For general information on creating and using custom nodes.
- FormData npm package — Used internally for multipart form uploads.