OpenAI mô tả các mô hình thuộc họ Sora là tận dụng các quy trình khuếch tán video tiềm ẩn với các bộ khử nhiễu dựa trên transformer và điều kiện hóa đa phương thức để tạo ra các khung hình nhất quán theo thời gian và âm thanh được căn chỉnh. Sora 2 tập trung vào việc cải thiện tính vật lý của chuyển động (tuân theo động lượng, lực nổi), các cảnh quay dài hơn và nhất quán, cùng đồng bộ hóa rõ ràng giữa hình ảnh được tạo và lời nói/hiệu ứng âm thanh được tạo. Các tài liệu công khai nhấn mạnh an toàn ở cấp độ mô hình và các cơ chế kiểm duyệt nội dung (chặn cứng đối với một số nội dung bị cấm, ngưỡng nâng cao cho người vị thành niên, và quy trình xin đồng ý đối với hình ảnh/diện mạo).
| Model Name | Tags | Orientation | Resolution | Price |
|---|---|---|---|---|
| sora-2 | videos | Portrait | 720x1280 | $0.08 / sec |
| sora-2 | videos | Landscape | 1280x720 | $0.08 / sec |
| sora-2-all | - | Universal / All | - | $0.08000 |
# Create a video with sora-2
# Step 1: Submit the video generation request
echo "Submitting video generation request..."
response=$(curl -s https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F "model=sora-2" \
-F "prompt=A calico cat playing a piano on stage")
echo "Response: $response"
# Extract video_id from response (handle JSON with spaces like "id": "xxx")
video_id=$(echo "$response" | tr -d '
' | sed 's/.*"id"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/')
echo "Video ID: $video_id"
# Step 2: Poll for progress until 100%
echo ""
echo "Checking video generation progress..."
while true; do
status_response=$(curl -s "https://api.cometapi.com/v1/videos/$video_id" \
-H "Authorization: Bearer $COMETAPI_KEY")
# Parse progress from "progress": "0%" format
progress=$(echo "$status_response" | grep -o '"progress":"[^"]*"' | head -1 | sed 's/"progress":"//;s/"$//')
# Parse status from the outer level
status=$(echo "$status_response" | grep -o '"status":"[^"]*"' | head -1 | sed 's/"status":"//;s/"$//')
echo "Progress: $progress, Status: $status"
if [ "$progress" = "100%" ]; then
echo "Video generation completed!"
break
fi
if [ "$status" = "FAILURE" ] || [ "$status" = "failed" ]; then
echo "Video generation failed!"
echo "$status_response"
exit 1
fi
sleep 10
done
# Step 3: Download the video to output directory
echo ""
echo "Downloading video to ./output/$video_id.mp4..."
mkdir -p ./output
curl -s "https://api.cometapi.com/v1/videos/$video_id/content" \
-H "Authorization: Bearer $COMETAPI_KEY" \
-o "./output/$video_id.mp4"
if [ -f "./output/$video_id.mp4" ]; then
echo "Video saved to ./output/$video_id.mp4"
ls -la "./output/$video_id.mp4"
else
echo "Failed to download video"
exit 1
fi