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 MB อัตราส่วนของวิดีโอที่ได้จะเป็นไปตามเฟรมแรก
การตั้งค่าวิดีโอ
เลือกระยะเวลาเป็นจำนวนเต็มตั้งแต่ 3 ถึง 15 วินาที มีระดับความละเอียด 480P, 720P และ 1080P รูปแบบไฟล์เอาต์พุตคือ MP4 ที่ 24 เฟรมต่อวินาที รองรับการสร้างเสียงประกอบพร้อมกับภาพวิดีโอ
คำอธิบายใช้ภาษาใดก็ได้ โดยมีความยาวได้ไม่เกิน 5000 อักขระที่ไม่ใช่ภาษาจีน หรือ 2500 อักขระภาษาจีน หากเกินขีดจำกัด ส่วนที่เกินจะถูกตัดทิ้ง จึงควรอธิบายการกระทำและรายละเอียดการเคลื่อนไหวที่สำคัญภายในขอบเขตนี้ การใช้ค่า seed เริ่มต้นเดียวกันอาจให้วิดีโอที่คล้ายกัน แต่ไม่รับประกันว่าจะตรงกันทุกเฟรม
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- ขาออก
- US$0.18 ต่อวินาทีที่ความละเอียด 1080p
- ขาออก
- US$0.07 ต่อวินาทีที่ความละเอียด 480p
- ขาออก
- US$0.14 ต่อวินาทีที่ความละเอียด 720p
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 ระบุเฉพาะรายการแรก เรียกพาธเนื้อหา/แอสเซ็ตจริงทุกรายการ GET เนื้อหาโดยไม่มี index ไม่ได้ให้ผลลัพธ์ทั้งหมด
เมื่อต้องตรวจสอบการตอบกลับต้นฉบับ
อ่านงานเดิมที่มีอยู่ ห้ามส่งซ้ำเมื่อไม่ทราบผลการส่ง
ฟิลด์การตอบกลับ
| ฟิลด์ | ประเภท |
|---|---|
ฟิลด์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- ขาออก
- US$0.18 ต่อวินาทีที่ความละเอียด 1080p
- ขาออก
- US$0.07 ต่อวินาทีที่ความละเอียด 480p
- ขาออก
- US$0.14 ต่อวินาทีที่ความละเอียด 720p
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 ระบุเฉพาะรายการแรก เรียกพาธเนื้อหา/แอสเซ็ตจริงทุกรายการ GET เนื้อหาโดยไม่มี index ไม่ได้ให้ผลลัพธ์ทั้งหมด
เมื่อต้องตรวจสอบการตอบกลับต้นฉบับ
อ่านงานเดิมที่มีอยู่ ห้ามส่งซ้ำเมื่อไม่ทราบผลการส่ง
ฟิลด์การตอบกลับ
| ฟิลด์ | ประเภท |
|---|---|
ฟิลด์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- ขาออก
- US$0.18 ต่อวินาทีที่ความละเอียด 1080p
- ขาออก
- US$0.07 ต่อวินาทีที่ความละเอียด 480p
- ขาออก
- US$0.14 ต่อวินาทีที่ความละเอียด 720p
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 ระบุเฉพาะรายการแรก เรียกพาธเนื้อหา/แอสเซ็ตจริงทุกรายการ GET เนื้อหาโดยไม่มี index ไม่ได้ให้ผลลัพธ์ทั้งหมด
เมื่อต้องตรวจสอบการตอบกลับต้นฉบับ
อ่านงานเดิมที่มีอยู่ ห้ามส่งซ้ำเมื่อไม่ทราบผลการส่ง
ฟิลด์การตอบกลับ
| ฟิลด์ | ประเภท |
|---|---|
ฟิลด์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