チュートリアル
Seedance 2.5 参照動画生成 API:参照動画のカメラワークをそのままに被写体を差し替える
参照動画の長さも課金対象。費用の計算方法と、プロンプトでの @video1 の書き方をまとめて解説します。
TL;DR
seedance-2.5/reference-to-videoは既存の動画を参照として使い、そのカメラワーク、テンポ、動きを保ちながら、被写体や画風を変えたり参照音楽を合わせたりできます。モデルページを開く とオンラインで生成でき、新規ユーザー登録で 200 クレジットがもらえます。- 秒単位の課金で、参照動画の長さも費用に含まれます:費用 = 単価 ×(参照動画の長さ + 出力の長さ)。480p は毎秒 $0.1215、720p は $0.2715、1080p は $0.68。
- 5 秒参照 + 5 秒出力:480p は $1.215、720p は $2.715。まず 480p でプロンプトを調整するのが最も安上がりです。
まずは実際の効果をひとつ:被写体を差し替え、カメラワークを維持
参照動画はランニングシューズの広告で、参照画像は香水のボトルです。プロンプトでモデルにシューズ広告のカット順とカメラワークを踏襲させ、シューズをまるごと香水に置き換えます:
Use @video1 strictly as the reference for shot progression, product rotation, camera paths, pacing, macro close-ups, and lighting transitions. Replace the shoe completely with the perfume bottle from @image1. Preserve the bottle's exact silhouette, amber glass color, cap proportions, label placement, and premium material appearance in every shot. Present it as a luxury fragrance commercial on a dark obsidian pedestal, with warm amber rim light, controlled reflections, fine atmospheric mist, and precise macro detail. Follow the visual rhythm and camera choreography of @video1 while keeping one consistent perfume bottle throughout. Do not transfer shoe laces, soles, fabric textures, or shoe-shaped geometry into the bottle. Do not invent extra products, readable brand text, logos, hands, or people.
このプロンプトで生成 →(参照動画と製品画像をアップロード、480p、9:16)
seedance-2.5/reference-to-video、480p、9:16、出力 4 秒、音声はモデルが生成。
@video1、@image1 はプロンプト内の素材番号で、渡した順に reference_video_urls、reference_image_urls の最初のアドレスに対応します。末尾の「シューレースや靴底を香水瓶に持ち込まない」という一文は、前半のポジティブな記述と同じくらい重要です:はっきり書かないと、モデルは参照動画の細部を持ち込んでしまいます。
curl:最初の 1 本
curl -X POST https://api.hiapi.ai/v1/tasks \
-H "Authorization: Bearer $HIAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.5/reference-to-video",
"input": {
"prompt": "@video1 のカメラワークとテンポを踏襲し、被写体を @image1 の製品に置き換え、光と構図は一貫させる",
"reference_video_urls": ["https://your-cdn.example.com/reference-clip.mp4"],
"reference_image_urls": ["https://your-cdn.example.com/product.jpg"],
"duration": 5,
"resolution": "480p",
"aspect_ratio": "9:16"
}
}'
参照動画が 5 秒の場合、これは 480p で 10 秒として計算され、$1.215 になります。
taskId が返るので、結果を確認します:
curl https://api.hiapi.ai/v1/tasks/tk-hiapi-... \
-H "Authorization: Bearer $HIAPI_KEY"
status が success になったら、output[0].url から動画をダウンロードします。
Python:送信、ポーリング、ダウンロード
# pip install requests;先 export HIAPI_KEY=你的 Key
import os, time, uuid, requests
KEY = os.environ["HIAPI_KEY"]
H = {"Authorization": f"Bearer {KEY}"}
def generate(prompt, model="seedance-2.5/reference-to-video", timeout_s=900, **params):
body = {"model": model, "input": {"prompt": prompt, **params}}
# 重试提交同一个任务时带同一个 Idempotency-Key,避免重复扣费
headers = {**H, "Idempotency-Key": str(uuid.uuid4())}
r = requests.post("https://api.hiapi.ai/v1/tasks", json=body, headers=headers, timeout=30)
r.raise_for_status()
res = r.json()
if res.get("code") != 200:
raise RuntimeError(res)
task_id = res["data"]["taskId"]
deadline = time.time() + timeout_s
while time.time() < deadline:
d = requests.get(f"https://api.hiapi.ai/v1/tasks/{task_id}", headers=H, timeout=30).json()["data"]
if d["status"] == "success":
return d["output"][0]["url"]
if d["status"] == "fail":
raise RuntimeError(d)
time.sleep(10)
raise TimeoutError(task_id)
url = generate(
"@video1 のコーギーが走るテンポとローアングルの追従撮影を保ち、画面全体をフェルトのストップモーションアニメ風に変える",
reference_video_urls=["https://your-cdn.example.com/corgi-run.mp4"],
duration=5, resolution="480p", aspect_ratio="16:9",
)
with open("clip.mp4", "wb") as f:
f.write(requests.get(url).content)
よくある 3 つの使い方
1. 被写体を差し替え、カメラワークを維持(上の香水の例):参照動画 + 参照画像。プロンプトで「@video1 から何を取るか」「@image1 から何を取るか」「何を持ち込まないか」を明確に書きます。
2. 動きだけを移し、画風を全体的に変える:参照動画のみを渡します。次の例は、コーギーが走る実写をフェルトのストップモーションアニメに変え、走るテンポと追従カメラワークは維持します:
Use @video1 as the sole visual reference. Preserve the corgi's recognizable markings, running cadence, stride timing, body orientation, forward momentum, and the low side-tracking camera movement. Reimagine the entire scene as a handcrafted stop-motion film made from felt, wool, miniature grass, and painted paper scenery. Keep the warm sunset backlight and continuous chase rhythm, with subtle handmade texture and natural depth of field. Maintain one coherent corgi throughout the shot, anatomically stable legs, smooth forward motion, and a continuous camera path. Do not introduce additional animals, text, logos, abrupt cuts, or unrelated objects.
このプロンプトで生成 →(参照動画をアップロード)
seedance-2.5/reference-to-video、480p、参照動画のみ、出力 4 秒。
3. 動画 + 画像 + 音声を一緒に使う:さらに reference_audio_urls を加え、プロンプトで @audio1 を使ってどの画面を音楽のどのタイミングに合わせるかを指定すると、「BGM を付ける」とだけ書くよりはるかに正確です。参照音声は必ず参照動画と一緒に渡す必要があります。
パラメータ一覧
| パラメータ | 値 | 説明 |
|---|---|---|
prompt |
文字列、必須 | @video1 @image1 @audio1 で素材を参照 |
reference_video_urls |
必須、1〜10 本 | MP4/MOV、各 2〜30 秒、合計 30 秒以内、各 200 MB 未満 |
reference_image_urls |
最大 30 枚 | JPEG/PNG/WebP など、1 枚 30 MB 未満 |
reference_audio_urls |
最大 10 本 | WAV/MP3、参照動画と一緒に使う必要あり |
duration |
4〜30 の整数、または -1 でモデルが決定、デフォルト 5 |
単位は秒 |
resolution |
480p / 720p / 1080p、デフォルト 480p |
|
aspect_ratio |
16:9 4:3 1:1 3:4 9:16 21:9 adaptive |
縦画面はそのまま 9:16 |
generate_audio |
デフォルト true |
費用を計算する
課金秒数 = 参照動画の合計時間 + 出力時間。参照画像と参照音声は追加課金されません。
| 参照 + 出力 | 480p($0.1215/秒) | 720p($0.2715/秒) | 1080p($0.68/秒) |
|---|---|---|---|
| 5 秒 + 4 秒 | $1.0935 | $2.4435 | $6.12 |
| 5 秒 + 5 秒 | $1.215 | $2.715 | $6.8 |
| 10 秒 + 10 秒 | $2.43 | $5.43 | $13.6 |
節約のコツ:参照動画を必要な動きの部分だけに切り詰め、480p でプロンプトを調整し、仕上がりが決まってから 720p や 1080p で出力します。より詳しい計算は Seedance 2.5 API の料金 をご覧ください。
公開前の注意点
- 素材のアドレスは公開アクセス可能に:参照動画は公開アクセス可能な HTTPS アドレスが必要です。
- ポーリングの代わりにコールバックを:リクエストの最上位に
"callback": {"url": "https://你的域名/hiapi/callback"}を追加し、taskIdで重複排除します。 - 早めに転送保存:
output[0].urlは一時リンクなので、取得後すぐに自分のストレージに保存します。 - リトライには冪等キー:リクエストヘッダーに
Idempotency-Keyを追加すると、同じキーでのリトライはタスクを 1 回だけ作成します。 - 失敗時は自動返金:成功した動画のみ課金されます。
よくある質問
参照動画がなく、参照画像だけでも使えますか?
いいえ、reference_video_urls は必須です。画像だけの場合は、Seedance 2.5 画像から動画 の参照画像モードをご利用ください。
計算より多く課金されるのはなぜ?
参照動画の長さも課金対象です。10 秒の参照動画 + 5 秒の出力なら、15 秒として計算されます。
縦画面を直接出力できますか?
できます。aspect_ratio に 9:16 を指定すると、モデルが直接縦画面で生成します。後からトリミングするのではありません。
参照素材が多いほど高くなりますか?
参照画像と参照音声は追加料金なしで、課金されるのは参照動画の時間だけです。
参照素材なしで、テキストだけで動画を作りたい場合は、Seedance 2.5 テキストから動画 API をご覧ください。まず 1 本試したい方は、モデルページで参照動画をアップロード してください。
関連記事
すべての記事を見る →-
チュートリアル
HiAPI API で hailuo-2.3-fast/image-to-video を呼び出す方法:curl と Python の実践
高速・低コストな画像から動画へのティアにおける最初の実行可能なリクエスト — モデル ID から MP4 のダウンロードまで
-
チュートリアル
HiAPI APIでhailuo-2.3/text-to-videoを呼び出す方法:curl、Python、実行可能なリクエスト例
-
チュートリアル
HiAPI で Kandinsky 6.0 Pro のテキストto動画を使用する:curl と Python チュートリアル
リクエスト優先の実践デモ:プロンプトから動画クリップへの呼び出しを構築し、リクエストを送信し、完了状態をポーリングし、結果をダウンロードする