Bỏ qua để đến nội dung
Mở CastalyBảng điều khiển

Video

happyhorse-1.1-r2v API

Sử dụng ID mẫu happyhorse-1.1-r2v chính xác thông qua định tuyến video không đồng bộ Modelflare.

Sử dụng ID mẫu chính xác happyhorse-1.1-r2v. Trường mô hình phải khớp chính xác với trang này.

Đầu ra mẫuhappyhorse-1.1-r2vPOST /v1/videos5.2s

Thông số: duration=5resolution=1080pratio=16:9Hình ảnh đầu vào

Câu lệnh: One continuous take, no cuts. Keep the woman in the crimson satin coat and the peeling carpet ribbons from the reference and move the event outdoors: she walks out of a revolving door onto a wet plaza and the patterned ribbons keep tearing up behind her, now lifting off the paving stones and streaming out across the square in a long coloured wake. The camera tracks backward ahead of her at waist height and cranes up as the wake spreads. One hard green sign light above the door, warm street lamps across the plaza. Real weight and inertia, satin and wet stone, no text.

Yêu cầu tạo ra mẫu này với URL phương tiện đầu vào được thay thế
{
"model": "happyhorse-1.1-r2v",
"prompt": "One continuous take, no cuts. Keep the woman in the crimson satin coat and the peeling carpet ribbons from the reference and move the event outdoors: she walks out of a revolving door onto a wet plaza and the patterned ribbons keep tearing up behind her, now lifting off the paving stones and streaming out across the square in a long coloured wake. The camera tracks backward ahead of her at waist height and cranes up as the wake spreads. One hard green sign light above the door, warm street lamps across the plaza. Real weight and inertia, satin and wet stone, no text.",
"seconds": "5",
"duration": 5,
"resolution": "1080p",
"ratio": "16:9",
"aspect_ratio": "16:9",
"image": "https://example.com/input-image.png"
}

Sử dụng khóa API Modelflare với https://modelflare.dev/v1. Điểm vào cổng là POST /v1/videos.

HTTP
Authorization: Bearer YOUR_MODELFLARE_API_KEY
Terminal windowbash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "happyhorse-1.1-r2v",
"input": {"prompt": "The person in [Image 1] picks up [Image 2].", "media": [{"type": "reference_image", "url": "https://example.com/person.jpg"}, {"type": "reference_image", "url": "https://example.com/object.jpg"}]},
"parameters": {"resolution": "1080P", "ratio": "16:9", "duration": 5, "watermark": false}
}'

Lưu ID nhiệm vụ. Thăm dò GET /v1/videos/{task_id} và tải xuống với GET /v1/videos/{task_id}/content. URL kết quả có thể hết hạn, vì vậy hãy chuyển tệp ngay.

Terminal windowbash
curl https://modelflare.dev/v1/videos/TASK_ID \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"

HappyHorse sử dụng input.prompt; chọn hình dạng input.media khớp với ID kiểu máy t2v, i2v hoặc r2v.

HappyHorse R2V đặt 1–9 mục reference_image trong input.media và tham chiếu chúng theo thứ tự từ lời nhắc.

Cánh đồng Bắt buộc Ghi chú
model Có happyhorse-1.1-r2v
input.prompt Có Mô tả văn bản hoặc hướng dẫn tham khảo, tối đa 5.000 ký tự không phải tiếng Trung hoặc 2.500 ký tự tiếng Trung
input.media[] Có 1–9 reference_image mục; URL công khai hoặc Base64, dưới 20 MB, cạnh ngắn tối thiểu 400px
parameters.resolution Không 720P / 1080P, mặc định 1080P
parameters.ratio Không 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 4:5 / 5:4 / 9:21 / 21:9, mặc định 16:9
parameters.duration Không 3–15 giây, mặc định 5
parameters.watermark Không Có nên thêm hình mờ HappyHorse hay không
parameters.seed Không Seed tùy chọn từ 0 đến 2.147.483.647

R2V sử dụng 1–9 mục reference_image và đề cập đến chúng theo thứ tự nhắc nhở là Hình ảnh 1, Hình ảnh 2, v.v. Lời nhắc được giới hạn ở 5.000 ký tự không phải tiếng Trung hoặc 2.500 ký tự tiếng Trung; hình ảnh có kích thước dưới 20 MB với cạnh ngắn tối thiểu 400px.

Tham số mô hình không hợp lệ trả về 4xx cùng với ID yêu cầu. Tác vụ không đồng bộ cũng có thể bị lỗi sau khi quá trình tạo thành công; sử dụng error_code và error_message từ phản hồi thăm dò làm lý do nhiệm vụ cuối cùng. Đừng thử lại cùng một yêu cầu với hình dạng JSON khác.

Trang này bao gồm các cuộc gọi chỉnh sửa và tạo mô hình Modelflare. Tính năng làm giàu bản đồ hoặc tìm kiếm, quản lý giọng nói và quản lý thư viện thành phần là các API tài nguyên nằm ngoài bề mặt lệnh gọi mô hình công khai này và không phải là các trường yêu cầu bắt buộc.

Mô hình này sử dụng tính phí video theo giây. Xem trang định giá mẫu để biết giá khách hàng hiện tại, giá niêm yết tham khảo và thông số kỹ thuật đầy đủ.

Hợp đồng truyền thông · v1

ID hợp đồng: media.happyhorse-1-1-r2v.v1Bộ chuyển đổi: video.happyhorse.v1@v1Dấu vân tay: 080ba09723851efe1ae578055ceca7299f987e1fe2602d9e554e47a8431ec35a

Nguồn chính thức: Alibaba Cloud Model Studio

Thông số hợp đồng

Trường ý địnhĐiều khiểnTùy chọn
ratioselect16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 4:5 / 5:4 / 21:9 / 9:21
resolutionselect720p / 1080p
durationselect3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15

Khả năng được hỗ trợ

  • allowed_values · ratio · 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 21:9, 9:21
  • allowed_values · resolution · 720p, 1080p
  • allowed_values · duration · 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  • required_assets · reference_asset_ids
  • max_assets · reference_asset_ids · 9

Ví dụ về yêu cầu có cấu trúc

reference

Ý định

{
  "duration": 3,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "16:9",
  "reference_asset_ids": [
    "asset_example"
  ],
  "resolution": "720p"
}

Yêu cầu của nhà cung cấp

{
  "duration": 3,
  "image": "https://example.com/reference.png",
  "model": "happyhorse-1.1-r2v",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "16:9",
  "resolution": "720p",
  "seconds": "3"
}