Spaces:
Running
Running
refactor
Browse files- poetry.lock +0 -0
- pyproject.toml +0 -20
- requirements.txt +48 -0
- setup.py +23 -0
- xora/__init__.py +1 -0
- eval.py β xora/examples/text_to_video.py +5 -5
- xora/models/__init__.py +0 -0
- xora/models/autoencoders/__init__.py +0 -0
- {vae/layers β xora/models/autoencoders}/causal_conv3d.py +0 -0
- {vae β xora/models}/autoencoders/causal_video_autoencoder.py +3 -3
- {vae/layers β xora/models/autoencoders}/conv_nd_factory.py +2 -2
- {vae/layers β xora/models/autoencoders}/dual_conv3d.py +0 -0
- {vae/layers β xora/models/autoencoders}/pixel_norm.py +0 -0
- {vae β xora/models/autoencoders}/vae.py +1 -1
- {vae β xora/models/autoencoders}/vae_encode.py +1 -1
- xora/models/transformers/__init__.py +0 -0
- {transformer β xora/models/transformers}/attention.py +0 -0
- patchify/symmetric.py β xora/models/transformers/symmetric_patchifier.py +1 -1
- {transformer β xora/models/transformers}/transformer3d.py +1 -1
- xora/pipelines/__init__.py +0 -0
- {pipeline β xora/pipelines}/pipeline_video_pixart_alpha.py +5 -5
- xora/schedulers/__init__.py +0 -0
- {scheduler β xora/schedulers}/rf.py +1 -1
- xora/utils/__init__.py +0 -0
- {utils β xora/utils}/torch_utils.py +0 -0
poetry.lock
DELETED
The diff for this file is too large to render.
See raw diff
|
|
pyproject.toml
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
[tool.poetry]
|
2 |
-
name = "xora-core"
|
3 |
-
version = "0.1.0"
|
4 |
-
description = ""
|
5 |
-
authors = ["Your Name <you@example.com>"]
|
6 |
-
readme = "README.md"
|
7 |
-
|
8 |
-
[tool.poetry.dependencies]
|
9 |
-
python = "^3.10"
|
10 |
-
torch = "2.3.0"
|
11 |
-
diffusers = "0.28.2"
|
12 |
-
einops = "0.6.1"
|
13 |
-
transformers = "4.44.2"
|
14 |
-
sentencepiece = "^0.2.0"
|
15 |
-
accelerate = "^0.34.2"
|
16 |
-
|
17 |
-
|
18 |
-
[build-system]
|
19 |
-
requires = ["poetry-core"]
|
20 |
-
build-backend = "poetry.core.masonry.api"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
accelerate==0.34.2 ; python_version >= "3.10" and python_version < "4.0"
|
2 |
+
certifi==2024.8.30 ; python_version >= "3.10" and python_version < "4.0"
|
3 |
+
charset-normalizer==3.3.2 ; python_version >= "3.10" and python_version < "4.0"
|
4 |
+
colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" and platform_system == "Windows"
|
5 |
+
diffusers==0.28.2 ; python_version >= "3.10" and python_version < "4.0"
|
6 |
+
einops==0.6.1 ; python_version >= "3.10" and python_version < "4.0"
|
7 |
+
filelock==3.16.1 ; python_version >= "3.10" and python_version < "4.0"
|
8 |
+
fsspec==2024.9.0 ; python_version >= "3.10" and python_version < "4.0"
|
9 |
+
huggingface-hub==0.25.1 ; python_version >= "3.10" and python_version < "4.0"
|
10 |
+
idna==3.10 ; python_version >= "3.10" and python_version < "4.0"
|
11 |
+
importlib-metadata==8.5.0 ; python_version >= "3.10" and python_version < "4.0"
|
12 |
+
intel-openmp==2021.4.0 ; python_version >= "3.10" and python_version < "4.0" and platform_system == "Windows"
|
13 |
+
jinja2==3.1.4 ; python_version >= "3.10" and python_version < "4.0"
|
14 |
+
markupsafe==2.1.5 ; python_version >= "3.10" and python_version < "4.0"
|
15 |
+
mkl==2021.4.0 ; python_version >= "3.10" and python_version < "4.0" and platform_system == "Windows"
|
16 |
+
mpmath==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
|
17 |
+
networkx==3.3 ; python_version >= "3.10" and python_version < "4.0"
|
18 |
+
numpy==2.1.1 ; python_version >= "3.10" and python_version < "4.0"
|
19 |
+
nvidia-cublas-cu12==12.1.3.1 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
20 |
+
nvidia-cuda-cupti-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
21 |
+
nvidia-cuda-nvrtc-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
22 |
+
nvidia-cuda-runtime-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
23 |
+
nvidia-cudnn-cu12==8.9.2.26 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
24 |
+
nvidia-cufft-cu12==11.0.2.54 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
25 |
+
nvidia-curand-cu12==10.3.2.106 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
26 |
+
nvidia-cusolver-cu12==11.4.5.107 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
27 |
+
nvidia-cusparse-cu12==12.1.0.106 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
28 |
+
nvidia-nccl-cu12==2.20.5 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
29 |
+
nvidia-nvjitlink-cu12==12.6.68 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
30 |
+
nvidia-nvtx-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.10" and python_version < "4.0"
|
31 |
+
packaging==24.1 ; python_version >= "3.10" and python_version < "4.0"
|
32 |
+
pillow==10.4.0 ; python_version >= "3.10" and python_version < "4.0"
|
33 |
+
psutil==6.0.0 ; python_version >= "3.10" and python_version < "4.0"
|
34 |
+
pyyaml==6.0.2 ; python_version >= "3.10" and python_version < "4.0"
|
35 |
+
regex==2024.9.11 ; python_version >= "3.10" and python_version < "4.0"
|
36 |
+
requests==2.32.3 ; python_version >= "3.10" and python_version < "4.0"
|
37 |
+
safetensors==0.4.5 ; python_version >= "3.10" and python_version < "4.0"
|
38 |
+
sentencepiece==0.2.0 ; python_version >= "3.10" and python_version < "4.0"
|
39 |
+
sympy==1.13.3 ; python_version >= "3.10" and python_version < "4.0"
|
40 |
+
tbb==2021.13.1 ; python_version >= "3.10" and python_version < "4.0" and platform_system == "Windows"
|
41 |
+
tokenizers==0.19.1 ; python_version >= "3.10" and python_version < "4.0"
|
42 |
+
torch==2.3.0 ; python_version >= "3.10" and python_version < "4.0"
|
43 |
+
tqdm==4.66.5 ; python_version >= "3.10" and python_version < "4.0"
|
44 |
+
transformers==4.44.2 ; python_version >= "3.10" and python_version < "4.0"
|
45 |
+
triton==2.3.0 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version < "3.12" and python_version >= "3.10"
|
46 |
+
typing-extensions==4.12.2 ; python_version >= "3.10" and python_version < "4.0"
|
47 |
+
urllib3==2.2.3 ; python_version >= "3.10" and python_version < "4.0"
|
48 |
+
zipp==3.20.2 ; python_version >= "3.10" and python_version < "4.0"
|
setup.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from setuptools import setup, find_packages
|
2 |
+
def parse_requirements(filename):
|
3 |
+
"""Load requirements from a pip requirements file."""
|
4 |
+
with open(filename, 'r') as file:
|
5 |
+
return file.read().splitlines()
|
6 |
+
|
7 |
+
|
8 |
+
setup(
|
9 |
+
name="xora-core", # The name of your package
|
10 |
+
version="0.1.0", # Version number of the package
|
11 |
+
description="A package for Xora model inferece", # Short description
|
12 |
+
author="YSapir Weissbuch", # Your name
|
13 |
+
author_email="sapir@lightricks.com", # Your email
|
14 |
+
url="https://github.com/LightricksResearch/xora-core", # URL for the project (GitHub, etc.)
|
15 |
+
packages=find_packages(), # Automatically find all packages inside `xora`
|
16 |
+
install_requires=parse_requirements('requirements.txt'), # Install dependencies from requirements.txt
|
17 |
+
classifiers=[
|
18 |
+
'Programming Language :: Python :: 3',
|
19 |
+
'License :: OSI Approved :: MIT License',
|
20 |
+
'Operating System :: OS Independent',
|
21 |
+
],
|
22 |
+
python_requires='>=3.10', # Specify Python version compatibility
|
23 |
+
)
|
xora/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
from .pipelines import *
|
eval.py β xora/examples/text_to_video.py
RENAMED
@@ -1,9 +1,9 @@
|
|
1 |
import torch
|
2 |
-
from
|
3 |
-
from
|
4 |
-
from
|
5 |
-
from
|
6 |
-
from
|
7 |
from pathlib import Path
|
8 |
from transformers import T5EncoderModel
|
9 |
|
|
|
1 |
import torch
|
2 |
+
from xora.models.autoencoders.causal_video_autoencoder import CausalVideoAutoencoder
|
3 |
+
from xora.models.transformers.transformer3d import Transformer3DModel
|
4 |
+
from xora.models.transformers.symmetric_patchifier import SymmetricPatchifier
|
5 |
+
from xora.schedulers.rf import RectifiedFlowScheduler
|
6 |
+
from xora.pipelines.pipeline_video_pixart_alpha import VideoPixArtAlphaPipeline
|
7 |
from pathlib import Path
|
8 |
from transformers import T5EncoderModel
|
9 |
|
xora/models/__init__.py
ADDED
File without changes
|
xora/models/autoencoders/__init__.py
ADDED
File without changes
|
{vae/layers β xora/models/autoencoders}/causal_conv3d.py
RENAMED
File without changes
|
{vae β xora/models}/autoencoders/causal_video_autoencoder.py
RENAMED
@@ -9,9 +9,9 @@ import numpy as np
|
|
9 |
from einops import rearrange
|
10 |
from torch import nn
|
11 |
|
12 |
-
from
|
13 |
-
from
|
14 |
-
from
|
15 |
|
16 |
|
17 |
class CausalVideoAutoencoder(AutoencoderKLWrapper):
|
|
|
9 |
from einops import rearrange
|
10 |
from torch import nn
|
11 |
|
12 |
+
from xora.models.autoencoders.conv_nd_factory import make_conv_nd, make_linear_nd
|
13 |
+
from xora.models.autoencoders.pixel_norm import PixelNorm
|
14 |
+
from xora.models.autoencoders.vae import AutoencoderKLWrapper
|
15 |
|
16 |
|
17 |
class CausalVideoAutoencoder(AutoencoderKLWrapper):
|
{vae/layers β xora/models/autoencoders}/conv_nd_factory.py
RENAMED
@@ -2,8 +2,8 @@ from typing import Tuple, Union
|
|
2 |
|
3 |
import torch
|
4 |
|
5 |
-
from
|
6 |
-
from
|
7 |
|
8 |
|
9 |
def make_conv_nd(
|
|
|
2 |
|
3 |
import torch
|
4 |
|
5 |
+
from xora.models.autoencoders.dual_conv3d import DualConv3d
|
6 |
+
from xora.models.autoencoders.causal_conv3d import CausalConv3d
|
7 |
|
8 |
|
9 |
def make_conv_nd(
|
{vae/layers β xora/models/autoencoders}/dual_conv3d.py
RENAMED
File without changes
|
{vae/layers β xora/models/autoencoders}/pixel_norm.py
RENAMED
File without changes
|
{vae β xora/models/autoencoders}/vae.py
RENAMED
@@ -6,7 +6,7 @@ import torch.nn as nn
|
|
6 |
from diffusers import ConfigMixin, ModelMixin
|
7 |
from diffusers.models.autoencoders.vae import DecoderOutput, DiagonalGaussianDistribution
|
8 |
from diffusers.models.modeling_outputs import AutoencoderKLOutput
|
9 |
-
from
|
10 |
|
11 |
|
12 |
class AutoencoderKLWrapper(ModelMixin, ConfigMixin):
|
|
|
6 |
from diffusers import ConfigMixin, ModelMixin
|
7 |
from diffusers.models.autoencoders.vae import DecoderOutput, DiagonalGaussianDistribution
|
8 |
from diffusers.models.modeling_outputs import AutoencoderKLOutput
|
9 |
+
from xora.models.autoencoders.conv_nd_factory import make_conv_nd
|
10 |
|
11 |
|
12 |
class AutoencoderKLWrapper(ModelMixin, ConfigMixin):
|
{vae β xora/models/autoencoders}/vae_encode.py
RENAMED
@@ -6,7 +6,7 @@ from torch import Tensor
|
|
6 |
from torch.nn import functional
|
7 |
|
8 |
|
9 |
-
from
|
10 |
|
11 |
class Downsample3D(nn.Module):
|
12 |
def __init__(self, dims, in_channels: int, out_channels: int, kernel_size: int = 3, padding: int = 1):
|
|
|
6 |
from torch.nn import functional
|
7 |
|
8 |
|
9 |
+
from xora.models.autoencoders.causal_video_autoencoder import CausalVideoAutoencoder
|
10 |
|
11 |
class Downsample3D(nn.Module):
|
12 |
def __init__(self, dims, in_channels: int, out_channels: int, kernel_size: int = 3, padding: int = 1):
|
xora/models/transformers/__init__.py
ADDED
File without changes
|
{transformer β xora/models/transformers}/attention.py
RENAMED
File without changes
|
patchify/symmetric.py β xora/models/transformers/symmetric_patchifier.py
RENAMED
@@ -6,7 +6,7 @@ from diffusers.configuration_utils import ConfigMixin
|
|
6 |
from einops import rearrange
|
7 |
from torch import Tensor
|
8 |
|
9 |
-
from utils.torch_utils import append_dims
|
10 |
|
11 |
|
12 |
class Patchifier(ConfigMixin, ABC):
|
|
|
6 |
from einops import rearrange
|
7 |
from torch import Tensor
|
8 |
|
9 |
+
from xora.utils.torch_utils import append_dims
|
10 |
|
11 |
|
12 |
class Patchifier(ConfigMixin, ABC):
|
{transformer β xora/models/transformers}/transformer3d.py
RENAMED
@@ -11,7 +11,7 @@ from diffusers.models.normalization import AdaLayerNormSingle
|
|
11 |
from diffusers.utils import BaseOutput, is_torch_version
|
12 |
from torch import nn
|
13 |
|
14 |
-
from
|
15 |
|
16 |
|
17 |
@dataclass
|
|
|
11 |
from diffusers.utils import BaseOutput, is_torch_version
|
12 |
from torch import nn
|
13 |
|
14 |
+
from xora.models.transformers.attention import BasicTransformerBlock
|
15 |
|
16 |
|
17 |
@dataclass
|
xora/pipelines/__init__.py
ADDED
File without changes
|
{pipeline β xora/pipelines}/pipeline_video_pixart_alpha.py
RENAMED
@@ -27,11 +27,11 @@ from diffusers.utils.torch_utils import randn_tensor
|
|
27 |
from einops import rearrange
|
28 |
from transformers import T5EncoderModel, T5Tokenizer
|
29 |
|
30 |
-
from
|
31 |
-
from
|
32 |
-
from
|
33 |
-
from
|
34 |
-
from
|
35 |
|
36 |
logger = logging.get_logger(__name__) # pylint: disable=invalid-name
|
37 |
|
|
|
27 |
from einops import rearrange
|
28 |
from transformers import T5EncoderModel, T5Tokenizer
|
29 |
|
30 |
+
from xora.models.transformers.transformer3d import Transformer3DModel
|
31 |
+
from xora.models.transformers.symmetric_patchifier import Patchifier
|
32 |
+
from xora.models.autoencoders.vae_encode import get_vae_size_scale_factor, vae_decode, vae_encode
|
33 |
+
from xora.models.autoencoders.causal_video_autoencoder import CausalVideoAutoencoder
|
34 |
+
from xora.schedulers.rf import TimestepShifter
|
35 |
|
36 |
logger = logging.get_logger(__name__) # pylint: disable=invalid-name
|
37 |
|
xora/schedulers/__init__.py
ADDED
File without changes
|
{scheduler β xora/schedulers}/rf.py
RENAMED
@@ -9,7 +9,7 @@ from diffusers.schedulers.scheduling_utils import SchedulerMixin
|
|
9 |
from diffusers.utils import BaseOutput
|
10 |
from torch import Tensor
|
11 |
|
12 |
-
from utils.torch_utils import append_dims
|
13 |
|
14 |
|
15 |
def simple_diffusion_resolution_dependent_timestep_shift(
|
|
|
9 |
from diffusers.utils import BaseOutput
|
10 |
from torch import Tensor
|
11 |
|
12 |
+
from xora.utils.torch_utils import append_dims
|
13 |
|
14 |
|
15 |
def simple_diffusion_resolution_dependent_timestep_shift(
|
xora/utils/__init__.py
ADDED
File without changes
|
{utils β xora/utils}/torch_utils.py
RENAMED
File without changes
|