File size: 4,283 Bytes
b81ba0a d0ffe9c b81ba0a d0ffe9c b81ba0a d0ffe9c b81ba0a d0ffe9c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
---
title: Vid2Vid-using-Text-prompt
app_file: app.py
sdk: gradio
sdk_version: 3.35.2
---
# Video2Video Generation using Text Prompts
This repository contains a pipeline for video-to-video generation using text prompts. The system leverages AnimateDiff and OpenPose ControlNet for pose estimation, and incorporates a prompt traveling method for improved coherence between the original and generated videos. Users can interact with this pipeline through a Gradio app or a standard Python program.
## Techniques used
- **AnimateDiff**: Utilized for generating high-quality animations based on text prompts and an image as an input.
- **OpenPose ControlNet**: Used for accurate pose estimation to guide the animation process.
- **Prompt Traveling Method**: Ensures better relativeness and coherence between the input video and the generated output.
- **User Interfaces**:
- **Gradio App**: An intuitive web-based interface for easy interaction.
- **Python Program**: A script-based interface for users preferring command-line interaction.
### Base models
- [XXMix_9realistic](https://civitai.com/models/47274): Model used for generating life-like video (Recommended for life-like video)
- [Mistoon_Anime](https://civitai.com/models/24149/mistoonanime): Model used for generating anime-like video (Recommended for anime-like video)
### Motion modules
- [mm_sd_v15_v2](https://huggingface.co/guoyww/animatediff/blob/main/mm_sd_v15_v2.ckpt): Motion module used for generating segments of the final from the generated images (Recommended)
- [mm_sd_v15](https://huggingface.co/guoyww/animatediff/blob/main/mm_sd_v15.ckpt) and [mm_sd_v14](https://huggingface.co/guoyww/animatediff/blob/main/mm_sd_v14.ckpt) are some other modules that can be also used.
### ControlNets
- [control_v11p_sd15_openpose](https://huggingface.co/lllyasviel/ControlNet-v1-1/blob/main/control_v11p_sd15_openpose.pth): ControlNet for pose estimation from the given video
- Upcoming support for depth and canny controlnets too for better generated video quality.
### Prompt Travelling
This is a technique that is used to give the model, instruction at which frame what to do with the output image.
For example, if in the prompt body it is written like, 30 - face: up, camera: zoomed out, right-hand: waving, then in the output 30th frame, the image will be generated according to the given prompt.
## Installation
To set up the environment and install the necessary dependencies, follow these steps:
1. **Clone the repository:**
```bash
git clone https://github.com/TheNetherWatcher/Vid2Vid-using-Text-prompt.git
cd Vid2Vid-using-Text-prompt
```
2. **Create and activate a virtual environment:**
```bash
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
```
3. **Install the required packages:**
```bash
pip install -e .
pip install -e .[stylize]
```
## Usage
### Model weights
- Download the model weights from the abve links or another, and put them [here](./data/models/huggingface), and for the downloaded motion modules, put them [here](data/models/motion-module)
- For the first time, you might get errors like model weights not found, just go to stylize directory and in the most recently created folder, edit the model name in the prompt.json file. Support for this is also under development.
### Gradio App
To run the Gradio app, execute the following command:
```bash
python app.py
```
The gradio app provides a interface for uploading video and providing a text prompt as a input and outputs the generated video.
### Commandline
```bash
python test.py
```
After running this, you will be prompted to enter the location of the video, positive prompt (the changes that you want to make in the video), and a negative prompt.
Negative prompt is set to a default value, but you can edit it if you like.
## Upcoming Dedvelopments
- LoRA support, and controlnet(like canny, depth, edge) support
- Gradio app support for using different controlnets and LoRAs
- CLI options for controlling the execution in different system
## Credits
- [AnimateDiff](https://github.com/guoyww/AnimateDiff)
- [Prompt Travelling using AnimateDiff](https://github.com/s9roll7/animatediff-cli-prompt-travel)
|