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

Video

wan2.7-r2v API

Sử dụng ID mẫu wan2.7-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 wan2.7-r2v. Trường mô hình phải khớp chính xác với trang này.

Đầu ra mẫuwan2.7-r2vPOST /v1/videos5.0s

Thông số: duration=5resolution=1080Pratio=16:9Hình ảnh tham khảo

Câu lệnh: One continuous take, no cuts. Keep the glass flowers from the reference exactly as they are and carry them into a new place: a wide city crossing at night in the rain. The whole bed of glass blooms now grows straight out of the wet asphalt across the junction, ringing as the rain strikes them, headlights firing caustics along the road. The camera starts at kerb height among the stems, moves forward through them and rises to look down the length of the crossing. One hard pink key from a shopfront on the left, cold blue signals behind. Real weight and inertia, glass and water, 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": "wan2.7-r2v",
"input": {
"prompt": "One continuous take, no cuts. Keep the glass flowers from the reference exactly as they are and carry them into a new place: a wide city crossing at night in the rain. The whole bed of glass blooms now grows straight out of the wet asphalt across the junction, ringing as the rain strikes them, headlights firing caustics along the road. The camera starts at kerb height among the stems, moves forward through them and rises to look down the length of the crossing. One hard pink key from a shopfront on the left, cold blue signals behind. Real weight and inertia, glass and water, no text.",
"media": [
{
"type": "reference_image",
"url": "https://example.com/input-image.png"
}
]
},
"parameters": {
"duration": 5,
"resolution": "1080P",
"ratio": "16:9"
}
}

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": "wan2.7-r2v",
"input": {"prompt": "The subject in Image 1 walks through the street from Video 1.", "media": [{"type": "reference_image", "url": "https://example.com/reference.png"}, {"type": "reference_video", "url": "https://example.com/reference.mp4"}]},
"parameters": {"resolution": "1080P", "ratio": "16:9", "duration": 5, "prompt_extend": false, "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"

Wan thường sử dụng input và parameters; không được trộn lẫn các chế độ hướng dẫn khung và phương tiện tham chiếu.

Wan2.7 R2V sử dụng phương tiện reference_image / reference_video và có thể đính kèm reference_voice. Không kết hợp quy trình công việc này với các vai trò first_frame / last_frame.

Cánh đồng Bắt buộc Ghi chú
model Có wan2.7-r2v
input.prompt Có Mô tả cảnh và phương tiện tham chiếu bằng cú pháp được ghi lại
input.media[] Có Ít nhất một reference_image hoặc reference_video
input.media[].reference_voice Không URL WAV/MP3 công khai cho đặc điểm giọng nói
parameters.resolution Không 720P / 1080P (mặc định 1080P)
parameters.ratio Không 16:9 / 9:16 / 1:1 / 4:3 / 3:4 (bỏ qua khi có first_frame)
parameters.duration Không Sử dụng giới hạn thời lượng ngắn hơn khi có video tham chiếu
parameters.prompt_extend Không Đặt sai khi hợp đồng mô hình chuyên dụng này yêu cầu
parameters.watermark Không Có nên thêm hình mờ hay không
parameters.seed Không Hạt giống ngẫu nhiên tùy chọn

R2V yêu cầu ít nhất một reference_image hoặc reference_video, với tối đa năm hình ảnh/video tham chiếu được kết hợp. Có thể đính kèm một first_frame và một reference_voice; giới hạn thời lượng sẽ ngắn hơn khi có video tham chiếu.

Ví dụ về quy trình làm việc được ghi lại

Phần tiêu đề “Ví dụ về quy trình làm việc được ghi lại”
Terminal windowbash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-r2v",
"input": {"prompt": "让图像主体沿视频动作自然移动", "media": [
{"type": "reference_image", "url": "https://example.com/subject.png"},
{"type": "reference_video", "url": "https://example.com/motion.mp4"}
]},
"parameters": {"resolution": "1080P", "duration": 8, "prompt_extend": false}
}'

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 đủ.

ID mẫu Sự khác biệt
wan2.7-r2v Mô hình được ghi lại trên trang này.
Hợp đồng truyền thông · v1

ID hợp đồng: media.wan2-7-r2v.v1Bộ chuyển đổi: video.wan.r2v.v1@v1Dấu vân tay: 6f91913f171eb3e1e3ee31dbe85b9609d9ddbacc33bb89810a5c580807650414

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
resolutionselect720p / 1080p
durationselect2 / 3 / 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
  • allowed_values · resolution · 720p, 1080p
  • allowed_values · duration · 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  • required_assets · reference_asset_ids
  • max_assets · reference_asset_ids · 6

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

reference

Ý định

{
  "duration": 2,
  "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

{
  "input": {
    "media": [
      {
        "type": "reference_image",
        "url": "https://example.com/reference.png"
      }
    ],
    "prompt": "A red paper kite over a quiet harbour at dusk."
  },
  "model": "wan2.7-r2v",
  "parameters": {
    "duration": 2,
    "resolution": "720P"
  }
}