video-generate
by @warm-wm
Generate videos using Seedance models. Invoke when user wants to create videos from text prompts, images, or reference materials.
Environment Variables
Before using this skill, ensure the following environment variables are set:
ARK_API_KEY or MODEL_VIDEO_API_KEY or MODEL_AGENT_API_KEY: API key for the video generation serviceMODEL_VIDEO_API_BASE: API base URL (optional, has default)MODEL_VIDEO_NAME: Model name (optional, has default)Function Signature
async def video_generate(
params: list,
batch_size: int = 10,
max_wait_seconds: int = 1200,
model_name: str = None,
) -> Dict:
Parameters
#### params (list[dict])
A list of video generation requests. Each item is a dict with the following fields:
Required per item:
video_name (str): Name/identifier of the output video fileprompt (str): Text describing the video to generate. Supports Chinese and English.Optional per item - Input Materials:
first_frame (str): URL for the first frame imagelast_frame (str): URL for the last frame imagereference_images (list[str]): 1-4 reference image URLs for style/content guidancereference_videos (list[str]): 0-3 reference video URLs (mp4/mov, 2-15s each, total β€15s)reference_audios (list[str]): 0-3 reference audio URLs (mp3/wav, 2-15s each, total β€15s)Optional per item - Video Output Parameters:
ratio (str): Aspect ratio. Options: "16:9" (default), "9:16", "4:3", "3:4", "1:1", "2:1", "21:9", "adaptive"duration (int): Video length in seconds. Range: 2-12s depending on modelresolution (str): Video resolution. Options: "480p", "720p", "1080p"frames (int): Total frame count. Must be in [29, 289] and follow format 25 + 4ncamera_fixed (bool): Lock camera movement. Default: falseseed (int): Random seed for reproducibility. Range: [-1, 2^32-1]watermark (bool): Whether to add watermark. Default: falsegenerate_audio (bool): Whether to generate audio. Only Seedance 1.5 supports thistools (list[dict]): Tool configuration, e.g., [{"type": "web_search"}]Input Modes
1. Text-to-Video: Only provide prompt, no images/videos 2. First Frame Guidance: Provide first_frame for starting image 3. First + Last Frame Guidance: Provide both for transition video 4. Reference Images: Provide reference_images for style/content guidance 5. Multimodal Reference: Combine reference_images, reference_videos, reference_audios
Return Value
--query-task with the returned task_idclawhub install video-generate