国产开源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

相关文章
|
29天前
|
机器学习/深度学习 人工智能 文字识别
POINTS 1.5:腾讯微信开源的多模态大模型,超越了业界其他的开源视觉语言模型,具备强大的视觉和语言处理能力
POINTS 1.5是腾讯微信推出的多模态大模型,基于LLaVA架构,具备强大的视觉和语言处理能力。它在复杂场景的OCR、推理能力、关键信息提取等方面表现出色,是全球10B以下开源模型中的佼佼者。
174 58
POINTS 1.5:腾讯微信开源的多模态大模型,超越了业界其他的开源视觉语言模型,具备强大的视觉和语言处理能力
|
1月前
|
人工智能 编解码 搜索推荐
国产最强语音大模型诞生,MaskGCT宣布开源,声音效果媲美人类
MaskGCT是一种由国内团队开发的新型非自回归文本到语音合成模型,采用两阶段模型设计和掩码预测学习范式,无需显式对齐信息及音素级别持续时间预测,能高效生成高质量语音,达到近似人类水平。其开源发布标志着国产语音大模型技术的重大突破,具有广泛的应用前景和重要的科研价值。
83 13
|
机器学习/深度学习 人工智能 自然语言处理
性能超越Llama2-13B,可免费商用,姚星创业公司开源百亿参数通用大模型
性能超越Llama2-13B,可免费商用,姚星创业公司开源百亿参数通用大模型
506 0
|
8月前
|
人工智能 自然语言处理 API
【活动】开源与闭源大模型:探索未来趋势的双轨道路
在人工智能领域,大模型(Large Language Models, LLMs)凭借其强大的语言理解和生成能力,正逐步成为推动技术革新和社会进步的关键力量。随着GPT-3、BERT、Turing-NLG等知名模型的面世,大模型的开放与封闭策略也成为行业内外热议的话题。本文旨在探讨开源与闭源大模型各自的优劣,并基于当前技术发展、市场趋势及社会需求,分析两者在未来的发展前景。
115 2
|
5月前
|
人工智能 Swift 决策智能
社区供稿 | 面向多样应用需求,书生·浦语2.5开源超轻量、高性能多种参数版本
在 2024 年 7 月 4 日的 WAIC 科学前沿主论坛上,上海人工智能实验室推出了书生·浦语系列模型的全新版本——InternLM2.5。
|
7月前
|
数据采集 机器学习/深度学习 人工智能
可信度超越GPT-4V,清华&面壁揭秘小钢炮模型背后的高效对齐技术
【6月更文挑战第15天】清华大学与面壁智能合作的RLAIF-V框架挑战GPT-4V,通过开源AI反馈增强大语言模型的可信度。该框架利用开放数据和在线学习优化对齐,减少幻觉错误,12B参数模型表现超越GPT-4V。虽有数据质量和稳定性问题,但展示出开源MLLMs潜力。[链接: https://arxiv.org/abs/2405.17220]
141 1
|
8月前
|
人工智能 安全 算法
【平衡点:解锁中国大模型开源闭源的新时代】关于大模型是否开源的分析
本文探讨了开源与闭源软件在大模型技术发展中的角色,深入比较了两者在质量、安全、产业化、适应性和可靠性等方面的优缺点。开源软件得益于全球开发者社区,通常在创新和适应性上表现出色,但安全性和质量可能因分散的开发而有所波动。闭源软件则在代码质量和安全性上有一定优势,但可能限制了产业的协作与创新。 在商业模式方面,开源通常依赖服务和支持盈利,闭源则通过软件授权和订阅服务获利。开源模式的市场竞争更激烈,闭源模式则更注重市场份额和控制。企业需要根据自身情况选择合适的战略,有些可能会采用
258 1
|
8月前
|
测试技术
华人团队推出视频扩展模型MOTIA
华人团队推出视频扩展模型MOTIA,通过智能算法扩展视频内容,适应不同设备和场景。该模型分为输入特定适应和模式感知扩展两阶段,有效保持视频帧内帧间一致性,提升扩展质量。在DAVIS和YouTube-VOS基准上超越现有先进方法,且无需大量任务调整,降低创作者的时间成本。然而,源视频信息不足或模式不明显时,MOTIA性能受限,且对计算资源要求较高。
143 2
华人团队推出视频扩展模型MOTIA
|
8月前
|
人工智能 搜索推荐 vr&ar
开源单图生成3D模型TripoSR的未来发展方向
【2月更文挑战第27天】开源单图生成3D模型TripoSR的未来发展方向
156 2
开源单图生成3D模型TripoSR的未来发展方向
|
8月前
|
人工智能 自然语言处理
浙大联合微软等提出全新视频编辑统一框架UniEdit
【2月更文挑战第13天】浙大联合微软等提出全新视频编辑统一框架UniEdit
70 2
浙大联合微软等提出全新视频编辑统一框架UniEdit