Overview
This node generates videos from text prompts using the PiAPI Hunyuan service. It supports two types of video generation tasks: a higher-quality standard mode with more processing steps, and a faster mode with fewer steps. Users provide a descriptive text prompt and select an aspect ratio for the output video. Optionally, the node can wait for the video generation task to complete before returning, allowing synchronous workflows.
Typical use cases include creating short videos or animations based on textual descriptions for marketing, social media content, storytelling, or creative projects where automated video generation is desired.
Properties
| Name | Meaning |
|---|---|
| Task Type | Type of video generation task: - Standard Text-to-Video: Higher quality with 20 steps, 85 FPS, 480x848/640x640 - Fast Text-to-Video: Faster generation with 6 steps, 85 FPS, 480x848/640x640 |
| Prompt | Text prompt describing the content of the video to generate. |
| Aspect Ratio | Aspect ratio of the generated video: - 16:9 (Landscape, 480x848) - 9:16 (Portrait, 848x480) - 1:1 (Square, 640x640) |
| Wait for Completion | Whether to wait for the video generation task to finish before returning results (boolean). |
Output
The node outputs JSON data containing information about the video generation task:
- When not waiting for completion, the output includes the initial task details such as a unique task ID.
- When waiting for completion, the output contains the final task result including generated video metadata or URLs.
If an error occurs during the API request, the output JSON will contain an error field with the error message if "Continue On Fail" is enabled.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the PiAPI Hunyuan service.
- The node makes HTTP POST requests to the
/api/v1/taskendpoint of the PiAPI. - No additional environment variables are required beyond the API credential.
Troubleshooting
- Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Providing an empty or invalid prompt may result in API errors.
- Network connectivity problems can prevent successful API calls.
- Error messages:
API Error: <message>indicates the PiAPI returned an error response; check the prompt and parameters.- Errors thrown during execution will halt the node unless "Continue On Fail" is enabled, in which case errors are returned in the output JSON.
- To resolve errors, verify API credentials, ensure valid input parameters, and confirm network access to the PiAPI endpoint.
Links and References
- PiAPI Documentation (hypothetical link for reference)
- n8n documentation on Creating Custom Nodes