happyhorse-1.1-r2v
โมเดลสร้างวิดีโอจากภาพอ้างอิงและบทที่ระบุเป็นข้อความ ช่วยรักษารูปลักษณ์ของตัวละคร วัตถุ และสไตล์ภาพในฉากใหม่
- Ailoot · วิดีโอ
POST /v1/videos/generationshappyhorse-1.1-r2v - Ailoot · วิดีโอ
POST /v1/videos/generationshappyhorse-r2v - Ailoot · วิดีโอ
POST /v1/videos/generationshappyhorse-r2v-latest
เกี่ยวกับโมเดล
คำอธิบายนี้ครอบคลุมความสามารถของโมเดล อินพุต เอาต์พุต และตัวเลือกที่ใช้ได้ใน Ailoot แสดงด้านล่างตามเมธอดที่เลือก
HappyHorse-1.1-R2V สร้างฉากวิดีโอใหม่จากภาพอ้างอิงและคำสั่งข้อความ Alibaba ออกแบบโมเดลให้คงลักษณะที่จดจำได้ของตัวละคร วัตถุ และสไตล์ภาพระหว่างสร้างการเคลื่อนไหว ภาพอ้างอิงกำหนดเนื้อหาและรูปลักษณ์ของฉาก ส่วนข้อความอธิบายว่าองค์ประกอบเหล่านี้ควรมีปฏิสัมพันธ์กันอย่างไร
บทบาทของภาพตัวอย่าง
ใช้ภาพได้ตั้งแต่หนึ่งถึงเก้าภาพ เพื่อกำหนดตัวละคร วัตถุ สภาพแวดล้อม หรือแนวทางศิลปะ ในคำอธิบายสามารถระบุหมายเลขภาพอ้างอิงและวัตถุที่ต้องการในภาพนั้น เพื่อเชื่อมภาพกับส่วนที่เกี่ยวข้องของการกระทำ วิธีนี้มีประโยชน์เป็นพิเศษเมื่อต้องรวมองค์ประกอบจากหลายภาพไว้ในองค์ประกอบภาพเดียวกัน
ต่างจากโหมดที่ใช้เฟรมเริ่มต้น ภาพอ้างอิงในโหมดนี้เป็นหลักในการกำหนดเนื้อหาของฉากใหม่ ต้องมีคำสั่งข้อความเพื่อเชื่อมรูปลักษณ์ของวัตถุกับการกระทำ การเคลื่อนกล้อง และการจัดฉากโดยรวม ผู้ผลิตเน้นความสอดคล้องของภาพและการเคลื่อนไหวแบบภาพยนตร์ ผลลัพธ์ยังคงเป็นการสร้างขึ้นใหม่ ไม่ใช่การตัดต่อภาพต้นฉบับ
รองรับ JPEG, JPG, PNG และ WEBP ขนาดไม่เกิน 20 MB ต่อภาพ ด้านสั้นของภาพต้องมีขนาดไม่น้อยกว่า 400 พิกเซล แนะนำให้ใช้ภาพระดับ 720P ขึ้นไป อินพุตของโหมดนี้ประกอบด้วยภาพและข้อความเท่านั้น
ระยะเวลา อัตราส่วนภาพ และเสียง
บันทึกผลลัพธ์เป็น MP4 ที่ 24 เฟรมต่อวินาที กำหนดระยะเวลาเป็นจำนวนเต็มตั้งแต่ 3 ถึง 15 วินาที เลือกความละเอียดได้ระหว่าง 480P, 720P และ 1080P และรองรับการสร้างเสียงประกอบ
มีรูปแบบภาพแนวนอน แนวตั้ง และสี่เหลี่ยมจัตุรัส ได้แก่ 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21 และ 21:9 การเลือกรูปแบบช่วยกำหนดพื้นที่สำหรับจัดองค์ประกอบของฉากใหม่ล่วงหน้า
ข้อความใช้ภาษาใดก็ได้ โดยจำกัดที่ 5000 อักขระที่ไม่ใช่ภาษาจีน หรือ 2500 อักขระภาษาจีน ส่วนที่เกินจะถูกตัดทิ้ง บทบาทสำคัญของภาพอ้างอิง การกระทำ และการเคลื่อนไหวต้องอยู่ภายในความยาวนี้ ค่า seed เริ่มต้นสามารถชี้นำให้ตัวเลือกต่าง ๆ คล้ายกันได้ แต่ไม่รับประกันว่าจะสร้างวิดีโอเดิมซ้ำได้อย่างตรงกันทุกประการ
Ailoot · วิดีโอ POST /v1/videos/generations happyhorse-1.1-r2v
happyhorse-1.1-r2vhappyhorse-1.1-r2vhappyhorse-r2vhappyhorse-r2v-latest
เริ่มต้น
โมเดลสร้างวิดีโอจากภาพอ้างอิงและบทที่ระบุเป็นข้อความ ช่วยรักษารูปลักษณ์ของตัวละคร วัตถุ และสไตล์ภาพในฉากใหม่
- อินพุตที่รองรับ
- ข้อความ · รูปภาพ
- ผลลัพธ์
- วิดีโอ
ใช้งานได้ใน Ailoot · อินพุตและเมธอด
Ailoot · วิดีโอ POST /v1/videos/generations
- ขาเข้า
text,image- ขาออก
video- รูปแบบเอาต์พุต
- mp4
| ฟิลด์ | ประเภท | ข้อกำหนด | ค่าและข้อจำกัด | ค่าเริ่มต้น |
|---|---|---|---|---|
ฟิลด์model | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด happyhorse-1.1-r2v | ค่าเริ่มต้น— |
ฟิลด์prompt | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด ความยาวขั้นต่ำ: 1 | ค่าเริ่มต้น— |
ฟิลด์duration | ประเภทinteger | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขั้นต่ำ: 3 สูงสุด: 15 หน่วย: วินาที | ค่าเริ่มต้น5 |
ฟิลด์resolution | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด 480P, 720P, 1080P | ค่าเริ่มต้น720P |
ฟิลด์ratio | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9 | ค่าเริ่มต้น16:9 |
ฟิลด์image_urls | ประเภทhttps_url|data_image_url[] | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด จำนวนรายการขั้นต่ำ: 1 จำนวนรายการสูงสุด: 9 จำนวนไบต์สูงสุดหลังถอดรหัส: 20,971,520 ประเภท MIME: image/jpeg, image/png, image/webp | ค่าเริ่มต้น— |
ชุดผสมของสื่ออินพุต
reference_images_to_video · จำเป็น: prompt, image_urls
พารามิเตอร์และวงจรการทำงานของเมธอด
| พารามิเตอร์ | ข้อกำหนด |
|---|---|
พารามิเตอร์content_type | ข้อกำหนดapplication/json |
พารามิเตอร์required | ข้อกำหนดmodel, prompt, image_urls |
พารามิเตอร์material_types | ข้อกำหนดtext, image |
พารามิเตอร์optional | ข้อกำหนดduration, resolution, ratio |
พารามิเตอร์duration_integer_range | ข้อกำหนด3, 15 |
พารามิเตอร์default_duration | ข้อกำหนด5 |
พารามิเตอร์resolution | ข้อกำหนด480P, 720P, 1080P |
พารามิเตอร์default_resolution | ข้อกำหนด720P |
พารามิเตอร์ratio | ข้อกำหนด16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9 |
พารามิเตอร์ratio_must_omit | ข้อกำหนดfalse |
พารามิเตอร์image_urls | ข้อกำหนด{"min_count":1,"max_count":9,"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_URLS_FILE:?Set a JSON file containing your actual reference-image URLs}"
export AILOOT_IMAGE_URLS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "happyhorse-1.1-r2v", "prompt": "The subject walks slowly toward the camera.", "duration": 5, "resolution": "720P"}')
from urllib.parse import urlsplit
f=Path(os.environ["AILOOT_IMAGE_URLS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual reference URL JSON file")
urls=json.loads(f.read_text())
if not isinstance(urls,list) or not 1<=len(urls)<=9:raise SystemExit("Provide one to nine reference-image URLs")
for u in urls:
z=urlsplit(u) if isinstance(u,str) else None
if not z or z.scheme!="https" or not z.netloc or z.username or z.password:raise SystemExit("Each reference must be an actual HTTPS image URL")
p["image_urls"]=urls
p["ratio"]="16:9"
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-r2v, happyhorse-r2v, happyhorse-r2v-latest
ชื่อพาธเมธอดอื่น
ใช้พาธเมธอดที่แสดงด้านบน
ID ที่เกี่ยวข้องสำหรับเรียกใช้โมเดล
Ailoot · วิดีโอ POST /v1/videos/generations happyhorse-r2v
happyhorse-r2vhappyhorse-1.1-r2vhappyhorse-r2vhappyhorse-r2v-latest
เริ่มต้น
โมเดลสร้างวิดีโอจากภาพอ้างอิงและบทที่ระบุเป็นข้อความ ช่วยรักษารูปลักษณ์ของตัวละคร วัตถุ และสไตล์ภาพในฉากใหม่
- อินพุตที่รองรับ
- ข้อความ · รูปภาพ
- ผลลัพธ์
- วิดีโอ
ใช้งานได้ใน Ailoot · อินพุตและเมธอด
Ailoot · วิดีโอ POST /v1/videos/generations
- ขาเข้า
text,image- ขาออก
video- รูปแบบเอาต์พุต
- mp4
| ฟิลด์ | ประเภท | ข้อกำหนด | ค่าและข้อจำกัด | ค่าเริ่มต้น |
|---|---|---|---|---|
ฟิลด์model | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด happyhorse-r2v | ค่าเริ่มต้น— |
ฟิลด์prompt | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด ความยาวขั้นต่ำ: 1 | ค่าเริ่มต้น— |
ฟิลด์duration | ประเภทinteger | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขั้นต่ำ: 3 สูงสุด: 15 หน่วย: วินาที | ค่าเริ่มต้น5 |
ฟิลด์resolution | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด 480P, 720P, 1080P | ค่าเริ่มต้น720P |
ฟิลด์ratio | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9 | ค่าเริ่มต้น16:9 |
ฟิลด์image_urls | ประเภทhttps_url|data_image_url[] | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด จำนวนรายการขั้นต่ำ: 1 จำนวนรายการสูงสุด: 9 จำนวนไบต์สูงสุดหลังถอดรหัส: 20,971,520 ประเภท MIME: image/jpeg, image/png, image/webp | ค่าเริ่มต้น— |
ชุดผสมของสื่ออินพุต
reference_images_to_video · จำเป็น: prompt, 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_URLS_FILE:?Set a JSON file containing your actual reference-image URLs}"
export AILOOT_IMAGE_URLS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "happyhorse-r2v", "prompt": "The subject walks slowly toward the camera.", "duration": 5, "resolution": "720P"}')
from urllib.parse import urlsplit
f=Path(os.environ["AILOOT_IMAGE_URLS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual reference URL JSON file")
urls=json.loads(f.read_text())
if not isinstance(urls,list) or not 1<=len(urls)<=9:raise SystemExit("Provide one to nine reference-image URLs")
for u in urls:
z=urlsplit(u) if isinstance(u,str) else None
if not z or z.scheme!="https" or not z.netloc or z.username or z.password:raise SystemExit("Each reference must be an actual HTTPS image URL")
p["image_urls"]=urls
p["ratio"]="16:9"
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-r2v, happyhorse-r2v, happyhorse-r2v-latest
ชื่อพาธเมธอดอื่น
ใช้พาธเมธอดที่แสดงด้านบน
ID ที่เกี่ยวข้องสำหรับเรียกใช้โมเดล
Ailoot · วิดีโอ POST /v1/videos/generations happyhorse-r2v-latest
happyhorse-r2v-latesthappyhorse-1.1-r2vhappyhorse-r2vhappyhorse-r2v-latest
เริ่มต้น
โมเดลสร้างวิดีโอจากภาพอ้างอิงและบทที่ระบุเป็นข้อความ ช่วยรักษารูปลักษณ์ของตัวละคร วัตถุ และสไตล์ภาพในฉากใหม่
- อินพุตที่รองรับ
- ข้อความ · รูปภาพ
- ผลลัพธ์
- วิดีโอ
ใช้งานได้ใน Ailoot · อินพุตและเมธอด
Ailoot · วิดีโอ POST /v1/videos/generations
- ขาเข้า
text,image- ขาออก
video- รูปแบบเอาต์พุต
- mp4
| ฟิลด์ | ประเภท | ข้อกำหนด | ค่าและข้อจำกัด | ค่าเริ่มต้น |
|---|---|---|---|---|
ฟิลด์model | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด happyhorse-r2v-latest | ค่าเริ่มต้น— |
ฟิลด์prompt | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด ความยาวขั้นต่ำ: 1 | ค่าเริ่มต้น— |
ฟิลด์duration | ประเภทinteger | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขั้นต่ำ: 3 สูงสุด: 15 หน่วย: วินาที | ค่าเริ่มต้น5 |
ฟิลด์resolution | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด 480P, 720P, 1080P | ค่าเริ่มต้น720P |
ฟิลด์ratio | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9 | ค่าเริ่มต้น16:9 |
ฟิลด์image_urls | ประเภทhttps_url|data_image_url[] | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด จำนวนรายการขั้นต่ำ: 1 จำนวนรายการสูงสุด: 9 จำนวนไบต์สูงสุดหลังถอดรหัส: 20,971,520 ประเภท MIME: image/jpeg, image/png, image/webp | ค่าเริ่มต้น— |
ชุดผสมของสื่ออินพุต
reference_images_to_video · จำเป็น: prompt, 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_URLS_FILE:?Set a JSON file containing your actual reference-image URLs}"
export AILOOT_IMAGE_URLS_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "happyhorse-r2v-latest", "prompt": "The subject walks slowly toward the camera.", "duration": 5, "resolution": "720P"}')
from urllib.parse import urlsplit
f=Path(os.environ["AILOOT_IMAGE_URLS_FILE"])
if not f.is_file():raise SystemExit("Choose the actual reference URL JSON file")
urls=json.loads(f.read_text())
if not isinstance(urls,list) or not 1<=len(urls)<=9:raise SystemExit("Provide one to nine reference-image URLs")
for u in urls:
z=urlsplit(u) if isinstance(u,str) else None
if not z or z.scheme!="https" or not z.netloc or z.username or z.password:raise SystemExit("Each reference must be an actual HTTPS image URL")
p["image_urls"]=urls
p["ratio"]="16:9"
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-r2v, happyhorse-r2v, happyhorse-r2v-latest
ชื่อพาธเมธอดอื่น
ใช้พาธเมธอดที่แสดงด้านบน
ID ที่เกี่ยวข้องสำหรับเรียกใช้โมเดล
FAQ · happyhorse-1.1-r2v
- มีอินพุตและผลลัพธ์ใดบ้าง?
POST /v1/videos/generations·happyhorse-1.1-r2v:text,image→videoPOST /v1/videos/generations·happyhorse-r2v:text,image→videoPOST /v1/videos/generations·happyhorse-r2v-latest:text,image→video- คำขอใช้ฟิลด์ใดบ้าง?
POST /v1/videos/generations·happyhorse-1.1-r2v:model,prompt,duration,resolution,ratio,image_urlsPOST /v1/videos/generations·happyhorse-r2v:model,prompt,duration,resolution,ratio,image_urlsPOST /v1/videos/generations·happyhorse-r2v-latest:model,prompt,duration,resolution,ratio,image_urls- มีข้อจำกัดใดบ้าง?
POST /v1/videos/generations·happyhorse-1.1-r2v:duration.minimum:3;duration.maximum:15POST /v1/videos/generations·happyhorse-r2v:duration.minimum:3;duration.maximum:15POST /v1/videos/generations·happyhorse-r2v-latest:duration.minimum:3;duration.maximum:15