text to video model

提供商Deepak1206
分类text-to-video
许可证apache-2.0
下载量20
星标0

简介

这是一个基于 Apache-2.0 协议的开源文本生成视频模型。它旨在将简单的文字描述转化为动态视频片段,适合开发者在自己的应用中集成视频生成能力,或 AI 爱好者尝试低成本的短视频创作。相比于闭源的商业大模型,该模型提供了更高的定制自由度。对于习惯使用 Runway 或 Pika 的用户来说,这款模型提供了一个可本地化部署或二次开发的选择,上手难度中等,核心在于通过精准的提示词(Prompt)来控制画面的动态效果。

核心亮点

  • 开源协议友好,支持商业化二次开发
  • 将文本指令快速转化为动态视频画面
  • 适合集成至短视频创作或自动化工作流
  • 提供比商业闭源模型更高的定制灵活性

使用方法

安装依赖
# 安装 Hugging Face transformers
pip install transformers torch
SDK 使用
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("Deepak1206/text-to-video-model")
tokenizer = AutoTokenizer.from_pretrained("Deepak1206/text-to-video-model")

Hugging Face 下载

我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 huggingface_hub:

操作指引
pip install -U huggingface_hub

命令行下载

下载完整模型库

下载完整模型库
huggingface-cli download Deepak1206/text-to-video-model

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download Deepak1206/text-to-video-model config.json --local-dir ./dir

更多命令行下载选项,可参见官方文档

SDK 下载

SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('Deepak1206/text-to-video-model')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://huggingface.co/Deepak1206/text-to-video-model

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Deepak1206/text-to-video-model

模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。

PyTorch / Transformers 使用

安装 Transformers

安装 Transformers
pip install -U transformers torch

模型加载和推理

模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('Deepak1206/text-to-video-model')
tokenizer = AutoTokenizer.from_pretrained('Deepak1206/text-to-video-model')

完整文档

来源: HuggingFace

---
language:

  • en

license: apache-2.0
library_name: diffusers
pipeline_tag: text-to-video
tags:
  • text-to-video

  • video-generation

  • generative-ai

  • diffusion

  • pytorch

  • transformers

  • diffusers

---

🎬 Text-to-Video Generation Model

A text-to-video generation project that converts natural language
prompts into short AI-generated videos using a diffusion-based
text-to-video model.

📌 Overview

This project demonstrates text-to-video generation using a
pretrained diffusion model from the Hugging Face ecosystem.

The system takes a textual description as input and generates
a sequence of video frames, which are combined into an MP4 video.

Pipeline

Text Prompt

Text Encoder

Diffusion Model

Video Frames

MP4 Video

---

✨ Features

  • Text-to-video generation
  • Natural language prompts
  • Diffusion-based video generation
  • GPU acceleration with CUDA
  • MP4 video export
  • Compatible with Hugging Face Diffusers
  • Can be executed using Google Colab

---

🤖 Model Information

Base Model

damo-vilab/text-to-video-ms-1.7b

Model Architecture

Diffusion-based text-to-video generation model.

Framework

  • PyTorch
  • Hugging Face Diffusers
  • Hugging Face Transformers
  • Accelerate

---

🚀 Usage

Install the required libraries:

```bash
pip install diffusers transformers accelerate torch imageio imageio-ffmpeg