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

wordpress主题开发编辑器上海企业seo

wordpress主题开发编辑器,上海企业seo,大朗网站建设,轻量应用服务器可以做网站吗【视频生成大模型】 视频生成大模型 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.dinnco.com/news/69211.html

相关文章:

  • 网站建设的作用是什么快速提升关键词排名软件
  • 织梦的官方网站seo百度发包工具
  • 兰州高端网站建设外贸seo站
  • 手机端网站开发流程搜索指数分析
  • 做网站建设的怎么拓展业务网站运营及推广方案
  • 杭州网页设计工作室排名优化关键词公司
  • 怎么做网站投放广告俄罗斯网络攻击数量增长了80%
  • 新网站建设seo综合查询平台官网
  • 网站到期怎么办产品软文范例800字
  • 跨境电商怎么入行seo是指
  • 怎样做投资与理财网站搜索关键词排名推广
  • 培训机构是什么意思北京官方seo搜索引擎优化推荐
  • 网站怎么做qq微信登陆seo需要会什么
  • 如何用ps设计网站首页seo具体优化流程
  • 绍兴高端网站开发百度学术官网首页
  • 网站怎么做404页面的跳转网站排名优化软件哪家好
  • 网站静态化投放广告找什么平台
  • 做网站的诈骗8000块钱犯法吗产品市场推广方案
  • 114黄页网推广网站排名优化公司哪家好
  • 网站开发都需要什么工具新手如何自己做网站
  • 只做网站不做app今日足球最新预测比分
  • 株洲网站seo优化价格促销策略的四种方式
  • 做电脑网站用什么软件有哪些北京关键词优化平台
  • ae做的动效怎么放在网站上知乎软文推广
  • 申请一个免费的网站空间百度网盘下载电脑版官方下载
  • 范湖网站建设团队天津seo推广软件
  • 垂直型b2c网站广州网站设计实力乐云seo
  • 外国人做家具的网站购物网站如何推广
  • java怎么实现网站开发百度关键词首页排名
  • 著名设计师网站百度seo排名优化提高流量