Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/HVision-NKU/StoryDiffusion
Accepted as [NeurIPS 2024] Spotlight Presentation Paper
https://github.com/HVision-NKU/StoryDiffusion
Last synced: about 1 month ago
JSON representation
Accepted as [NeurIPS 2024] Spotlight Presentation Paper
- Host: GitHub
- URL: https://github.com/HVision-NKU/StoryDiffusion
- Owner: HVision-NKU
- License: apache-2.0
- Created: 2024-04-21T10:54:22.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-26T02:17:52.000Z (3 months ago)
- Last Synced: 2024-10-29T15:09:56.578Z (about 1 month ago)
- Language: Jupyter Notebook
- Homepage:
- Size: 22.2 MB
- Stars: 5,906
- Watchers: 86
- Forks: 593
- Open Issues: 115
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-diffusion-categorized - [Code
- ai-game-devtools - StoryDiffusion - Attention for Long-Range Image and Video Generation. |[arXiv](https://arxiv.org/abs/2405.01434) | | Video | (<span id="video">Video</span> / <span id="tool">Tool (AI LLM)</span>)
- AiTreasureBox - HVision-NKU/StoryDiffusion - 12-07_6013_0](https://img.shields.io/github/stars/HVision-NKU/StoryDiffusion.svg)|Create Magic Story!| (Repos)
README
## StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation [![Paper page](https://huggingface.co/datasets/huggingface/badges/resolve/main/paper-page-md-dark.svg)]()[[Paper](https://arxiv.org/abs/2405.01434)] β [[Project Page](https://storydiffusion.github.io/)] β [[Jittor Version](https://github.com/JittorCV/jittordiffusion/tree/master)]β [[π€ Comic Generation Demo ](https://huggingface.co/spaces/YupengZhou/StoryDiffusion)] [![Replicate](https://replicate.com/cjwbw/StoryDiffusion/badge)](https://replicate.com/cjwbw/StoryDiffusion) [![Run Comics Demo in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/HVision-NKU/StoryDiffusion/blob/main/Comic_Generation.ipynb)
---
Official implementation of **[StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation]()**.
### **Demo Video**
https://github.com/HVision-NKU/StoryDiffusion/assets/49511209/d5b80f8f-09b0-48cd-8b10-daff46d422af
### Update History
***You can visit [here](update.md) to visit update history.***
### π **Key Features:**
StoryDiffusion can create a magic story by generating consistent images and videos. Our work mainly has two parts:
1. Consistent self-attention for character-consistent image generation over long-range sequences. It is hot-pluggable and compatible with all SD1.5 and SDXL-based image diffusion models. For the current implementation, the user needs to provide at least 3 text prompts for the consistent self-attention module. We recommend at least 5 - 6 text prompts for better layout arrangement.
2. Motion predictor for long-range video generation, which predicts motion between Condition Images in a compressed image semantic space, achieving larger motion prediction.## π₯ **Examples**
### Comics generation
![1](https://github.com/HVision-NKU/StoryDiffusion/assets/49511209/b3771cbc-b6ca-4e26-bdc5-d944daf9f266)
### Image-to-Video generation οΌResults are HIGHLY compressed for speedοΌ
Leveraging the images produced through our Consistent Self-Attention mechanism, we can extend the process to create videos by seamlessly transitioning between these images. This can be considered as a two-stage long video generation approach.Note: results are **highly compressed** for speed, you can visit [our website](https://storydiffusion.github.io/) for the high-quality version.
#### Two-stage Long Videos Generation (New Update)
Combining the two parts, we can generate very long and high-quality AIGC videos.
| Video1 | Video2 | Video3 |
| --- | --- | --- |
| | | |#### Long Video Results using Condition Images
Our Image-to-Video model can generate a video by providing a sequence of user-input condition images.
| Video1 | Video2 | Video3 |
| --- | --- | --- |
| | | || Video4 | Video5 | Video6 |
| --- | --- | --- |
| | | |#### Short Videos
| Video1 | Video2 | Video3 |
| --- | --- | --- |
| | | || Video4 | Video5 | Video6 |
| --- | --- | --- |
| | | |## π© **TODO/Updates**
- [x] Comic Results of StoryDiffusion.
- [x] Video Results of StoryDiffusion.
- [x] Source code of Comic Generation
- [x] Source code of gradio demo
- [ ] Source code of Video Generation Model
- [ ] Pretrained weight of Video Generation Model
---# π§ Dependencies and Installation
- Python >= 3.8 (Recommend to use [Anaconda](https://www.anaconda.com/download/#linux) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html))
- [PyTorch >= 2.0.0](https://pytorch.org/)
```bash
conda create --name storydiffusion python=3.10
conda activate storydiffusion
pip install -U pip# Install requirements
pip install -r requirements.txt
```
# How to useCurrently, we provide two ways for you to generate comics.
## Use the jupyter notebook
You can open the `Comic_Generation.ipynb` and run the code.
## Start a local gradio demo
Run the following command:**(Recommend)** We provide a low GPU Memory cost version, it was tested on a machine with 24GB GPU-memory(Tesla A10) and 30GB RAM, and expected to work well with >20 G GPU-memory.
```python
python gradio_app_sdxl_specific_id_low_vram.py
```## Contact
If you have any questions, you are very welcome to email [email protected] and [email protected]
# Disclaimer
This project strives to impact the domain of AI-driven image and video generation positively. Users are granted the freedom to create images and videos using this tool, but they are expected to comply with local laws and utilize it responsibly. The developers do not assume any responsibility for potential misuse by users.# Related Resources
Following are some third-party implementations of StoryDiffusion.## API
- [runpod.io serverless worker](https://github.com/bes-dev/story-diffusion-runpod-serverless-worker) provided by [BeS](https://github.com/bes-dev).
- [Replicate worker](https://github.com/camenduru/StoryDiffusion-replicate) provided by [camenduru](https://github.com/camenduru).# BibTeX
If you find StoryDiffusion useful for your research and applications, please cite using this BibTeX:```BibTeX
@article{zhou2024storydiffusion,
title={StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation},
author={Zhou, Yupeng and Zhou, Daquan and Cheng, Ming-Ming and Feng, Jiashi and Hou, Qibin},
journal={NeurIPS 2024},
year={2024}
}