国产开源Sora,视频生成CogVideoX再开源!更大尺寸,更高质量!

简介: CogVideoX 又双叒叕开源啦!这次开源了更大尺寸!看看和之前有什么区别吧?

CogVideoX 又双叒叕开源啦!这次开源了更大尺寸,相比之前开源的CogVideoX-2B,CogVideoX-5B是视频生成质量更高,视觉效果更好的更大尺寸模型。


模型链接:

https://modelscope.cn/models/ZhipuAI/CogVideoX-5b


话不多说,先来看一波效果。

作品案例:

prompt:In a dimly lit bar, purplish light bathes the face of a mature man, his eyes blinking thoughtfully as he ponders in close-up, the background artfully blurred to focus on his introspective expression, the ambiance of the bar a mere suggestion of shadows and soft lighting.

prompt:A Chinese mother, draped in a soft, pastel-colored robe, gently rocks back and forth in a cozy rocking chair positioned in the tranquil setting of a nursery. The dimly lit bedroom is adorned with whimsical mobiles dangling from the ceiling, casting shadows that dance on the walls. Her baby, swaddled in a delicate, patterned blanket, rests against her chest, the child's earlier cries now replaced by contented coos as the mother's soothing voice lulls the little one to sleep. The scent of lavender fills the air, adding to the serene atmosphere, while a warm, orange glow from a nearby nightlight illuminates the scene with a gentle hue, capturing a moment of tender love and comfort.

prompt:On a brilliant sunny day, the lakeshore is lined with an array of willow trees, their slender branches swaying gently in the soft breeze. The tranquil surface of the lake reflects the clear blue sky, while several elegant swans glide gracefully

prompt:A golden retriever, sporting sleek black sunglasses, with its lengthy fur flowing in the breeze, sprints playfully across a rooftop terrace, recently refreshed by a light rain. The scene unfolds from a distance, the dog's energetic bounds growing larger as it approaches the camera, its tail wagging with unrestrained joy, while droplets of water glisten on the concrete behind it. The overcast sky provides a dramatic backdrop, emphasizing the vibrant golden coat of the canine as it dashes towards the viewer.

prompt: An elderly gentleman, with a serene expression, sits at the water's edge, a steaming cup of tea by his side. He is engrossed in his artwork, brush in hand, as he renders an oil painting on a canvas that's propped up against a small, weathered table. The sea breeze whispers through his silver hair, gently billowing his loose-fitting white shirt, while the salty air adds an intangible element to his masterpiece in progress. The scene is one of tranquility and inspiration, with the artist's canvas capturing the vibrant hues of the setting sun reflecting off the tranquil sea.

prompt:A suited astronaut, with the red dust of Mars clinging to their boots, reaches out to shake hands with an alien being, their skin a shimmering blue, under the pink-tinged sky of the fourth planet. In the background, a sleek silver rocket, a beacon of human ingenuity, stands tall, its engines powered down, as the two representatives of different worlds exchange a historic greeting amidst the desolate beauty of the Martian landscape.

prompt: A small boy, head bowed and determination etched on his face, sprints through the torrential downpour as lightning crackles and thunder rumbles in the distance. The relentless rain pounds the ground, creating a chaotic dance of water droplets that mirror the dramatic sky's anger. In the far background, the silhouette of a cozy home beckons, a faint beacon of safety and warmth amidst the fierce weather. The scene is one of perseverance and the unyielding spirit of a child braving the elements.

prompt: A garden comes to life as a kaleidoscope of butterflies flutters amidst the blossoms, their delicate wings casting shadows on the petals below. In the background, a grand fountain cascades water with a gentle splendor, its rhythmic sound providing a soothing backdrop. Beneath the cool shade of a mature tree, a solitary wooden chair invites solitude and reflection, its smooth surface worn by the touch of countless visitors seeking a moment of tranquility in nature's embrace.

模型介绍

论文链接:https://arxiv.org/pdf/2408.06072

