返回 AiToEarn
1 ---
2 name: generating-videos
3 description: Generates videos using Grok. Supports text-to-video and image-to-video. AI视频生成、文生视频、图生视频。
4 ---
5
6 # Video Generation
7
8 Generates videos using **Grok**.
9
10 ## Model Selection Strategy
11
12 Use `grok-imagine-video` for video generation.
13
14 | Scenario | Use Model | Reason |
15 |----------|-----------|--------|
16 | Video 1-15s | `grok-imagine-video` | Grok supports direct 1-15s generation |
17 | Text-to-video | `grok-imagine-video` | Prompt-only generation |
18 | Image-to-video | `grok-imagine-video` | Uses one reference image |
19 | Video >15s | Generate multiple clips, then load `editing-videos` to concatenate | Grok max duration is 15s |
20
21 ## Language Rule
22
23 Video prompts MUST follow the user's language. If the user writes in Chinese, generate Chinese prompts; if in English, generate English prompts. If the user explicitly requests a specific language, use that language.
24
25 ## Grok Video Model
26
27 | Model | Speed | Quality | Max Duration | Use Case |
28 |-------|-------|---------|--------------|----------|
29 | `grok-imagine-video` | Fast | Good | 15s | Default video generation |
30
31 ## Parameters
32
33 | Parameter | Values | Default | Description |
34 |-----------|--------|---------|-------------|
35 | `duration` | 1-15 | model default | Video duration in seconds |
36 | `resolution` | `480p`, `720p` | `720p` | Video resolution |
37 | `aspectRatio` | `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `3:2`, `2:3` | `9:16` | Video aspect ratio |
38 | `imageUrl` | URL | none | Reference image URL for image-to-video |
39
40 ## Workflow
41
42 1. Call `generateVideoWithGrok` with prompt and optional parameters.
43 2. Poll `getGrokVideoStatus` every 30 seconds.
44 3. Maximum wait: 5 minutes.
45 4. Save completed output to draft unless the user explicitly asks for media library only.
46
47 ## Prompt Structure
48
49 `[Subject & Background] + [Action] + [Style] + [Camera] + [Atmosphere] + [Audio]`
50
51 ### Subject & Background
52
53 Specify the main focus and environmental context.
54
55 Examples:
56 - "A young woman with long black hair wearing a red dress"
57 - "White concrete apartment building with organic shapes and lush greenery"
58
59 ### Action
60
61 Describe what the subject is doing.
62
63 Examples:
64 - "walks slowly towards the camera"
65 - "transforms from liquid to solid"
66
67 ### Style
68
69 Add aesthetic direction.
70
71 Examples:
72 - Film noir
73 - Surrealism
74 - Cyberpunk
75 - 3D cartoon animation
76 - Cinematic documentary
77
78 ### Camera
79
80 Describe movement and framing.
81
82 Examples:
83 - "slow dolly-in"
84 - "handheld tracking shot"
85 - "close-up with shallow depth of field"
86
87 ### Atmosphere
88
89 Describe lighting, color, mood, and setting.
90
91 Examples:
92 - "warm sunset lighting"
93 - "misty morning atmosphere"
94 - "high contrast studio lighting"
95
96 ### Audio
97
98 Include useful audio cues when relevant.
99
100 Examples:
101 - "soft ambient city sounds"
102 - "gentle piano music"
103 - "footsteps on wet pavement"
104
105 ## Aspect Ratio Guidance
106
107 | Platform / Use | Aspect Ratio |
108 |----------------|--------------|
109 | TikTok, Reels, Shorts, mobile social video | `9:16` |
110 | YouTube landscape, website hero, presentation | `16:9` |
111 | Profile or square feed asset | `1:1` |
112 | Portrait-style content | `3:4` or `2:3` |
113 | Landscape social feed | `4:3` or `3:2` |
114
115 ## Long Video Strategy
116
117 For videos longer than 15 seconds:
118
119 1. Split the video into independent 15-second-or-shorter segments.
120 2. Generate each segment with `generateVideoWithGrok`.
121 3. Poll every task until complete.
122 4. Load `editing-videos`.
123 5. Use the video editing tool to concatenate the completed segments.
124
125 Keep prompts visually consistent across segments by repeating subject, style, lighting, camera language, and environment details.
126
126 lines MARKDOWN