Overview
This node converts a ComfyUI workflow JSON into media files such as images, GIFs, or videos by sending the workflow to a ComfyUI API for processing. It waits for the video generation or media rendering to complete, then downloads and outputs the resulting media files.
Common scenarios where this node is useful include:
- Automating the generation of images or videos from a predefined ComfyUI workflow.
- Integrating ComfyUI-based media creation into larger n8n workflows for content pipelines.
- Batch processing or triggering media generation remotely via API calls.
For example, you can provide a ComfyUI workflow JSON that defines a video generation process, set a timeout, and receive the generated video and image outputs directly in your workflow for further use or storage.
Properties
| Name | Meaning |
|---|---|
| Workflow JSON | The ComfyUI workflow in JSON format. This defines the media generation steps to execute. |
| Timeout | Maximum time in minutes to wait for the video generation to complete (default: 30). |
Output
The node outputs an array of items, each containing:
jsonobject with metadata:mimeType: MIME type of the media file (e.g.,video/mp4,image/png).fileName: The filename of the media output.status: Status string returned from the ComfyUI API after processing.fileSize: Size of the downloaded file in kilobytes.
binarydata under the keydatacontaining the raw media file content (image, video, or gif).
The node supports multiple media types including .mp4 videos, .gif animations, .webp images, and common image formats like .png, .jpg, and .jpeg.
Dependencies
- Requires access to a ComfyUI API endpoint with an API key credential.
- The node expects the ComfyUI API URL and API key to be configured in the node credentials.
- Uses internal helper methods for HTTP requests and binary data preparation.
- No additional external services beyond the ComfyUI API are required.
Troubleshooting
- Timeouts: If media generation takes longer than the specified timeout, the node will fail. Increase the "Timeout" property if needed.
- No prompt ID received: Indicates failure to initiate the workflow on the ComfyUI API. Check API URL, credentials, and workflow JSON validity.
- Video generation failed: The ComfyUI API returned an error status. Inspect the workflow JSON and API logs for issues.
- No media outputs found: The API response did not contain any downloadable media files. Verify the workflow produces outputs.
- File not found errors: Downloading media files failed with 404. This may indicate temporary unavailability or incorrect file references.
- Invalid workflow JSON: Parsing errors when reading the workflow JSON will cause failures. Ensure valid JSON input.
Links and References
- ComfyUI GitHub Repository — For understanding workflow JSON structure and capabilities.
- n8n Documentation — General guidance on creating and using custom nodes.
- HTTP Request Node — For reference on making API calls within n8n.