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

Video

wan2.7-i2v API

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

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

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

Câu lệnh: One continuous take, no cuts. The ribbon of film keeps unwinding and speeds up until every frame is lit, tightening into a neon helix that lifts off the deck and climbs past the parapet into the dusk sky, the woman in the cobalt coat turning to follow it up. The camera starts low behind her, is pushed back as the helix rises, then cranes up over the parapet and looks along the coil toward the city. One hard magenta key stays raking across the deck. Real weight and inertia, paper and emulsion catching the light, 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-i2v",
"prompt": "One continuous take, no cuts. The ribbon of film keeps unwinding and speeds up until every frame is lit, tightening into a neon helix that lifts off the deck and climbs past the parapet into the dusk sky, the woman in the cobalt coat turning to follow it up. The camera starts low behind her, is pushed back as the helix rises, then cranes up over the parapet and looks along the coil toward the city. One hard magenta key stays raking across the deck. Real weight and inertia, paper and emulsion catching the light, 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": "wan2.7-i2v",
"input": {"prompt": "The camera moves closer as the lanterns begin to glow in time with the music.", "media": [{"type": "first_frame", "url": "https://example.com/first-frame.png"}]},
"parameters": {"resolution": "1080P", "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 I2V sử dụng input.prompt và input.media. Thực hiện theo các kết hợp được ghi lại trong tài liệu cho khung hình đầu tiên/cuối cùng, âm thanh điều khiển và clip đầu tiên.

Cánh đồng Bắt buộc Ghi chú
model Có wan2.7-i2v
input.prompt Có Mô tả chuyển động và cảnh
input.media[] Có first_frame, last_frame, driving_audio hoặc first_clip
parameters.resolution Không 720P / 1080P (mặc định 1080P)
parameters.duration Không Tổng thời lượng; bao gồm clip đầu vào để tiếp tục
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

Phương tiện I2V phải tuân theo sự kết hợp được hỗ trợ như first_frame, first_frame + last_frame, first_frame + driving_audio hoặc first_clip với khung kết thúc tùy chọn được ghi lại. Mỗi loại phương tiện xuất hiện nhiều nhất một lần; đầu ra là 720P hoặc 1080P.

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-i2v",
"input": {"prompt": "镜头从第一帧推进到最后一帧", "media": [
{"type": "first_frame", "url": "https://example.com/first.png"},
{"type": "last_frame", "url": "https://example.com/last.png"}
]},
"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-i2v 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-i2v.v1Bộ chuyển đổi: video.wan.i2v.v1@v1Dấu vân tay: f88d7c8cb3fd7273312b35a66e10fc485ceaa6e2848487aa73b4819fff587413

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
resolutionselect720p / 1080p
durationselect2 / 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15

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

  • 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 · 3
  • prompt_optional_with_reference · prompt

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.",
  "reference_asset_ids": [
    "asset_example"
  ],
  "resolution": "720p"
}

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

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