veo-reference-video
使用fal.ai Veo 3.1通过参考图像生成具有一致主题外观的视频。当用户想要创建包含特定人物、对象或角色的视频,这些角色应在整个视频中保持一致外观时使用。支持多个参考图像以获得更好的主题一致性。
📖 中文导读:使用fal.ai Veo 3.1通过参考图像生成具有一致主题外观的视频。当用户想要创建包含特定人物、对象或角色的视频,这些角色应在整个视频中保持一致外观时使用。支持多个参考图像以获得更好的主题一致性。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: veo-reference-video description: Generate video with consistent subject appearance using reference images via fal.ai Veo 3.1. Use when the user wants to create a video featuring specific people, objects, or characters that should look consistent throughout. Supports multiple reference images for better subject consistency. allowed-tools: Bash, Read, Write
Veo 3.1 Reference-to-Video
Generate videos with consistent subject appearance using reference images via Google DeepMind's Veo 3.1 model on fal.ai.
Prerequisites
FAL_KEYenvironment variable must be set (typically in~/.zshrc)
API Endpoint
POST https://fal.run/fal-ai/veo3.1/reference-to-video
Parameters
Required
prompt(string): Text description of the video scene and actionimage_urls(array of strings): URLs of reference images for consistent subject appearance
Optional
| Parameter | Type | Default | Options |
|---|---|---|---|
duration |
string | "8s" | "8s" |
resolution |
string | "720p" | "720p", "1080p" |
generate_audio |
boolean | true | Enable/disable audio generation |
Usage
cURL
curl --request POST \
--url https://fal.run/fal-ai/veo3.1/reference-to-video \
--header "Authorization: Key $FAL_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "The character walks through a sunny park, looking around curiously",
"image_urls": [
"https://example.com/character-front.jpg",
"https://example.com/character-side.jpg"
],
"duration": "8s",
"resolution": "1080p",
"generate_audio": true
}'
Python
import fal_client
result = fal_client.subscribe(
"fal-ai/veo3.1/reference-to-video",
arguments={
"prompt": "The character walks through a sunny park, looking around curiously",
"image_urls": [
"https://example.com/character-front.jpg",
"https://example.com/character-side.jpg"
],
"duration": "8s",
"resolution": "1080p",
"generate_audio": True
}
)
# Access the generated video URL
video_url = result["video"]["url"]
print(f"Generated video: {video_url}")
JavaScript
import { fal } from "@fal-ai/client";
const result = await fal.subscribe("fal-ai/veo3.1/reference-to-video", {
input: {
prompt: "The character walks through a sunny park, looking around curiously",
image_urls: [
"https://example.com/character-front.jpg",
"https://example.com/character-side.jpg"
],
duration: "8s",
resolution: "1080p",
generate_audio: true
}
});
console.log("Generated video:", result.video.url);
Response Format
{
"video": {
"url": "https://storage.googleapis.com/.../output.mp4"
}
}
Examples
Character video:
- References: Multiple angles of a character
- Prompt: "The character runs through a forest, jumping over fallen logs"
Product showcase:
- References: Product photos from different angles
- Prompt: "The product rotates on a display stand with dramatic lighting"
Pet video:
- References: Photos of a pet from various angles
- Prompt: "The dog plays fetch in a backyard, running and jumping"
Avatar animation:
- References: Avatar/character design images
- Prompt: "The avatar waves hello and then starts dancing"
Tips
- Provide multiple reference images from different angles for better consistency
- Use clear, well-lit reference images
- Describe both the scene and the subject's actions in the prompt
- More reference images generally lead to better subject consistency
- Works best with distinct, recognizable subjects
Error Handling
| Error | Cause | Solution |
|---|---|---|
401 Unauthorized |
Invalid FAL_KEY | Verify key at fal.ai dashboard |
429 Too Many Requests |
Rate limit exceeded | Wait 60 seconds, retry |
400 Bad Request |
Invalid image URLs | Ensure all reference URLs are accessible |
500 Server Error |
API temporary issue | Retry after 30 seconds |
Timeout |
Video generation taking too long | Use 720p or fewer references |