Skip to content

Commit 152f7ca

Browse files
authored
fix type-check for z-image transformer (#12739)
* allow type-check for ZImageTransformer2DModel * make fix-copies
1 parent b010a8c commit 152f7ca

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/diffusers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,7 @@
991991
WanAnimateTransformer3DModel,
992992
WanTransformer3DModel,
993993
WanVACETransformer3DModel,
994+
ZImageTransformer2DModel,
994995
attention_backend,
995996
)
996997
from .modular_pipelines import ComponentsManager, ComponentSpec, ModularPipeline, ModularPipelineBlocks

src/diffusers/utils/dummy_pt_objects.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,6 +1698,21 @@ def from_pretrained(cls, *args, **kwargs):
16981698
requires_backends(cls, ["torch"])
16991699

17001700

1701+
class ZImageTransformer2DModel(metaclass=DummyObject):
1702+
_backends = ["torch"]
1703+
1704+
def __init__(self, *args, **kwargs):
1705+
requires_backends(self, ["torch"])
1706+
1707+
@classmethod
1708+
def from_config(cls, *args, **kwargs):
1709+
requires_backends(cls, ["torch"])
1710+
1711+
@classmethod
1712+
def from_pretrained(cls, *args, **kwargs):
1713+
requires_backends(cls, ["torch"])
1714+
1715+
17011716
def attention_backend(*args, **kwargs):
17021717
requires_backends(attention_backend, ["torch"])
17031718

0 commit comments

Comments
 (0)