Generate videos from first and last frame images. Input two images (first frame and last frame) to create 5-second dynamic videos. Supports 720p/1080p, multi...
Generate 5-second dynamic videos from two keyframe images (first frame and last frame). The AI model intelligently interpolates motion between the two frames, creating smooth transitions with optional camera movements and text-guided motion control.
API: tm_tail2video_b
Key Features:
python scripts/generate_auth_token.py YOUR_APP_KEY YOUR_APP_SECRET
from scripts.tomoviee_firstlast2video_client import TomovieeFirstLast2VideoClient
client = TomovieeFirstLast2VideoClient("app_key", "app_secret")
task_id = client.firstlast_to_video(
prompt="角色从头部开始变形,伴随大量白色和灰色烟雾,旋转的沙子,逐渐巧妙变形为老虎",
image="https://example.com/first-frame.jpg",
image_tail="https://example.com/last-frame.jpg",
resolution="1080p",
aspect_ratio="16:9"
)
result = client.poll_until_complete(task_id)
import json
video_url = json.loads(result['result'])['video_path'][0]
prompt (required): Text description (subject + motion + background motion)image (required): First frame image URL (<200M, 720P+ recommended, JPG/JPEG/PNG/WEBP)image_tail (required): Last frame image URL (<200M, 720P+ recommended, JPG/JPEG/PNG/WEBP)resolution: 720p or 1080p (default: 720p)duration: Duration in seconds (only 5 supported)aspect_ratio: 16:9, 9:16, 4:3, 3:4, 1:1, original (default: 16:9)camera_move_index: Camera movement type (1-46, optional)task_id from API callpoll_until_complete(task_id)Status codes:
Generation time: 1-5 minutes per 5-second video
All video APIs support 46 camera movement types via camera_move_index:
See references/camera_movements.md for all 46 types.
提示词 = 主体+运动,背景+运动
Example 1:
Example 2:
See references/prompt_guide.md for detailed guidance.
tomoviee_firstlast2video_client.py - First-Last Frame to Video API clientgenerate_auth_token.py - Auth token generatorvideo_apis.md - Detailed video API documentationcamera_movements.md - All 46 camera movement typesprompt_guide.md - Prompt engineering guide and best practicesZIP package — ready to use