動画
画像から動画
被写体、構図、スタイルを保ったまま参照画像をアニメーション化する方法。
元画像が被写体と構図を決めます。プロンプトでは動き、テンポ、変えてはいけない要素を明示します。短いアニメーションほど制御しやすくなります。
実践の要点
速度、忠実度、解像度、制御性のどれを優先するかでモデルを選び、各結果のパラメータとバージョンを保存します。 wan2.7-video, kling-3.0-*, veo3.1-* and sora2 — Image to video.
1 回の試行で変えるのは 1 点だけにします。良い出力を参照として残すと、次の反復で最も確実な出発点になります。
finished と failed は終端状態として扱います。polling または webhook を使い、生のエラーはサーバー側に保持し、利用者には安全なメッセージを表示してください。
プロンプトと API の例
A matte-black espresso machine on a concrete counter with steam and morning light
Steam rises and drifts left, the light slowly warms, camera pushes in veryslightly. Everything else stays still.
A hyperrealistic macro photo of tiny, miniature surfers riding ocean wavesinside a rustic stone bathroom sink. A vintage brass faucet is running,creating the perpetual surf. Surreal, whimsical, bright natural lighting.

Source: Google AI for Developers, used under CC BY 4.0; format and dimensions adapted.
A surreal, cinematic macro video. Tiny surfers ride perpetual, rolling wavesinside a stone bathroom sink. A running vintage brass faucet generates theendless surf. The camera slowly pans across the whimsical, sunlit scene as theminiature figures expertly carve the turquoise water.
Source: Google AI for Developers, used under CC BY 4.0; format and dimensions adapted.
Smooth continuous transition between the two framings, no cuts, naturallighting change
The character turns from the window toward the camera and smiles. Room toneand distant traffic. No cuts.
The character performs the motion from the reference video, keeping their ownclothing and appearance
About these samples. Ready-made examples are copied to our own storage only when their source permits reuse. The exact prompt appears above each result, and the original source and license are linked below the media.
{"model": "doubao-seedance-2.0","input": {"prompt": "The camera drifts left as the sun clears the ridge","imageWithRoles": [{ "url": "https://example.com/dawn.jpg", "role": "first_frame" },{ "url": "https://example.com/noon.jpg", "role": "last_frame" }],"resolution": "1080p","duration": 8,"generateAudio": false}}
{"model": "pixverse-v6","input": {"prompt": "Slow dissolve between the two framings","firstFrameImage": "https://example.com/dawn.jpg","lastFrameImage": "https://example.com/noon.jpg","duration": 5,"resolution": "720p"}}
{"model": "wan2.7-video","input": {"imageUrls": ["https://example.com/dawn.jpg","https://example.com/noon.jpg"],"resolution": "1080p","duration": 5}}
{"model": "kling-3.0-motion-control","input": {"prompt": "Studio backdrop, soft key light","imageUrls": ["https://example.com/character.png"],"videoUrls": ["https://example.com/dance-reference.mp4"],"characterOrientation": "image","resolution": "1080p"}}
{"model": "midjourney-video","input": {"prompt": "Gentle parallax drift toward the archway","imageUrls": ["https://example.com/still.png"],"videoType": "vid_1.1_i2v_720","motion": "high","batchSize": 1}}
{"model": "midjourney-video","input": {"parentTaskId": "019ca881-9503-7270-a560-f00fc2b15785","index": 0,"animateMode": "auto","videoType": "vid_1.1_i2v_480"}}
curl -X POST https://api.api-stock.com/api/v1/generation/create \-H "Authorization: Bearer sk-your-key" \-H "Content-Type: application/json" \-d '{"model": "sora2","input": {"prompt": "The gulls lift off and the boat rocks in the swell","urls": ["https://example.com/harbour.jpg"],"aspectRatio": "16:9","duration": 10}}'
{"code": 200,"data": {"taskId": "019ca8a1-1c40-73f2-9b6d-4a01d8e2f7c3","status": "not_started","createdAt": "2026-02-28T12:04:11.000Z"}}
const BASE = "https://api.api-stock.com/api/v1";const KEY = process.env.API_STOCK_KEY!;async function animate(imageUrl: string, prompt: string) {const create = await fetch(`${BASE}/generation/create`, {method: "POST",headers: {Authorization: `Bearer ${KEY}`,"Content-Type": "application/json",},body: JSON.stringify({model: "sora2",input: { prompt, urls: [imageUrl], aspectRatio: "16:9", duration: 10 },}),});const created = await create.json();if (!create.ok) {throw new Error(`${created.error.code}: ${created.error.message}`);}const taskId: string = created.data.taskId;for (;;) {await new Promise((r) => setTimeout(r, 10_000));const res = await fetch(`${BASE}/task/status/${taskId}`, {headers: { Authorization: `Bearer ${KEY}` },});const body = await res.json().catch(() => null);if (!res.ok) {const message = body?.error?.message ?? `${res.status} ${res.statusText}`;throw new Error(message);}const { data } = body;if (data.status === "finished") return data.files[0].fileUrl;if (data.status === "failed" || data.status === "expired") {throw new Error(data.errorMessage);}}}const url = await animate("https://example.com/harbour.jpg","The gulls lift off and the boat rocks in the swell",);console.log(url); // → https://storage.api-stock.com/generated/video-...mp4
{"code": 200,"data": {"taskId": "019ca8a1-1c40-73f2-9b6d-4a01d8e2f7c3","status": "finished","files": [{"fileUrl": "https://storage.api-stock.com/generated/video-9f31c2.mp4","fileType": "video"}],"createdTime": "2026-02-28T12:04:11.000Z"}}
自分の API キーで試す
このガイドで扱うモデルはすべて API Stock のカタログで利用できます。API キーは 1 つ、プリペイド残高も 1 つで、プロバイダーごとの登録は不要です。