当前位置: 首页 > news >正文

集团网站cms安阳seo

集团网站cms,安阳seo,wordpress获取tag地址,扬中富裕吗【视频生成大模型】 视频生成大模型 THUDM/CogVideoX-2b CogVideoX-2b 模型介绍发布时间模型测试生成的demo视频生成视频限制 运行环境安装运行模型下载开源协议参考 CogVideoX-2b 模型介绍 CogVideoX是 清影 同源的开源版本视频生成模型。 基础信息: 发布时间 2…

【视频生成大模型】 视频生成大模型 THUDM/CogVideoX-2b

  • CogVideoX-2b 模型介绍
    • 发布时间
    • 模型测试生成的demo视频
    • 生成视频限制
  • 运行环境安装
  • 运行模型
  • 下载
  • 开源协议
  • 参考

CogVideoX-2b 模型介绍

CogVideoX是 清影 同源的开源版本视频生成模型。

基础信息:

在这里插入图片描述

发布时间

2024年8月份

模型测试生成的demo视频

https://github.com/THUDM/CogVideo/raw/main/resources/videos/1.mp4

https://github.com/THUDM/CogVideo/raw/main/resources/videos/2.mp4

生成视频限制

  • 提示词语言 English*
  • 提示词长度上限 226 Tokens
  • 视频长度 6 秒
  • 帧率 8 帧 / 秒
  • 视频分辨率 720 * 480,不支持其他分辨率(含微调)

运行环境安装

# 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_videoprompt = "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("THUDM/CogVideoX-2b",torch_dtype=torch.float16
)pipe.enable_model_cpu_offload()
pipe.enable_sequential_cpu_offload()
pipe.vae.enable_slicing()
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)
  • Quantized Inference

PytorchAO 和 Optimum-quanto 可以用于对文本编码器、Transformer 和 VAE 模块进行量化,从而降低 CogVideoX 的内存需求。这使得在免费的 T4 Colab 或较小 VRAM 的 GPU 上运行该模型成为可能!值得注意的是,TorchAO 量化与 torch.compile 完全兼容,这可以显著加快推理速度。

# To get started, PytorchAO needs to be installed from the GitHub source and PyTorch Nightly.
# Source and nightly installation is only required until next release.import torch
from diffusers import AutoencoderKLCogVideoX, CogVideoXTransformer3DModel, CogVideoXPipeline
from diffusers.utils import export_to_video
from transformers import T5EncoderModel
from torchao.quantization import quantize_, int8_weight_only, int8_dynamic_activation_int8_weightquantization = int8_weight_onlytext_encoder = T5EncoderModel.from_pretrained("THUDM/CogVideoX-2b", subfolder="text_encoder", torch_dtype=torch.bfloat16)
quantize_(text_encoder, quantization())transformer = CogVideoXTransformer3DModel.from_pretrained("THUDM/CogVideoX-5b", subfolder="transformer", torch_dtype=torch.bfloat16)
quantize_(transformer, quantization())vae = AutoencoderKLCogVideoX.from_pretrained("THUDM/CogVideoX-2b", subfolder="vae", torch_dtype=torch.bfloat16)
quantize_(vae, quantization())# Create pipeline and run inference
pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-2b",text_encoder=text_encoder,transformer=transformer,vae=vae,torch_dtype=torch.bfloat16,
)
pipe.enable_model_cpu_offload()
pipe.vae.enable_tiling()# prompt 只能输入英文
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."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)

下载

model_id: THUDM/CogVideoX-2b
下载地址:https://hf-mirror.com/THUDM/CogVideoX-2b 不需要翻墙

开源协议

License: apache-2.0

参考

  • https://hf-mirror.com/THUDM/CogVideoX-2b
  • https://github.com/THUDM/CogVideo
http://www.hkea.cn/news/924354/

相关文章:

  • 百度网站站长环球网疫情最新
  • 颍上做网站西安seo网站关键词优化
  • 有没有兼职做设计的网站吗知名网络软文推广平台
  • 数据百度做网站好用吗米拓建站
  • 网站维护运营怎么做搜索引擎优化通常要注意的问题有
  • 圆梦科技专业网站建设恶意点击软件有哪些
  • 如何做vip电影解析网站竞价恶意点击器
  • 开发简单小程序公司深圳网站优化哪家好
  • 网站开发劣势搜索引擎排名优化
  • 桂林网站优化公司企业网络营销顾问
  • 上海外贸出口代理公司排名搜索引擎优化的主要工作有
  • 一般做企业网站需要什么资料广告咨询
  • 广州网站建设兼职网站为什么要做seo
  • 中企动力官网 网站怎么在平台上做推广
  • 教育培训网站建设方案广告宣传费用一般多少
  • 计算机网站设计论文营销排名seo
  • 源码资源国内专业seo公司
  • 丽水微信网站建设报价免费精准客源
  • 广东建设工程中标公示网站google搜索引擎优化
  • 南宁老牌网站建设公司正版google下载
  • 网站做信用认证有必要吗微信朋友圈推广平台
  • 电子政务网站建设要求百度关键词规划师
  • 博客网站开发毕设免费大数据分析网站
  • 深圳教育平台网站建设好消息疫情要结束了
  • 国外设计文章的网站淘宝代运营靠谱吗
  • 市桥网站建设sem论坛
  • 猎头公司是做什么的可靠吗排名优化外包公司
  • 扶贫网站建设关键词查询神器
  • 沈阳酒店企业网站制作公司2023年9月疫情又开始了吗
  • 厦门专业网站建设如何快速推广一个新产品