omerbt / TokenFlow

Official Pytorch Implementation for "TokenFlow: Consistent Diffusion Features for Consistent Video Editing" presenting "TokenFlow" (ICLR 2024)
https://diffusion-tokenflow.github.io
MIT License
1.52k stars 134 forks source link

Requirements? #7

Open Natotela opened 11 months ago

Natotela commented 11 months ago

This looks so promising, I just don't wanna promise myself something I won't be able to afford :-}

drimeF0 commented 10 months ago

like regular stable diffusion

Natotela commented 10 months ago

DL'd miniconda, created env, installed reqs, got some errors that some packages are missing, installed each missing item, then got stuck with: \.conda\envs\tokenflow\lib\site-packages\torchvision\io\video.py:161: UserWarning: The pts_unit 'pts' gives wrong results. Please use pts_unit 'sec'. warnings.warn("The pts_unit 'pts' gives wrong results. Please use pts_unit 'sec'.") [INFO] loading stable diffusion... Traceback (most recent call last): File "F:\Progz\TokenFlow\preprocess.py", line 354, in <module> prep(opt) File "F:\Progz\TokenFlow\preprocess.py", line 315, in prep model = Preprocess(device, opt) File "F:\Progz\TokenFlow\preprocess.py", line 51, in __init__ self.vae = AutoencoderKL.from_pretrained(model_key, subfolder="vae", revision="fp16", File "\.conda\envs\tokenflow\lib\site-packages\torch\nn\modules\module.py", line 1145, in to return self._apply(convert) File "\.conda\envs\tokenflow\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply module._apply(fn) File "\.conda\envs\tokenflow\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply module._apply(fn) File "\.conda\envs\tokenflow\lib\site-packages\torch\nn\modules\module.py", line 820, in _apply param_applied = fn(param) File "\.conda\envs\tokenflow\lib\site-packages\torch\nn\modules\module.py", line 1143, in convert return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) File "\.conda\envs\tokenflow\lib\site-packages\torch\cuda\__init__.py", line 239, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled

Though I have CUDA and PyTorch installed

Natotela commented 10 months ago

None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used. Traceback (most recent call last): File "F:\Progz\TokenFlow\preprocess.py", line 2, in <module> from diffusers import AutoencoderKL, UNet2DConditionModel, DDIMScheduler File "\.conda\envs\tokenflow\lib\site-packages\diffusers\__init__.py", line 3, in <module> from .configuration_utils import ConfigMixin File "\.conda\envs\tokenflow\lib\site-packages\diffusers\configuration_utils.py", line 34, in <module> from .utils import ( File "\.conda\envs\tokenflow\lib\site-packages\diffusers\utils\__init__.py", line 21, in <module> from .accelerate_utils import apply_forward_hook File "\.conda\envs\tokenflow\lib\site-packages\diffusers\utils\accelerate_utils.py", line 24, in <module> import accelerate File "\.conda\envs\tokenflow\lib\site-packages\accelerate\__init__.py", line 3, in <module> from .accelerator import Accelerator File "\.conda\envs\tokenflow\lib\site-packages\accelerate\accelerator.py", line 32, in <module> import torch ModuleNotFoundError: No module named 'torch'

although: pip show torch

Name: torch
Version: 2.0.1
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: .conda\envs\tokenflow\lib\site-packages
Requires: filelock, jinja2, networkx, sympy, typing-extensions
Required-by: accelerate, kornia, torchaudio, torchvision, xformers
Natotela commented 10 months ago

after creating conda env, also had to

pip install opencv-python diffusers transformers
conda install av -c conda-forge

and possibly pip install accelerate as well

szriru commented 10 months ago

nah, I think this needs freaking big VRAM. I tried a video which is 1024x576, 30fps, 100frames, and it said it needs 50GB VRAM lmao

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 13.73 GiB (GPU 0; 23.99 GiB total capacity; 22.73 GiB already allocated; 0 bytes free; 27.96 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF