Skip to content

Commit 77c097d

Browse files
committed
update
1 parent 3c8b67b commit 77c097d

File tree

8 files changed

+873
-0
lines changed

8 files changed

+873
-0
lines changed

src/diffusers/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@
363363
[
364364
"StableDiffusionXLAutoBlocks",
365365
"StableDiffusionXLModularPipeline",
366+
"WanAutoBlocks",
367+
"WanModularPipeline",
366368
]
367369
)
368370
_import_structure["pipelines"].extend(
@@ -988,6 +990,8 @@
988990
from .modular_pipelines import (
989991
StableDiffusionXLAutoBlocks,
990992
StableDiffusionXLModularPipeline,
993+
WanAutoBlocks,
994+
WanModularPipeline,
991995
)
992996
from .pipelines import (
993997
AllegroPipeline,

src/diffusers/modular_pipelines/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"InsertableDict",
4141
]
4242
_import_structure["stable_diffusion_xl"] = ["StableDiffusionXLAutoBlocks", "StableDiffusionXLModularPipeline"]
43+
_import_structure["wan"] = ["WanAutoBlocks", "WanModularPipeline"]
4344
_import_structure["components_manager"] = ["ComponentsManager"]
4445

4546
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
@@ -71,6 +72,7 @@
7172
StableDiffusionXLAutoBlocks,
7273
StableDiffusionXLModularPipeline,
7374
)
75+
from .wan import WanAutoBlocks, WanModularPipeline
7476
else:
7577
import sys
7678

src/diffusers/modular_pipelines/modular_pipeline.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@
6060
MODULAR_PIPELINE_MAPPING = OrderedDict(
6161
[
6262
("stable-diffusion-xl", "StableDiffusionXLModularPipeline"),
63+
("wan", "WanModularPipeline"),
6364
]
6465
)
6566

6667
MODULAR_PIPELINE_BLOCKS_MAPPING = OrderedDict(
6768
[
6869
("StableDiffusionXLModularPipeline", "StableDiffusionXLAutoBlocks"),
70+
("WanModularPipeline", "WanAutoBlocks"),
6971
]
7072
)
7173

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
from typing import TYPE_CHECKING
2+
3+
from ...utils import (
4+
DIFFUSERS_SLOW_IMPORT,
5+
OptionalDependencyNotAvailable,
6+
_LazyModule,
7+
get_objects_from_module,
8+
is_torch_available,
9+
is_transformers_available,
10+
)
11+
12+
13+
_dummy_objects = {}
14+
_import_structure = {}
15+
16+
try:
17+
if not (is_transformers_available() and is_torch_available()):
18+
raise OptionalDependencyNotAvailable()
19+
except OptionalDependencyNotAvailable:
20+
from ...utils import dummy_torch_and_transformers_objects # noqa F403
21+
22+
_dummy_objects.update(get_objects_from_module(dummy_torch_and_transformers_objects))
23+
else:
24+
_import_structure["encoders"] = []
25+
_import_structure["modular_blocks"] = [
26+
"ALL_BLOCKS",
27+
"AUTO_BLOCKS",
28+
"TEXT2VIDEO_BLOCKS",
29+
"WanAutoBlocks",
30+
]
31+
_import_structure["modular_pipeline"] = ["WanModularPipeline"]
32+
33+
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
34+
try:
35+
if not (is_transformers_available() and is_torch_available()):
36+
raise OptionalDependencyNotAvailable()
37+
except OptionalDependencyNotAvailable:
38+
from ...utils.dummy_torch_and_transformers_objects import * # noqa F403
39+
else:
40+
from .modular_blocks import (
41+
ALL_BLOCKS,
42+
AUTO_BLOCKS,
43+
TEXT2VIDEO_BLOCKS,
44+
WanAutoBlocks,
45+
)
46+
from .modular_pipeline import WanModularPipeline
47+
else:
48+
import sys
49+
50+
sys.modules[__name__] = _LazyModule(
51+
__name__,
52+
globals()["__file__"],
53+
_import_structure,
54+
module_spec=__spec__,
55+
)
56+
57+
for name, value in _dummy_objects.items():
58+
setattr(sys.modules[__name__], name, value)

0 commit comments

Comments
 (0)