Files
wehub-resource-sync 0d3cb498a3
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:24:08 +08:00

136 lines
3.7 KiB
Markdown

# amazon-bedrock/video (AWS Bedrock Video Generation)
You can run this example with:
```bash
npx promptfoo@latest init --example amazon-bedrock/video
cd amazon-bedrock/video
```
Video generation examples using AWS Bedrock's async invoke API.
## Available Models
| Model | Config | Region | Duration |
| ---------------- | -------------------------------- | -------------- | --------- |
| Amazon Nova Reel | `promptfooconfig.nova-reel.yaml` | us-east-1 | 6s - 2min |
| Luma Ray 2 | `promptfooconfig.luma-ray.yaml` | us-west-2 only | 5s or 9s |
## Prerequisites
Video generation requires additional AWS setup beyond standard Bedrock access.
### 1. Enable Model Access
Visit the [AWS Bedrock Model Access page](https://console.aws.amazon.com/bedrock/home#/modelaccess) and enable:
- **Nova Reel**: `amazon.nova-reel-v1:1` (us-east-1)
- **Luma Ray 2**: `luma.ray-v2:0` (us-west-2)
### 2. Create S3 Bucket
Video outputs are written to S3. Create a bucket in the same region as your model:
```bash
# For Nova Reel (us-east-1)
aws s3 mb s3://your-bucket-nova-reel --region us-east-1
# For Luma Ray 2 (us-west-2)
aws s3 mb s3://your-bucket-luma-ray --region us-west-2
```
### 3. Configure IAM Permissions
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["bedrock:InvokeModel", "bedrock:StartAsyncInvoke", "bedrock:GetAsyncInvoke"],
"Resource": [
"arn:aws:bedrock:*:*:model/amazon.nova-reel-v1:1",
"arn:aws:bedrock:*:*:model/luma.ray-v2:0"
]
},
{
"Effect": "Allow",
"Action": ["s3:PutObject", "s3:GetObject"],
"Resource": "arn:aws:s3:::your-bucket/*"
}
]
}
```
### 4. Install Dependencies
```bash
npm install @aws-sdk/client-bedrock-runtime @aws-sdk/client-s3
```
## Usage
Update `s3OutputUri` in the config file, then run:
```bash
# Nova Reel
npx promptfoo@latest eval -c promptfooconfig.nova-reel.yaml
# Luma Ray 2
npx promptfoo@latest eval -c promptfooconfig.luma-ray.yaml
```
## Model Comparison
### Amazon Nova Reel
- **Best for**: Longer videos, multi-shot narratives
- **Resolution**: 1280x720 @ 24 FPS
- **Duration**: 6 seconds (single shot) or 12-120 seconds (multi-shot)
- **Features**: TEXT_VIDEO, MULTI_SHOT_AUTOMATED, MULTI_SHOT_MANUAL modes
- **Typical generation time**: ~90 seconds for 6s video
### Luma Ray 2
- **Best for**: High-quality short clips, image-to-video
- **Resolution**: 540p or 720p
- **Aspect ratios**: 1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 9:21
- **Duration**: 5 or 9 seconds
- **Features**: Start/end frame keyframes, loop mode
- **Typical generation time**: ~2-3 minutes
## Configuration Options
### Nova Reel
```yaml
config:
region: us-east-1
s3OutputUri: s3://your-bucket/outputs/
durationSeconds: 6 # 6 for single, 12-120 for multi-shot
taskType: TEXT_VIDEO # or MULTI_SHOT_AUTOMATED, MULTI_SHOT_MANUAL
seed: 12345 # Optional, for reproducibility
image: file://./start-frame.jpg # Optional, for image-to-video
```
### Luma Ray 2
```yaml
config:
region: us-west-2
s3OutputUri: s3://your-bucket/outputs/
duration: '5s' # or '9s'
resolution: '720p' # or '540p'
aspectRatio: '16:9'
loop: false
startImage: file://./start.jpg # Optional
endImage: file://./end.jpg # Optional
```
## Resources
- [AWS Bedrock Video Generation](https://docs.aws.amazon.com/bedrock/latest/userguide/video-generation.html)
- [Nova Reel Documentation](https://docs.aws.amazon.com/nova/latest/userguide/video-generation.html)
- [Luma Ray Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-luma.html)
- [promptfoo AWS Bedrock Provider](https://promptfoo.dev/docs/providers/aws-bedrock)