亚马逊AWS官方博客
正式推出 HAQM Nova Reel 1.1:可生成长达 2 分钟的多镜头视频!
在 2024 年 re:Invent 上,我们宣布推出 HAQM Nova 模型,这是新一代基础模型(FM),其中包括 HAQM Nova Reel,后者是一款视频生成模型,能够根据文本描述以及可选的参考图像(统称为“提示”)来创作短视频。
今天,我们推出 HAQM Nova Reel 1.1。与 HAQM Nova Reel 1.0 相比,该版本在生成 6 秒单镜头视频时的质量和延迟方面都有改进。此次更新使您能够生成长达 2 分钟的多镜头视频,并且所有镜头的风格都保持一致。您可以为一个由 6 秒镜头组成的最长 2 分钟的视频提供单个提示,也可以使用自定义提示分别设计每个镜头。这为您提供了通过 HAQM Bedrock 创建视频内容的新方式。
HAQM Nova Reel 提高了创意生产力,同时借助生成式 AI,帮助减少视频制作所需的时间和成本。您可以使用 HAQM Nova Reel 更高效地为您的营销活动、产品设计和社交媒体内容创建引人入胜的视频,并更好地掌控创意。例如,在广告活动中,您可以使用自然语言制作出视觉风格一致、时间节奏契合的高质量视频广告。
开始使用 HAQM Nova Reel 1.1
如果您是首次使用 HAQM Nova Reel 模型,请前往 HAQM Bedrock 控制台,在导航面板中选择模型访问,并请求访问 HAQM Nova Reel 模型。当您获得对 HAQM Nova Reel 的访问权限时,该权限同时适用于 1.0 和 1.1 版本。
获得访问权限后,您可以直接从 HAQM Bedrock 控制台、AWS SDK 或 AWS 命令行界面(AWS CLI)试用 HAQM Nova Reel 1.1。
要在控制台中测试 HAQM Nova Reel 1.1 模型,请在左侧菜单窗格的 Playgrounds 下选择图像/视频。然后选择 Nova Reel 1.1 作为模型,并输入提示以生成视频。
HAQM Nova Reel 1.1 提供两种模式:
- 多镜头自动模式:在这种模式下,HAQM Nova Reel 1.1 接受多达 4000 个字符的单个提示,并会生成一个反映该提示的多镜头视频。此模式不接受输入图像。
- 多镜头手动模式:对于那些希望更直接控制视频镜头构图的用户,在手动模式(也称为故事板模式)下,您可以为每个单独的镜头指定一个独特的提示。此模式为每个镜头接受一张可选的起始图像。图像的分辨率必须为 1280×720。您可以提供 base64 格式的图像,或者来自 HAQM Simple Storage Service(HAQM S3)位置的图像。
在本演示中,我使用适用于 Python 的 HAQM SDK(Boto3),通过 HAQM Bedrock API 调用该模型,并使用 StartAsyncInvoke 操作来启动异步调用并生成视频。我使用 GetAsyncInvoke 来检查视频生成任务的进度。
这段 Python 脚本使用 MULTI_SHOT_AUTOMATED
模式作为 Nitin Eusebius 创建的文本提示的 TaskType 参数,创建了一个 120 秒的视频:
import random
import time
import boto3
AWS_REGION = "us-east-1"
MODEL_ID = "amazon.nova-reel-v1:1"
SLEEP_SECONDS = 15 # Interval at which to check video gen progress
S3_DESTINATION_BUCKET = "s3://<your bucket here>"
video_prompt_automated = "Norwegian fjord with still water reflecting mountains in perfect symmetry.Uninhabited wilderness of Giant sequoia forest with sunlight filtering between massive trunks.Sahara desert sand dunes with perfect ripple patterns.Alpine lake with crystal clear water and mountain reflection.Ancient redwood tree with detailed bark texture.Arctic ice cave with blue ice walls and ceiling.Bioluminescent plankton on beach shore at night.Bolivian salt flats with perfect sky reflection.Bamboo forest with tall stalks in filtered light.Cherry blossom grove against blue sky.Lavender field with purple rows to horizon.Autumn forest with red and gold leaves.Tropical coral reef with fish and colorful coral.Antelope Canyon with light beams through narrow passages.Banff lake with turquoise water and mountain backdrop.Joshua Tree desert at sunset with silhouetted trees.Iceland moss- covered lava field.HAQM lily pads with perfect symmetry.Hawaiian volcanic landscape with lava rock.New Zealand glowworm cave with blue ceiling lights.8K nature photography, professional landscape lighting, no movement transitions, perfect exposure for each environment, natural color grading"
bedrock_runtime = boto3.client("bedrock-runtime", region_name=AWS_REGION)
model_input = {
"taskType": "MULTI_SHOT_AUTOMATED",
"multiShotAutomatedParams": {"text": video_prompt_automated},
"videoGenerationConfig": {
"durationSeconds": 120, # Must be a multiple of 6 in range [12, 120]
"fps": 24,
"dimension": "1280x720",
"seed": random.randint(0, 2147483648),
},
}
invocation = bedrock_runtime.start_async_invoke(
modelId=MODEL_ID,
modelInput=model_input,
outputDataConfig={"s3OutputDataConfig": {"s3Uri": S3_DESTINATION_BUCKET}},
)
invocation_arn = invocation["invocationArn"]
job_id = invocation_arn.split("/")[-1]
s3_location = f"{S3_DESTINATION_BUCKET}/{job_id}"
print(f"\nMonitoring job folder: {s3_location}")
while True:
response = bedrock_runtime.get_async_invoke(invocationArn=invocation_arn)
status = response["status"]
print(f"Status: {status}")
if status != "InProgress":
break
time.sleep(SLEEP_SECONDS)
if status == "Completed":
print(f"\nVideo is ready at {s3_location}/output.mp4")
else:
print(f"\nVideo generation status: {status}")
第一次调用后,脚本会定期检查状态,直到视频创建完成。每次代码运行时,我都会随机传递种子,以获得不同的结果。
运行脚本:
Status: InProgress
. . .
Status: Completed
Video is ready at s3://<your bucket here>/<job_id>/output.mp4
几分钟后,脚本运行完成并打印出输出的 HAQM S3 位置。我使用 AWS CLI 下载输出视频:
aws s3 cp s3://<your bucket here>/<job_id>/output.mp4 output_automated.mp4
这是该提示生成的视频:
如果 TaskType 参数为 MULTI_SHOT_MANUAL
模式,并且有多个镜头的提示以及每个镜头的描述,那么就无需添加 durationSeconds
变量。
使用由 Sanju Sunny 创建的多个镜头的提示。
运行 Python 脚本:
import random
import time
import boto3
def image_to_base64(image_path: str):
"""
Helper function which converts an image file to a base64 encoded string.
"""
import base64
with open(image_path, "rb") as image_file:
encoded_string = base64.b64encode(image_file.read())
return encoded_string.decode("utf-8")
AWS_REGION = "us-east-1"
MODEL_ID = "amazon.nova-reel-v1:1"
SLEEP_SECONDS = 15 # Interval at which to check video gen progress
S3_DESTINATION_BUCKET = "s3://<your bucket here>"
video_shot_prompts = [
# Example of using an S3 image in a shot.
{
"text": "Epic aerial rise revealing the landscape, dramatic documentary style with dark atmospheric mood",
"image": {
"format": "png",
"source": {
"s3Location": {"uri": "s3://<your bucket here>/images/arctic_1.png"}
},
},
},
# Example of using a locally saved image in a shot
{
"text": "Sweeping drone shot across surface, cracks forming in ice, morning sunlight casting long shadows, documentary style",
"image": {
"format": "png",
"source": {"bytes": image_to_base64("arctic_2.png")},
},
},
{
"text": "Epic aerial shot slowly soaring forward over the glacier's surface, revealing vast ice formations, cinematic drone perspective",
"image": {
"format": "png",
"source": {"bytes": image_to_base64("arctic_3.png")},
},
},
{
"text": "Aerial shot slowly descending from high above, revealing the lone penguin's journey through the stark ice landscape, artic smoke washes over the land, nature documentary styled",
"image": {
"format": "png",
"source": {"bytes": image_to_base64("arctic_4.png")},
},
},
{
"text": "Colossal wide shot of half the glacier face catastrophically collapsing, enormous wall of ice breaking away and crashing into the ocean.Slow motion, camera dramatically pulling back to reveal the massive scale.Monumental waves erupting from impact.",
"image": {
"format": "png",
"source": {"bytes": image_to_base64("arctic_5.png")},
},
},
{
"text": "Slow motion tracking shot moving parallel to the penguin, with snow and mist swirling dramatically in the foreground and background",
"image": {
"format": "png",
"source": {"bytes": image_to_base64("arctic_6.png")},
},
},
{
"text": "High-altitude drone descent over pristine glacier, capturing violent fracture chasing the camera, crystalline patterns shattering in slow motion across mirror-like ice, camera smoothly aligning with surface.",
"image": {
"format": "png",
"source": {"bytes": image_to_base64("arctic_7.png")},
},
},
{
"text": "Epic aerial drone shot slowly pulling back and rising higher, revealing the vast endless ocean surrounding the solitary penguin on the ice float, cinematic reveal",
"image": {
"format": "png",
"source": {"bytes": image_to_base64("arctic_8.png")},
},
},
]
bedrock_runtime = boto3.client("bedrock-runtime", region_name=AWS_REGION)
model_input = {
"taskType": "MULTI_SHOT_MANUAL",
"multiShotManualParams": {"shots": video_shot_prompts},
"videoGenerationConfig": {
"fps": 24,
"dimension": "1280x720",
"seed": random.randint(0, 2147483648),
},
}
invocation = bedrock_runtime.start_async_invoke(
modelId=MODEL_ID,
modelInput=model_input,
outputDataConfig={"s3OutputDataConfig": {"s3Uri": S3_DESTINATION_BUCKET}},
)
invocation_arn = invocation["invocationArn"]
job_id = invocation_arn.split("/")[-1]
s3_location = f"{S3_DESTINATION_BUCKET}/{job_id}"
print(f"\nMonitoring job folder: {s3_location}")
while True:
response = bedrock_runtime.get_async_invoke(invocationArn=invocation_arn)
status = response["status"]
print(f"Status: {status}")
if status != "InProgress":
break
time.sleep(SLEEP_SECONDS)
if status == "Completed":
print(f"\nVideo is ready at {s3_location}/output.mp4")
else:
print(f"\nVideo generation status: {status}")
和之前的演示一样,几分钟后,我使用 AWS CLI 下载输出视频:
aws s3 cp s3://<your bucket here>/<job_id>/output.mp4 output_manual.mp4
这是该提示生成的视频:
更多创意示例
当您使用 HAQM Nova Reel 1.1 时,您将发现一个充满无限创意的世界。以下是一些可帮助您开启创作之旅的示例提示:
prompt = "Explosion of colored powder against black background.Start with slow-motion closeup of single purple powder burst.Dolly out revealing multiple powder clouds in vibrant hues colliding mid-air.Track across spectrum of colors mixing: magenta, yellow, cyan, orange.Zoom in on particles illuminated by sunbeams.Arc shot capturing complete color field.4K, festival celebration, high-contrast lighting"
所有示例视频均由 AWS 视频团队在上传之前手动添加音乐。
注意事项
创意控制:您可以在广告、营销、媒体和娱乐项目中,利用这种增强的控制能力来制作生活方式和环境背景视频。您可以自定义特定元素,如镜头运动和镜头内容,或者对现有图像进行动画处理。
模式注意事项:在自动模式下,您可以编写最多 4000 个字符的提示。对于手动模式,每个镜头接受最多 512 个字符的提示,并且您可以在单个视频中包含最多 20 个镜头。建议您提前规划好镜头,这类似于创建传统的故事板。输入图像必须符合 1280×720 的分辨率要求。该服务会自动将完成的视频发送到您指定的 S3 存储桶中。
定价与可用性:HAQM Nova Reel 1.1 在 AWS 区域美国东部(弗吉尼亚州北部)的 HAQM Bedrock 中可用。您可以通过 HAQM Bedrock 控制台、AWS SDK 或 AWS CLI 访问该模型。与所有 HAQM Bedrock 服务一样,采用即用即付定价模式,根据您的使用情况计费。有关更多信息,请参阅 HAQM Bedrock 定价。
准备好使用 HAQM Nova Reel 开始创作了吗? 访问HAQM Nova Reel AWS 人工智能服务卡了解更多信息,并深入学习使用 HAQM Nova 生成视频的方法。在 HAQM Nova 模型食谱存储库中探索 Python 代码示例,利用 HAQM Nova Reel 提示最佳实践来提升效果,然后在 HAQM Nova Reel 图库中发掘视频示例 — 其中还完整附带了让这些视频得以呈现的提示和参考图像。
这里蕴藏着无限的可能,我们期待看到您的创意成果! 在 community.aws 上加入我们不断壮大的开发者社区,您可以在那里创建 BuilderID,分享您的视频生成项目,并与其他创新者建立联系。
— Eli
*前述特定亚马逊云科技生成式人工智能相关的服务仅在亚马逊云科技海外区域可用,亚马逊云科技中国仅为帮助您了解行业前沿技术和发展海外业务选择推介该服务。