CogVideoX是一个大规模DiT(diffusion transformer)模型,用于文本生成视频任务。CogVideoX主要采用了以下技术:

  • 3D causal VAE:通过压缩视频数据到latent space,并在时间维度上进行解码来实现高效的视频重建。
  • 专家Transformer:将文本embedding和视频embedding相结合,使用3D-RoPE作为位置编码,采用专家自适应层归一化处理两个模态的数据,以及使用3D 全注意力机制来进行时空联合建模。

通过采用渐进式训练技术,CogVideoX能够根据文本提示生成具有显著运动特征、连贯且长时间的高质量视频。相关论文为《CogVideoX: Text-to-Video Diffusion Models withAn Expert Transformer》。

下表展示目前CogVideoX视频生成模型列表,以及相关基础信息。

模型体验

智谱搭建了CogVideoX-5B模型的体验空间,同时搭建了一套视频生成体验pipeline

1、prompt增强

体验页面使用 GLM-4(https://github.com/THUDM/GLM-4) 扩写提示词,扩写提示词模块会先识别语言,将中文翻译成英文,然后将简短的提示词扩写成更加详细的描述,来提升视频生成的精细度和稳定性。

sys_prompt = """You are part of a team of bots that creates videos. You work with an assistant bot that will draw anything you say in square brackets.
For example , outputting " a beautiful morning in the woods with the sun peaking through the trees " will trigger your partner bot to output an video of a forest morning , as described. You will be prompted by people looking to create detailed , amazing videos. The way to accomplish this is to take their short prompts and make them extremely detailed and descriptive.
There are a few rules to follow:
When user inputs Chinese, you will first translated into English video description.
You will only ever output a single video description per user request.
When modifications are requested , you should not simply make the description longer . You should refactor the entire description to integrate the suggestions.
Other times the user will not want modifications , but instead want a new image . In this case , you should ignore your previous conversation with the user.
Video descriptions must have the same num of words as examples below. Extra words will be ignored.
"""

2、视频生成

在魔搭社区免费算力可完成CogVideoX-5B模型bf16精度的推理。

CogVideoX-5B已经支持使用 diffusers 推理,可以按照以下步骤进行推理。

环境依赖

# diffusers>=0.30.1
# transformers>=0.44.0
# accelerate>=0.33.0 (suggest install from source)
# imageio-ffmpeg>=0.5.1
pip install --upgrade transformers accelerate diffusers imageio-ffmpeg

运行代码

import torch
from diffusers import CogVideoXPipeline
from diffusers.utils import export_to_video
from modelscope import snapshot_download
model_dir = snapshot_download("ZhipuAI/CogVideoX-5b")
prompt = "A panda, dressed in a small, red jacket and a tiny hat, sits on a wooden stool in a serene bamboo forest. The panda's fluffy paws strum a miniature acoustic guitar, producing soft, melodic tunes. Nearby, a few other pandas gather, watching curiously and some clapping in rhythm. Sunlight filters through the tall bamboo, casting a gentle glow on the scene. The panda's face is expressive, showing concentration and joy as it plays. The background includes a small, flowing stream and vibrant green foliage, enhancing the peaceful and magical atmosphere of this unique musical performance."
pipe = CogVideoXPipeline.from_pretrained(
    model_dir,
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()
pipe.vae.enable_tiling()
video = pipe(
    prompt=prompt,
    num_videos_per_prompt=1,
    num_inference_steps=50,
    num_frames=49,
    guidance_scale=6,
    generator=torch.Generator(device="cuda").manual_seed(42),
).frames[0]
export_to_video(video, "output.mp4", fps=8)

显存占用约为19G:

3、超分和插帧

使用 RIFEhttps://github.com/hzwer/ECCV2022-RIFE 模型来插帧,使用 Real-ESRGANhttps://github.com/xinntao/Real-ESRGAN 模型来做超分(Super-Resolution)。注意:运动幅度较大时,插帧有时会影响视频效果。

超分+插帧后的视频


点击链接👇即可跳转体验demo~

https://www.modelscope.cn/studios/ZhipuAI/CogVideoX-5b-demo?from=alizishequ__text

相关文章
|
6月前
|
机器学习/深度学习 vr&ar 决策智能
创新性3D数据合成模型,微软推出EgoGen
【2月更文挑战第6天】创新性3D数据合成模型,微软推出EgoGen
59 2
创新性3D数据合成模型,微软推出EgoGen
|
3月前
|
人工智能 搜索推荐 UED
还没排上SearchGPT?比Perplexity更好用的国产开源平替了解一下?
【8月更文挑战第24天】近日发布的一项研究成果提出了一种革新性的信息检索系统——MindSearch,该系统通过模仿人脑思维方式,有效解决了传统信息检索方法面对复杂查询时的不足。MindSearch利用多代理框架,将用户查询拆解成子问题逐步扩展查询图谱,实现复杂查询的精准定位;通过多层次信息检索,整合不同网页中的相关数据,提高信息提取的准确率;并且能高效处理大规模网页,3分钟内即可检索300多个网页。实验显示,MindSearch不仅提升了响应的深度与广度,还在封闭及开放式问答中表现出色,更符合用户的偏好。不过,MindSearch仍面临查询意图理解、噪音处理及可扩展性等方面的挑战。
41 4
|
4月前
|
人工智能 自然语言处理 自动驾驶
AI大模型的战场:通用与垂直的较量
AI大模型的战场:通用与垂直的较量
205 0
|
6月前
|
机器学习/深度学习 人工智能 自然语言处理
英伟达开源大模型对齐框架—NeMo-Aligner
【5月更文挑战第25天】英伟达开源NeMo-Aligner,一个针对大型语言模型对齐的工具包,支持RLHF、DPO等前沿技术,实现高效训练和扩展。基于Megatron-LM,利用3D并行训练和分布式PPO优化处理大规模模型。采用Apache 2.0许可,鼓励社区参与和创新。然而,硬件需求和技术门槛仍是应用挑战。[链接](https://arxiv.org/abs/2405.01481v1)
123 5
|
6月前
|
人工智能 安全 算法
【平衡点:解锁中国大模型开源闭源的新时代】关于大模型是否开源的分析
本文探讨了开源与闭源软件在大模型技术发展中的角色,深入比较了两者在质量、安全、产业化、适应性和可靠性等方面的优缺点。开源软件得益于全球开发者社区,通常在创新和适应性上表现出色,但安全性和质量可能因分散的开发而有所波动。闭源软件则在代码质量和安全性上有一定优势,但可能限制了产业的协作与创新。 在商业模式方面,开源通常依赖服务和支持盈利,闭源则通过软件授权和订阅服务获利。开源模式的市场竞争更激烈,闭源模式则更注重市场份额和控制。企业需要根据自身情况选择合适的战略,有些可能会采用
227 1
|
6月前
|
数据采集 人工智能 自然语言处理
谷歌DeepMind发布Gecko:专攻检索,与大7倍模型相抗衡
【4月更文挑战第12天】谷歌DeepMind的Gecko模型以小巧身形(256维)展现出媲美大型语言模型的检索性能,且在MTEB基准测试中超越768维模型。采用两步蒸馏法训练,适用于多任务及硬件环境,尤其在多语言处理上表现出色。尽管训练成本高、泛化能力待优化,但其创新为文本嵌入技术带来新可能。
109 7
谷歌DeepMind发布Gecko:专攻检索,与大7倍模型相抗衡
|
6月前
|
数据采集 人工智能 自然语言处理
中科院国产多语言大模型-YAYI2开源!家族AI应用场景全覆盖!
中科院国产多语言大模型-YAYI2开源!家族AI应用场景全覆盖!
|
6月前
|
机器学习/深度学习 人工智能 算法
开源vs闭源大模型如何塑造技术的未来?开源模型的优劣势&未来发展方向
开源vs闭源大模型如何塑造技术的未来?开源模型的优劣势&未来发展方向
1302 0
|
机器学习/深度学习 人工智能 安全
更强的Llama 2开源,可直接商用:一夜之间,大模型格局变了
更强的Llama 2开源,可直接商用:一夜之间,大模型格局变了
273 1
|
人工智能 计算机视觉
【AI欣赏】将火影忍者推向新高度:StableDiffusion的神奇效果
【AI欣赏】将火影忍者推向新高度:StableDiffusion的神奇效果