テキストと画像からビデオへ
プロンプトから生成するか、先頭フレーム画像をアニメーション化します。両方を指定するとプロンプトが動きを制御します。
Alibaba の Happy Horse 1.0 ビデオモデルを1つの統合 API で。最大1080pのテキスト→ビデオと画像→ビデオを、同期音声・非同期ジョブ・Webhook とともに利用できます。
Happy Horse 1.0 を1回のAPIコールで統合できます。1つのキー、1つの統一エンドポイント、そしてApiframe上のすべてのモデルで共通の請求。
model: "happyhorse-1.0" プロンプトから生成するか、先頭フレーム画像をアニメーション化します。両方を指定するとプロンプトが動きを制御します。
すべてのクリップに、内容に合った音声が自動で付与されます。別途の音声処理は不要です。
720p か 1080p を選び、3〜15秒の任意の長さで生成できます。料金は秒単位です。
Apiframeの Happy Horse 1.0 API で実行できるプロンプト例です。
霧のかかった草原を日の出とともに駆ける野生の馬、シネマティックなスローモーション
夜のネオン街、雨の中を進むサイクリストをカメラが追う
鮮やかな赤い花にホバリングするハチドリのクローズアップ、黄金色の光
APIキーを添えて POST /v2/videos/generate に1回リクエストを送るだけで Happy Horse 1.0 による生成が始まります。レスポンスには、ポーリングまたはWebhookで受け取れる jobId が返ります。
curl -X POST https://api.apiframe.ai/v2/videos/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a cinematic sunrise over a futuristic cityscape, smooth camera push-in",
"model": "happyhorse-1.0",
"happyhorse10Params": {
"image": "https://example.com/input.jpg",
"resolution": "1080p",
"aspect_ratio": "16:9",
"seed": 1
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/videos/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "a cinematic sunrise over a futuristic cityscape, smooth camera push-in",
"model": "happyhorse-1.0",
"happyhorse10Params": {
"image": "https://example.com/input.jpg",
"resolution": "1080p",
"aspect_ratio": "16:9",
"seed": 1
}
},
)
print(response.json()) # { "jobId": "...", "status": "QUEUED" }const response = await fetch("https://api.apiframe.ai/v2/videos/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "a cinematic sunrise over a futuristic cityscape, smooth camera push-in",
"model": "happyhorse-1.0",
"happyhorse10Params": {
"image": "https://example.com/input.jpg",
"resolution": "1080p",
"aspect_ratio": "16:9",
"seed": 1
}
}),
});
const { jobId } = await response.json();
console.log(jobId);生成は非同期で行われます。送信が成功すると 202 Accepted と jobId が返ります。ステータスが COMPLETED になるまで GET /v2/jobs/{id} をポーリングする(または webhook_url を指定する)と、result フィールドに出力URLが格納されます。
{
"jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"status": "QUEUED"
}curl https://api.apiframe.ai/v2/jobs/JOB_ID \
-H "X-API-Key: afk_your_api_key_here"import requests, time
while True:
job = requests.get(
"https://api.apiframe.ai/v2/jobs/JOB_ID",
headers={"X-API-Key": "afk_your_api_key_here"},
).json()
if job["status"] in ("COMPLETED", "FAILED"):
break
time.sleep(2)
print(job["result"])let job;
do {
await new Promise((r) => setTimeout(r, 2000));
job = await fetch("https://api.apiframe.ai/v2/jobs/JOB_ID", {
headers: { "X-API-Key": "afk_your_api_key_here" },
}).then((r) => r.json());
} while (job.status !== "COMPLETED" && job.status !== "FAILED");
console.log(job.result);Happy Horse 1.0 エンドポイントが受け付けるリクエストパラメータです。モデル固有のオプションは、下記のパラメータオブジェクトの中にネストされます。
| パラメータ | 型 | 必須 | デフォルト | 許可値 / 範囲 | 説明 |
|---|---|---|---|---|---|
| prompt | string | 必須 | — | — | 生成する内容のテキスト説明。 |
| model | string | 必須 | "happyhorse-1.0" | "happyhorse-1.0" | このエンドポイントのモデル識別子。 |
| happyhorse10Params.image | string (URL) | 任意 | — | — | Provide an image to animate (image-to-video); omit for text-to-video. |
| happyhorse10Params.resolution | string | 任意 | "1080p" | "720p", "1080p" | Resolution |
| happyhorse10Params.aspect_ratio | string | 任意 | "16:9" | "16:9", "9:16", "1:1", "4:3", "3:4" | Used for text-to-video (and reference-to-video on 1.1); ignored when animating an image. |
| happyhorse10Params.seed | number | 任意 | — | step 1 | Reuse a number to reproduce the same result. |
Happy Horse 1.0 APIに関するよくある質問をまとめました。
画像を指定しなければテキスト→ビデオになり、aspect_ratio で形を指定できます。happyhorse10Params.image を指定すると先頭フレームとしてアニメーション化され、出力は画像のアスペクト比に従います。
出力の秒単位課金で、720p は1秒あたり24クレジット、1080p は1秒あたり48クレジットです。6秒の1080pクリップは288クレジットになります。
リクエストは Replicate と Alibaba Cloud(DashScope)で自動フェイルオーバーしながら処理されるため、管理するのは Apiframe のキーだけです。
解決しませんでしたか?
APIキーを取得すれば数分で Happy Horse 1.0 を統合できます — 従量課金。
ご質問はありますか? Discordに参加 または 営業に問い合わせる。