Back to Promptfoo

amazon-bedrock/video (AWS Bedrock Video Generation)

examples/amazon-bedrock/video/README.md

0.121.93.7 KB
Original Source

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

ModelConfigRegionDuration
Amazon Nova Reelpromptfooconfig.nova-reel.yamlus-east-16s - 2min
Luma Ray 2promptfooconfig.luma-ray.yamlus-west-2 only5s or 9s

Prerequisites

Video generation requires additional AWS setup beyond standard Bedrock access.

1. Enable Model Access

Visit the AWS Bedrock Model Access page 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