PiAPI Kling Text to Video icon

PiAPI Kling Text to Video

Generate videos from text using PiAPI Kling

Overview

This node generates videos from text prompts using the PiAPI Kling video generation service. It allows users to create short videos by providing descriptive text prompts, optionally specifying elements to avoid via negative prompts. The node supports customization of video duration, aspect ratio, generation mode, model version, and adherence strength to the prompt.

Common scenarios include:

  • Creating promotional or social media videos from textual descriptions.
  • Generating visual content for storytelling or presentations.
  • Rapid prototyping of video concepts based on textual ideas.

For example, a user can input a prompt like "A serene mountain landscape at sunrise" and receive a 5-second video in landscape format illustrating that scene.

Properties

Name Meaning
Prompt Text prompt describing what the generated video should depict.
Negative Prompt Text specifying elements or features to exclude from the video.
Duration Length of the generated video; options are 5 seconds or 10 seconds.
Aspect Ratio Shape of the video frame; options include Landscape (16:9), Portrait (9:16), and Square (1:1).
Mode Generation mode affecting video style or quality; options are Standard or Professional.
Version Model version used for generation; multiple versions available with some having higher cost.
CFG Scale A number between 0 and 1 indicating how strictly the video follows the prompt (recommended 0.5).
Wait for Completion Boolean flag to decide whether to wait for the video generation task to complete before returning.

Output

The node outputs JSON data containing details about the video generation task. The main output fields include:

  • task_id: Identifier of the submitted video generation task.
  • Other task-related metadata returned by the API.
  • If "Wait for Completion" is enabled, the output includes the final completed task data once the video is ready.

No binary data is directly output by this node; it returns metadata and status information related to the video generation process.

Dependencies

  • Requires an API key credential for the PiAPI service to authenticate requests.
  • Uses the PiAPI endpoint /api/v1/task to submit video generation tasks.
  • The node relies on internal helper functions to make authenticated HTTP requests and optionally poll for task completion.

Troubleshooting

  • API Errors: If the API returns an error code other than 200, the node throws an error with the message from the API. Ensure the API key is valid and has sufficient permissions.
  • Timeouts or Long Waits: When "Wait for Completion" is enabled, the node waits for the video generation task to finish. Depending on server load and video complexity, this may take time. Consider disabling this option if immediate response is preferred.
  • Invalid Parameters: Providing unsupported values for properties like version or aspect ratio may cause errors. Use only the provided options.
  • Quota Limits: Higher model versions may incur additional costs or usage limits. Monitor your API usage accordingly.

Links and References

Discussion