<img src="./lumiere.png" width="450px"></img>
Lumiere - Pytorch
Implementation of <a href="https://lumiere-video.github.io/">Lumiere</a>, SOTA text-to-video generation from Google Deepmind, in Pytorch
<a href="https://www.youtube.com/watch?v=Pl8BET_K1mc">Yannic's paper review</a>
Since this paper is mostly just a few key ideas on top of text-to-image model, will take it a step further and extend the new <a href="https://github.com/lucidrains/denoising-diffusion-pytorch/blob/main/denoising_diffusion_pytorch/karras_unet.py">Karras U-net</a> to video within this repository.
Appreciation
- <a href="https://a16z.com/supporting-the-open-source-ai-community/">A16Z Open Source AI Grant Program</a> and <a href="https://huggingface.co/">🤗 Huggingface</a> for the generous sponsorships, as well as my other sponsors, for affording me the independence to open source current artificial intelligence research
Install
$ pip install lumiere-pytorch
Usage
import torch
from lumiere_pytorch import MPLumiere
from denoising_diffusion_pytorch import KarrasUnet
karras_unet = KarrasUnet(
image_size = 256,
dim = 8,
channels = 3,
dim_max = 768,
)
lumiere = MPLumiere(
karras_unet,
image_size = 256,
unet_time_kwarg = 'time',
conv_module_names = [
'downs.1',
'ups.1',
'downs.2',
'ups.2',
],
attn_module_names = [
'mids.0'
],
upsample_module_names = [
'ups.2',
'ups.1',
],
downsample_module_names = [
'downs.1',
'downs.2'
]
)
noised_video = torch.randn(2, 3, 8, 256, 256)
time = torch.ones(2,)
denoised_video = lumiere(noised_video, time = time)
assert noised_video.shape == denoised_video.shape
Todo
-
[x] add all temporal layers
- [x] researcher must pass in all layers for
- [x] conv inflation modules (stages)
- [x] attn inflation modules (middle)
- [x] temporal downsample
- [x] temporal upsamples
- [x] validate time dimension is 2 ** downsample layers
- [x] researcher must pass in all layers for