作者 | ZeR0
编辑 | 漠影
智东西8月6日报道,好消息,智谱AI的视频生成模型CogVideoX-2B,昨晚正式开源了。
模型已上架GitHub、Hugging Face,FP16精度下的推理仅需18GB显存,微调则只需要40GB,单张4090显卡可推理,单张A6000可微调。
CogVideoX-2B的提示词上限为226个token,视频长度为6秒,帧率为8帧/秒,视频分辨率为720 * 480。
CogVideoX系列开源模型与智谱AI的商业版视频生成模型“清影”同源。2B版本首发后,性能更强、参数量更大的开源模型将在后续上架。
代码仓库:https://github.com/THUDM/CogVideo
模型下载:https://huggingface.co/THUDM/CogVideoX-2b
技术报告:https://github.com/THUDM/CogVideo/blob/main/resources/CogVideoX.pdf
根据论文,CogVideoX在雷达图中比其他几个视频生成模型更大,属性值趋近六边形。
为了评估文生视频的质量,智谱AI使用了VBench中的多个指标,如人类动作、场景、动态程度等;还使用了两个额外的视频评估工具:Devil中的Dynamic Quality和Chrono-Magic中的GPT4o-MT Score,这些工具专注于视频的动态特性。从下表可见,CogVideoX在多个指标的得分领先。
在人类盲评中,CogVideoX在五个指标的得分均超过了快手可灵。
GitHub页面展示了几个由CogVideoX-2B生成的视频作品:
▲提示词:A detailed wooden toy ship with intricately carved masts and sails is seen gliding smoothly over a plush, blue carpet that mimics the waves of the sea. The ship’s hull is painted a rich brown, with tiny windows. The carpet, soft and textured, provides a perfect backdrop, resembling an oceanic expanse. Surrounding the ship are various other toys and children’s items, hinting at a playful environment. The scene captures the innocence and imagination of childhood, with the toy ship’s journey symbolizing endless adventures in a whimsical, indoor setting.
▲提示词:The camera follows behind a white vintage SUV with a black roof rack as it speeds up a steep dirt road surrounded by pine trees on a steep mountain slope, dust kicks up from its tires, the sunlight shines on the SUV as it speeds along the dirt road, casting a warm glow over the scene. The dirt road curves gently into the distance, with no other cars or vehicles in sight. The trees on either side of the road are redwoods, with patches of greenery scattered throughout. The car is seen from the rear following the curve with ease, making it seem as if it is on a rugged drive through the rugged terrain. The dirt road itself is surrounded by steep hills and mountains, with a clear blue sky above with wispy clouds.
▲提示词:A street artist, clad in a worn-out denim jacket and a colorful bandana, stands before a vast concrete wall in the heart, holding a can of spray paint, spray-painting a colorful bird on a mottled wall.
▲提示词:In the haunting backdrop of a war-torn city, where ruins and crumbled walls tell a story of devastation, a poignant close-up frames a young girl. Her face is smudged with ash, a silent testament to the chaos around her. Her eyes glistening with a mix of sorrow and resilience, capturing the raw emotion of a world that has lost its innocence to the ravages of conflict.
CogVideoX采用3D VAE和专家Transformer架构来生成连贯长视频,通过自研视频理解模型构建了一个具有文本描述的相对高质量的视频片段集合。
视频数据因包含空间和时间信息,其数据量和计算负担远超图像数据。智谱AI提出了基于3D变分自编码器(3D VAE)的视频压缩方法,通过三维卷积同时压缩视频的空间和时间维度,实现了更高的压缩率和更好的重建质量。
▲CogVideoX里的3D VAE架构
模型结构包括编码器、解码器、潜在空间正则化器,通过四个阶段的下采样和上采样实现压缩。时间因果卷积确保了信息的因果性,减少了通信开销,上下文并行技术能更好适应大规模视频处理。
实验中,智谱AI发现大分辨率编码易于泛化,增加帧数则挑战较大,因此模型训练分两个阶段:先在较低帧率和小批量上训练,后通过上下文并行在更高帧率上微调。训练损失函数结合了L2损失、LPIPS感知损失和3D判别器的GAN损失。
智谱AI使用VAE的编码器将视频压缩至潜在空间,然后将潜在空间分割成块并展开成长的序列嵌入z_vision,同时使用T5,将文本输入编码为文本嵌入z_text,再将z_text和z_vision沿序列维度拼接,拼接后的嵌入被送入专家Transformer块堆栈中处理,最后反向拼接嵌入来恢复原始潜在空间形状,并使用VAE进行解码以重建视频。
▲CogVideoX架构
训练数据方面,智谱AI开发了负面标签来识别和排除低质量视频,通过video-llama训练的过滤器标注并筛选了20000个视频数据样本;同时,计算光流和美学分数,动态调整阈值,确保生成视频的质量。
针对缺乏视频字幕数据的问题,智谱AI提出了一种从图像字幕生成视频字幕的管道,并微调端到端的视频字幕模型以获得更密集的字幕。这种方法通过Panda70M模型生成简短字幕,用CogView3模型生成密集图像字幕,然后用GPT-4模型总结生成最终的短视频。
该团队还微调了一个基于CogVLM2-Video和Llama 3的CogVLM2-Caption模型,使用密集字幕数据进行训练,以加速视频字幕生成过程。
▲密集字幕数据生成流程
智谱AI团队仍在努力完善CogVideoX捕捉复杂动态的能力,探究新型模型架构、更高效地压缩视频信息、更充分地融合文本和视频内容,以持续探索视频生成模型的scaling law,旨在训练出更大更强的模型,来生成更长、更高质量的视频。
如今视频生成模型及应用正变得越来越多,技术也逐渐成熟,但此前还没有一个开源的视频生成模型能够满足商业级应用的要求。我们期待更多视频生成模型走向开源,推动更多开发者及企业参与开发视频生成模型及应用,并为围绕视频生成的各种技术优化和功能开发做贡献。
“特别声明:以上作品内容(包括在内的视频、图片或音频)为凤凰网旗下自媒体平台“大风号”用户上传并发布,本平台仅提供信息存储空间服务。
Notice: The content above (including the videos, pictures and audios if any) is uploaded and posted by the user of Dafeng Hao, which is a social media platform and merely provides information storage space services.”