happyhorse-1.1-i2v
画像を動かすモデルです。元の画像が最初のフレームを決め、説明文がその後の動きを導きます。音声を付けることもできる短い動画を作成します。
- Ailoot · 動画
POST /v1/videos/generationshappyhorse-1.1-i2v - Ailoot · 動画
POST /v1/videos/generationshappyhorse-i2v - Ailoot · 動画
POST /v1/videos/generationshappyhorse-i2v-latest
モデルについて
この説明はモデルの機能を紹介するものです。Ailootで利用できる入力、出力、オプションは、選択したメソッドごとに以下に記載されています。
HappyHorse-1.1-I2Vは、用意した画像から動画のシーンを始めるAlibabaのモデルです。画像が最初のフレームとなり、テキストでその後の動作、登場人物の動き、シーンの変化、カメラの方向を指定できます。イラスト、商品写真、あらかじめ用意したビジュアルコンセプトを動かす用途に適しています。
テキストによる説明は任意です。説明がない場合、モデルは最初の画像の内容から考えられる動きを推測します。明示的に指定する場合、元の画像が構図や被写体の外観を決め、言葉が時間の経過に伴うシーンの展開を導きます。
最初のフレームから動きへ
Alibabaは、登場人物の外観の維持、視覚的な一貫性、滑らかな動き、映像と音の組み合わせを特徴として挙げています。文字や質感の安定性も掲げられています。これらはモデルの設計上の狙いであり、生成されたすべてのフレームで各ピクセルがそのまま保たれることを意味しません。
このモードでは、最初の画像を一枚使用します。この画像は開始時のシーンを定めるもので、新しい構図を作るための独立した複数の参考資料ではありません。このバージョンについて、別の終了フレームを指定する機能は公表されていません。
JPEG、JPG、PNG、WEBPを受け付けます。入力画像は各辺が300ピクセル以上である必要があります。許容されるアスペクト比は1:2.5〜2.5:1、ファイルサイズは20メガバイトまでです。完成した動画のアスペクト比は最初のフレームに従います。
動画のパラメータ
長さは3〜15秒の整数で選択します。解像度は480P、720P、1080Pから選べます。出力形式はMP4、フレームレートは毎秒24フレームです。映像とともに音声を生成できます。
説明文はどの言語でもよく、中国語以外は5000文字、中国語は2500文字まで入力できます。上限を超えた部分は切り捨てられるため、重要な動作や動きの特徴はこの範囲内に収めることをおすすめします。同じ初期乱数シードで似た動画が得られる場合はありますが、フレームごとの一致は保証されません。
Ailoot · 動画 POST /v1/videos/generations happyhorse-1.1-i2v
happyhorse-1.1-i2vhappyhorse-1.1-i2vhappyhorse-i2vhappyhorse-i2v-latest
はじめに
画像を動かすモデルです。元の画像が最初のフレームを決め、説明文がその後の動きを導きます。音声を付けることもできる短い動画を作成します。
- 対応する入力
- テキスト · 画像
- 結果
- 動画
Ailootで利用可能 · 入力とメソッド
Ailoot · 動画 POST /v1/videos/generations
- 入力の種類
text,image- 出力の種類
video- 出力形式
- mp4
| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
|---|---|---|---|---|
フィールドmodel | 種類string | 要件必須 | 値と制限 happyhorse-1.1-i2v | デフォルト— |
フィールドprompt | 種類string | 要件任意 | 値と制限 最小の長さ: 1 | デフォルト— |
フィールドduration | 種類integer | 要件任意 | 値と制限 最小値: 3 最大値: 15 単位: 秒 | デフォルト5 |
フィールドresolution | 種類string | 要件任意 | 値と制限 480P, 720P, 1080P | デフォルト720P |
フィールドratio | 種類string | 要件非対応 | 値と制限 | デフォルト— |
フィールドimage_urls | 種類https_url|data_image_url[] | 要件必須 | 値と制限 最小項目数: 1 最大項目数: 1 デコード後の最大バイト数: 20,971,520 MIMEタイプ: image/jpeg, image/png, image/webp | デフォルト— |
入力素材の組み合わせ
first_frame_to_video · 必須: image_urls
メソッドのパラメータとライフサイクル
| パラメータ | 仕様 |
|---|---|
パラメータcontent_type | 仕様application/json |
パラメータrequired | 仕様model, image_urls |
パラメータmaterial_types | 仕様text, image |
パラメータoptional | 仕様duration, resolution, ratio, prompt |
パラメータduration_integer_range | 仕様3, 15 |
パラメータdefault_duration | 仕様5 |
パラメータresolution | 仕様480P, 720P, 1080P |
パラメータdefault_resolution | 仕様720P |
パラメータratio | 仕様 |
パラメータratio_must_omit | 仕様true |
パラメータimage_urls | 仕様{"min_count":1,"max_count":1,"schemes":["https","ラスターデータのbase64"],"max_data_image_bytes":20971520} |
ライフサイクル: submit_once_poll_original
GET /v1/videos/{request_id}
GET /v1/videos/generations/{request_id}
GET /v1/videos/{request_id}/content
GET /v1/videos/generations/{request_id}/content
メソッドの形式とIDは正確に記載しています。供給元の対応能力とリクエストの受け入れは別です。
料金
Ailootのメソッド料金
POST /v1/videos/generations- 出力
- $0.18 1080p・1秒あたり
- 出力
- $0.07 480p・1秒あたり
- 出力
- $0.14 720p・1秒あたり
Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。金額の確保と精算の仕組み →
リクエスト例
Ailoot · 動画
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_URL:?Set the HTTPS URL of your actual first-frame image}"
export AILOOT_IMAGE_URL
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "happyhorse-1.1-i2v", "prompt": "The subject walks slowly toward the camera.", "duration": 5, "resolution": "720P"}')
from urllib.parse import urlsplit
u=os.environ["AILOOT_IMAGE_URL"]
z=urlsplit(u)
if z.scheme!="https" or not z.netloc or z.username or z.password:raise SystemExit("Set the actual HTTPS image URL")
p["image_urls"]=[u]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/videos/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
print(json.dumps(r))
PY_RESULT
結果を受け取って保存
Ailoot · 動画
mp4
GET /v1/videos/{request_id}GET /v1/videos/generations/{request_id}GET /v1/videos/{request_id}/contentGET /v1/videos/generations/{request_id}/content
ジョブのステータスを確認
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o status.json
python3 - <<'PY_STATUS'
import json
from pathlib import Path
r=json.loads(Path("status.json").read_text())
print(json.dumps(r))
if r.get("status")=="completed":
for x in r.get("data",[]):print(x)
PY_STATUS
完了したアセットをすべて保存
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_STATUS_FILE:?Set the actual completed status JSON file}"
export AILOOT_STATUS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
from urllib.parse import urlsplit,urljoin
f=Path(os.environ["AILOOT_STATUS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual completed status file")
r=json.loads(f.read_text())
if r.get("status")!="completed" or not isinstance(r.get("data"),list) or not r["data"]:raise SystemExit("Wait for a completed status with asset paths")
urls=[]
for x in r["data"]:
if not isinstance(x,str) or "\n" in x or "\r" in x:raise SystemExit("Invalid asset path")
u=urljoin("https://api.ailoot.ai",x)
z=urlsplit(u)
if z.scheme!="https" or z.netloc!="api.ailoot.ai" or z.username or z.password:raise SystemExit("Use the actual Ailoot asset paths from status")
urls.append(u)
Path("asset-urls.txt").write_text("\n".join(urls)+"\n")
PY_REQUEST
index=0
while IFS= read -r asset_url; do
curl --fail-with-body --silent --show-error "$asset_url" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o "video-${index}.mp4"
index=$((index + 1))
done < asset-urls.txt
その他のコンテンツ取得
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id/content" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o video.mp4
完了した結果をすべて保存
完了した動画や返されたファイルをすべて保存し、実際に返されたすべてのアセットURLから取得してください。
返されたすべてのデータ項目/出力インデックスを保持してください。content_urlは最初の出力のみです。実際のすべてのコンテンツパス/アセットを取得してください。indexなしのコンテンツGETでは、全出力は取得できません。
元のレスポンスを確認する場合
既存の元のジョブを読み取ってください。結果不明の送信を決して再実行しないでください。
レスポンスのフィールド
| フィールド | 種類 |
|---|---|
フィールドid | 種類string |
フィールドobject | 種類string |
フィールドmodel | 種類string |
フィールドstatus | 種類string |
フィールドcontent_url | 種類signed URL |
フィールドdata[] | 種類signed URL |
フィールドusage | 種類object |
フィールドresult_pending_check | 種類boolean |
エラーと次の手順
| レスポンス | 条件 | 次の手順 |
|---|---|---|
レスポンス400 · invalid_request_error | 条件必須フィールド、素材の表現形式、またはパラメーター値が不正です | 次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。 |
レスポンス409 · video_not_ready | 条件元の結果のコンテンツはまだ利用できません | 次の手順元の返却IDをポーリングし、Retry-Afterに従ってください。 |
レスポンスserver_error | 条件返されたレスポンスは、操作または結果の確認が必要であることを示しています | 次の手順最初に返された操作/タスク ID、リクエストヘッダー、レスポンスを保存し、その元の操作に対してサポートされている読み取りを継続してください。作成リクエストを再送しないでください。 |
エイリアス
モデルのエイリアス
Ailoot happyhorse-1.1-i2v, happyhorse-i2v, happyhorse-i2v-latest
メソッドパスのエイリアス
上記に表示されたメソッドパスを使用してください。
関連する呼び出し用ID
Ailoot · 動画 POST /v1/videos/generations happyhorse-i2v
happyhorse-i2vhappyhorse-1.1-i2vhappyhorse-i2vhappyhorse-i2v-latest
はじめに
画像を動かすモデルです。元の画像が最初のフレームを決め、説明文がその後の動きを導きます。音声を付けることもできる短い動画を作成します。
- 対応する入力
- テキスト · 画像
- 結果
- 動画
Ailootで利用可能 · 入力とメソッド
Ailoot · 動画 POST /v1/videos/generations
- 入力の種類
text,image- 出力の種類
video- 出力形式
- mp4
| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
|---|---|---|---|---|
フィールドmodel | 種類string | 要件必須 | 値と制限 happyhorse-i2v | デフォルト— |
フィールドprompt | 種類string | 要件任意 | 値と制限 最小の長さ: 1 | デフォルト— |
フィールドduration | 種類integer | 要件任意 | 値と制限 最小値: 3 最大値: 15 単位: 秒 | デフォルト5 |
フィールドresolution | 種類string | 要件任意 | 値と制限 480P, 720P, 1080P | デフォルト720P |
フィールドratio | 種類string | 要件非対応 | 値と制限 | デフォルト— |
フィールドimage_urls | 種類https_url|data_image_url[] | 要件必須 | 値と制限 最小項目数: 1 最大項目数: 1 デコード後の最大バイト数: 20,971,520 MIMEタイプ: image/jpeg, image/png, image/webp | デフォルト— |
入力素材の組み合わせ
first_frame_to_video · 必須: image_urls
メソッドのパラメータとライフサイクル
| パラメータ | 仕様 |
|---|---|
パラメータmaterial_types | 仕様text, image |
パラメータrequired | 仕様null |
パラメータoptional_controls | 仕様null |
ライフサイクル: submit_once_poll_original
GET /v1/videos/{request_id}
GET /v1/videos/generations/{request_id}
GET /v1/videos/{request_id}/content
GET /v1/videos/generations/{request_id}/content
メソッドの形式とIDは正確に記載しています。供給元の対応能力とリクエストの受け入れは別です。
料金
Ailootのメソッド料金
POST /v1/videos/generations- 出力
- $0.18 1080p・1秒あたり
- 出力
- $0.07 480p・1秒あたり
- 出力
- $0.14 720p・1秒あたり
Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。金額の確保と精算の仕組み →
リクエスト例
Ailoot · 動画
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_URL:?Set the HTTPS URL of your actual first-frame image}"
export AILOOT_IMAGE_URL
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "happyhorse-i2v", "prompt": "The subject walks slowly toward the camera.", "duration": 5, "resolution": "720P"}')
from urllib.parse import urlsplit
u=os.environ["AILOOT_IMAGE_URL"]
z=urlsplit(u)
if z.scheme!="https" or not z.netloc or z.username or z.password:raise SystemExit("Set the actual HTTPS image URL")
p["image_urls"]=[u]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/videos/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
print(json.dumps(r))
PY_RESULT
結果を受け取って保存
Ailoot · 動画
mp4
GET /v1/videos/{request_id}GET /v1/videos/generations/{request_id}GET /v1/videos/{request_id}/contentGET /v1/videos/generations/{request_id}/content
ジョブのステータスを確認
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o status.json
python3 - <<'PY_STATUS'
import json
from pathlib import Path
r=json.loads(Path("status.json").read_text())
print(json.dumps(r))
if r.get("status")=="completed":
for x in r.get("data",[]):print(x)
PY_STATUS
完了したアセットをすべて保存
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_STATUS_FILE:?Set the actual completed status JSON file}"
export AILOOT_STATUS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
from urllib.parse import urlsplit,urljoin
f=Path(os.environ["AILOOT_STATUS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual completed status file")
r=json.loads(f.read_text())
if r.get("status")!="completed" or not isinstance(r.get("data"),list) or not r["data"]:raise SystemExit("Wait for a completed status with asset paths")
urls=[]
for x in r["data"]:
if not isinstance(x,str) or "\n" in x or "\r" in x:raise SystemExit("Invalid asset path")
u=urljoin("https://api.ailoot.ai",x)
z=urlsplit(u)
if z.scheme!="https" or z.netloc!="api.ailoot.ai" or z.username or z.password:raise SystemExit("Use the actual Ailoot asset paths from status")
urls.append(u)
Path("asset-urls.txt").write_text("\n".join(urls)+"\n")
PY_REQUEST
index=0
while IFS= read -r asset_url; do
curl --fail-with-body --silent --show-error "$asset_url" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o "video-${index}.mp4"
index=$((index + 1))
done < asset-urls.txt
その他のコンテンツ取得
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id/content" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o video.mp4
完了した結果をすべて保存
完了した動画や返されたファイルをすべて保存し、実際に返されたすべてのアセットURLから取得してください。
返されたすべてのデータ項目/出力インデックスを保持してください。content_urlは最初の出力のみです。実際のすべてのコンテンツパス/アセットを取得してください。indexなしのコンテンツGETでは、全出力は取得できません。
元のレスポンスを確認する場合
既存の元のジョブを読み取ってください。結果不明の送信を決して再実行しないでください。
レスポンスのフィールド
| フィールド | 種類 |
|---|---|
フィールドid | 種類string |
フィールドobject | 種類string |
フィールドmodel | 種類string |
フィールドstatus | 種類string |
フィールドcontent_url | 種類signed URL |
フィールドdata[] | 種類signed URL |
フィールドusage | 種類object |
フィールドresult_pending_check | 種類boolean |
エラーと次の手順
| レスポンス | 条件 | 次の手順 |
|---|---|---|
レスポンス400 · invalid_request_error | 条件必須フィールド、素材の表現形式、またはパラメーター値が不正です | 次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。 |
レスポンス409 · video_not_ready | 条件元の結果のコンテンツはまだ利用できません | 次の手順元の返却IDをポーリングし、Retry-Afterに従ってください。 |
レスポンスserver_error | 条件返されたレスポンスは、操作または結果の確認が必要であることを示しています | 次の手順最初に返された操作/タスク ID、リクエストヘッダー、レスポンスを保存し、その元の操作に対してサポートされている読み取りを継続してください。作成リクエストを再送しないでください。 |
エイリアス
モデルのエイリアス
Ailoot happyhorse-1.1-i2v, happyhorse-i2v, happyhorse-i2v-latest
メソッドパスのエイリアス
上記に表示されたメソッドパスを使用してください。
関連する呼び出し用ID
Ailoot · 動画 POST /v1/videos/generations happyhorse-i2v-latest
happyhorse-i2v-latesthappyhorse-1.1-i2vhappyhorse-i2vhappyhorse-i2v-latest
はじめに
画像を動かすモデルです。元の画像が最初のフレームを決め、説明文がその後の動きを導きます。音声を付けることもできる短い動画を作成します。
- 対応する入力
- テキスト · 画像
- 結果
- 動画
Ailootで利用可能 · 入力とメソッド
Ailoot · 動画 POST /v1/videos/generations
- 入力の種類
text,image- 出力の種類
video- 出力形式
- mp4
| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
|---|---|---|---|---|
フィールドmodel | 種類string | 要件必須 | 値と制限 happyhorse-i2v-latest | デフォルト— |
フィールドprompt | 種類string | 要件任意 | 値と制限 最小の長さ: 1 | デフォルト— |
フィールドduration | 種類integer | 要件任意 | 値と制限 最小値: 3 最大値: 15 単位: 秒 | デフォルト5 |
フィールドresolution | 種類string | 要件任意 | 値と制限 480P, 720P, 1080P | デフォルト720P |
フィールドratio | 種類string | 要件非対応 | 値と制限 | デフォルト— |
フィールドimage_urls | 種類https_url|data_image_url[] | 要件必須 | 値と制限 最小項目数: 1 最大項目数: 1 デコード後の最大バイト数: 20,971,520 MIMEタイプ: image/jpeg, image/png, image/webp | デフォルト— |
入力素材の組み合わせ
first_frame_to_video · 必須: image_urls
メソッドのパラメータとライフサイクル
| パラメータ | 仕様 |
|---|---|
パラメータmaterial_types | 仕様text, image |
パラメータrequired | 仕様null |
パラメータoptional_controls | 仕様null |
ライフサイクル: submit_once_poll_original
GET /v1/videos/{request_id}
GET /v1/videos/generations/{request_id}
GET /v1/videos/{request_id}/content
GET /v1/videos/generations/{request_id}/content
メソッドの形式とIDは正確に記載しています。供給元の対応能力とリクエストの受け入れは別です。
料金
Ailootのメソッド料金
POST /v1/videos/generations- 出力
- $0.18 1080p・1秒あたり
- 出力
- $0.07 480p・1秒あたり
- 出力
- $0.14 720p・1秒あたり
Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。金額の確保と精算の仕組み →
リクエスト例
Ailoot · 動画
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_URL:?Set the HTTPS URL of your actual first-frame image}"
export AILOOT_IMAGE_URL
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "happyhorse-i2v-latest", "prompt": "The subject walks slowly toward the camera.", "duration": 5, "resolution": "720P"}')
from urllib.parse import urlsplit
u=os.environ["AILOOT_IMAGE_URL"]
z=urlsplit(u)
if z.scheme!="https" or not z.netloc or z.username or z.password:raise SystemExit("Set the actual HTTPS image URL")
p["image_urls"]=[u]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/videos/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
print(json.dumps(r))
PY_RESULT
結果を受け取って保存
Ailoot · 動画
mp4
GET /v1/videos/{request_id}GET /v1/videos/generations/{request_id}GET /v1/videos/{request_id}/contentGET /v1/videos/generations/{request_id}/content
ジョブのステータスを確認
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o status.json
python3 - <<'PY_STATUS'
import json
from pathlib import Path
r=json.loads(Path("status.json").read_text())
print(json.dumps(r))
if r.get("status")=="completed":
for x in r.get("data",[]):print(x)
PY_STATUS
完了したアセットをすべて保存
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_STATUS_FILE:?Set the actual completed status JSON file}"
export AILOOT_STATUS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
from urllib.parse import urlsplit,urljoin
f=Path(os.environ["AILOOT_STATUS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual completed status file")
r=json.loads(f.read_text())
if r.get("status")!="completed" or not isinstance(r.get("data"),list) or not r["data"]:raise SystemExit("Wait for a completed status with asset paths")
urls=[]
for x in r["data"]:
if not isinstance(x,str) or "\n" in x or "\r" in x:raise SystemExit("Invalid asset path")
u=urljoin("https://api.ailoot.ai",x)
z=urlsplit(u)
if z.scheme!="https" or z.netloc!="api.ailoot.ai" or z.username or z.password:raise SystemExit("Use the actual Ailoot asset paths from status")
urls.append(u)
Path("asset-urls.txt").write_text("\n".join(urls)+"\n")
PY_REQUEST
index=0
while IFS= read -r asset_url; do
curl --fail-with-body --silent --show-error "$asset_url" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o "video-${index}.mp4"
index=$((index + 1))
done < asset-urls.txt
その他のコンテンツ取得
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_OPERATION_ID:?Set the actual Ailoot operation ID returned by creation}"
export AILOOT_OPERATION_ID
operation_id=$(python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["AILOOT_OPERATION_ID"],safe=""))')
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/videos/generations/$operation_id/content" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o video.mp4
完了した結果をすべて保存
完了した動画や返されたファイルをすべて保存し、実際に返されたすべてのアセットURLから取得してください。
返されたすべてのデータ項目/出力インデックスを保持してください。content_urlは最初の出力のみです。実際のすべてのコンテンツパス/アセットを取得してください。indexなしのコンテンツGETでは、全出力は取得できません。
元のレスポンスを確認する場合
既存の元のジョブを読み取ってください。結果不明の送信を決して再実行しないでください。
レスポンスのフィールド
| フィールド | 種類 |
|---|---|
フィールドid | 種類string |
フィールドobject | 種類string |
フィールドmodel | 種類string |
フィールドstatus | 種類string |
フィールドcontent_url | 種類signed URL |
フィールドdata[] | 種類signed URL |
フィールドusage | 種類object |
フィールドresult_pending_check | 種類boolean |
エラーと次の手順
| レスポンス | 条件 | 次の手順 |
|---|---|---|
レスポンス400 · invalid_request_error | 条件必須フィールド、素材の表現形式、またはパラメーター値が不正です | 次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。 |
レスポンス409 · video_not_ready | 条件元の結果のコンテンツはまだ利用できません | 次の手順元の返却IDをポーリングし、Retry-Afterに従ってください。 |
レスポンスserver_error | 条件返されたレスポンスは、操作または結果の確認が必要であることを示しています | 次の手順最初に返された操作/タスク ID、リクエストヘッダー、レスポンスを保存し、その元の操作に対してサポートされている読み取りを継続してください。作成リクエストを再送しないでください。 |
エイリアス
モデルのエイリアス
Ailoot happyhorse-1.1-i2v, happyhorse-i2v, happyhorse-i2v-latest
メソッドパスのエイリアス
上記に表示されたメソッドパスを使用してください。
関連する呼び出し用ID
FAQ · happyhorse-1.1-i2v
- 利用できる入力と結果は何ですか?
POST /v1/videos/generations·happyhorse-1.1-i2v:text,image→videoPOST /v1/videos/generations·happyhorse-i2v:text,image→videoPOST /v1/videos/generations·happyhorse-i2v-latest:text,image→video- リクエストはどの項目を使用しますか?
POST /v1/videos/generations·happyhorse-1.1-i2v:model,prompt,duration,resolution,image_urlsPOST /v1/videos/generations·happyhorse-i2v:model,prompt,duration,resolution,image_urlsPOST /v1/videos/generations·happyhorse-i2v-latest:model,prompt,duration,resolution,image_urls- どの制限が適用されますか?
POST /v1/videos/generations·happyhorse-1.1-i2v:duration.minimum:3;duration.maximum:15POST /v1/videos/generations·happyhorse-i2v:duration.minimum:3;duration.maximum:15POST /v1/videos/generations·happyhorse-i2v-latest:duration.minimum:3;duration.maximum:15