Chuyển đến nội dung chính
POST
cURL
Dùng aleph2 để chỉnh sửa video nguồn bằng Prompt văn bản. Yêu cầu trả về một tác vụ id; truy xuất thông tin chi tiết của tác vụ để lấy đầu ra hoàn tất.

Chuẩn bị yêu cầu

  • Xác thực bằng API key CometAPI của bạn.
  • Đặt model thành aleph2 và cung cấp videoUri cho video dài tối đa 30 giây.
  • Tùy chọn: thêm promptText để mô tả nội dung chỉnh sửa, với độ dài từ 1 đến 1.000 ký tự. Bạn cũng có thể bỏ qua tham số này khi sử dụng keyframe.
  • Thay URL phương tiện mẫu bằng URL HTTPS có thể truy cập. Các trường phương tiện cũng chấp nhận URI dữ liệu Base64 có kích thước mã hóa tối đa 5 MB.

Thêm hình ảnh hướng dẫn theo thời điểm

Để hướng dẫn các thời điểm cụ thể, hãy cung cấp từ một đến năm đối tượng trong keyframes. Mỗi đối tượng chứa một uri hình ảnh và chính xác một vị trí: Dấu thời gian keyframe phải nằm trong cửa sổ chỉnh sửa của nó. Nếu bạn dùng range, hãy đặt tham số này trên mọi keyframe. Nếu không, hãy bỏ range khỏi mọi keyframe. Bỏ keyframes khi không cần hình ảnh hướng dẫn. Mảng trống hoặc null được coi như bỏ qua.

Chọn hình dạng và định dạng khung hình

Dùng targetAspectRatio để yêu cầu mở rộng thành 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, hoặc 21:9. Video đầu vào và hình ảnh hướng dẫn được thêm viền đen để phù hợp với hình dạng này trước khi tạo. Trường ratio đã ngừng hỗ trợ là tùy chọn; dùng targetAspectRatio để kiểm soát tỷ lệ khung hình. Nếu outputFormat là prores, bạn có thể đặt proresProfile thành 422, 4444, 422 Proxy, 422 LT, 422 HQ, hoặc 4444 XQ. Profile mặc định là 4444. Kênh alpha trong 4444 và 4444 XQ là đục. Bỏ proresProfile đối với các định dạng đầu ra khác. Để đặt seed lấy mẫu cụ thể, dùng 1 đến 4294967295. Bỏ seed để dùng seed ngẫu nhiên; 0 được coi như bỏ qua.

Truy xuất kết quả

Lưu id được trả về và dùng Lấy tác vụ Runway để truy xuất trạng thái tác vụ. Khi status là SUCCEEDED, đọc các URL kết quả từ output. Nếu tác vụ thất bại, hãy kiểm tra failure và failureCode nếu có.

Ủy quyền

Authorization
string
header
bắt buộc

Your CometAPI API key.

Nội dung

application/json

Aleph 2 video-editing request.

model
enum<string>
bắt buộc

Model ID for this request.

Tùy chọn có sẵn:
aleph2
videoUri
bắt buộc

Input video to edit, with a maximum duration of 30 seconds. Use an accessible HTTPS URL or a Base64 data URI with an encoded size of up to 5 MB.

Required string length: 13 - 2048
Pattern: ^https://
promptText
string

Optional instruction describing the edit, from 1 to 1,000 characters. Can be omitted when using keyframes.

Required string length: 1 - 1000
keyframes
object[] | null

One to five timed guidance images. Each image uses exactly one of seconds or at. Omit when no guidance images are needed; an empty array or null is treated as omission.

Maximum array length: 5

Guidance image positioned using seconds.

targetAspectRatio
enum<string>

Target aspect ratio for expansion. The input video and keyframes are letterboxed to this shape before generation.

Tùy chọn có sẵn:
16:9,
4:3,
3:2,
1:1,
2:3,
3:4,
9:16,
21:9
ratio
string
không còn sử dụng

Deprecated aspect-ratio field. Use targetAspectRatio instead.

seed
integer

Sampling seed. Omit for a random seed; 0 is treated as omission.

Phạm vi bắt buộc: 0 <= x <= 4294967295
outputFormat
enum<string>
bắt buộc if proresProfile is set

Output format: mp4 for H.264 MP4, prores for ProRes MOV, png_sequence for a ZIP of PNG frames, or sdr_rec709_10bit for 10-bit Rec.709 HEVC MP4. Omit for mp4.

Tùy chọn có sẵn:
mp4,
prores,
png_sequence,
sdr_rec709_10bit
proresProfile
enum<string>

ProRes profile. Include only with outputFormat set to prores; omit for 4444. The 4444 and 4444 XQ profiles have an opaque alpha channel.

Tùy chọn có sẵn:
422,
4444,
422 Proxy,
422 LT,
422 HQ,
4444 XQ
contentModeration
object

Content moderation settings. Omit to use the standard settings.

Phản hồi

The task was created. Save its id for task retrieval.

id
string
bắt buộc

Task ID for GET /runwayml/v1/tasks/{id}.

status
string

Task state, when returned.

createdAt
string<date-time>

Task submission timestamp, when returned.

output
string<uri>[]

Result URLs, when returned.

failure
string

Failure explanation, when returned.

failureCode
string

Machine-readable failure code, when returned.

estimatedCost
object

Task estimate metadata, when returned.

cost
object

Task cost metadata, when returned.

Lần sửa đổi cuối 22 tháng 9, 2026