Overview
This node generates videos from text prompts using the Hailuo API. It is designed to convert descriptive text into short video clips, supporting different models with varying capabilities such as standard text-to-video generation, camera movement control, and advanced options including video duration and resolution.
Common scenarios where this node is beneficial include:
- Creating promotional or social media videos from textual descriptions.
- Generating visual content for storytelling or presentations.
- Automating video content creation based on dynamic text inputs.
Practical example: A user inputs a prompt describing a sunset over mountains, selects an advanced model with specific duration and resolution, and receives a generated video clip illustrating that scene.
Properties
| Name | Meaning |
|---|---|
| Text Prompt | The text description used to generate the video (max 2000 characters). |
| Model | The video generation model to use: - Text to Video (t2v-01): Standard model ($0.20) - Text to Video Director (t2v-01-director): Adds camera movement control via prompt tags ($0.20) - Text to Video v2 (t2v-02): Advanced model with options for duration and resolution ($0.25-$0.80) |
| Expand Prompt | Whether to automatically expand the input prompt to add more details. |
| Duration (seconds) | Duration of the generated video; available only for the advanced model (t2v-02). Options: 6 seconds or 10 seconds (10s not available with 1080p resolution). |
| Resolution | Resolution of the generated video; available only for the advanced model (t2v-02). Options: 768p or 1080p (1080p not available with 10s duration). |
| Wait for Completion | Whether the node should wait until the video generation task completes before returning output. |
| Maximum Retries | When waiting for completion, maximum number of status checks before giving up. |
| Retry Interval (ms) | When waiting for completion, time in milliseconds between status checks. |
Output
The node outputs JSON data containing information about the video generation task:
- If Wait for Completion is disabled, the output JSON contains immediate response data from the API, including task identifiers and initial status.
- If Wait for Completion is enabled, the node waits until the video generation finishes and outputs the final task result JSON, which includes the completed video's metadata and URLs.
The node does not output binary video data directly but provides references/URLs to the generated video files.
Dependencies
- Requires an API key credential for authenticating with the Hailuo API service.
- Uses the Hailuo API endpoint
/api/v1/taskto submit video generation tasks. - The node relies on internal helper functions to send requests and poll for task completion.
Troubleshooting
Error: "1080p resolution with 10 seconds duration is not supported."
This error occurs if you select 1080p resolution together with 10 seconds duration for the advanced model. To fix, choose either 768p resolution or reduce duration to 6 seconds.Task never completes when waiting for completion:
Increase the maximum retries or retry interval to allow more time for video generation. Network issues or API rate limits may also cause delays.API authentication errors:
Ensure the API key credential is correctly configured and has necessary permissions.Prompt too long or invalid:
Keep the text prompt under 2000 characters and avoid unsupported formatting.
Links and References
- Hailuo API Documentation (hypothetical link)
- n8n Documentation - Creating Custom Nodes
- General best practices for text-to-video generation and prompt engineering.