|
16 | 16 | import unittest |
17 | 17 |
|
18 | 18 | import numpy as np |
| 19 | +import PIL |
19 | 20 | import torch |
20 | 21 |
|
21 | 22 | from diffusers import ClassifierFreeGuidance |
22 | | -from diffusers.modular_pipelines import QwenImageAutoBlocks, QwenImageModularPipeline |
| 23 | +from diffusers.modular_pipelines import ( |
| 24 | + QwenImageAutoBlocks, |
| 25 | + QwenImageEditAutoBlocks, |
| 26 | + QwenImageEditModularPipeline, |
| 27 | + QwenImageModularPipeline, |
| 28 | +) |
23 | 29 |
|
24 | 30 | from ...testing_utils import torch_device |
25 | 31 | from ..test_modular_pipelines_common import ModularPipelineTesterMixin |
26 | 32 |
|
27 | 33 |
|
28 | | -class QwenImagexModularTests: |
| 34 | +class QwenImageModularTests: |
29 | 35 | pipeline_class = QwenImageModularPipeline |
30 | 36 | pipeline_blocks_class = QwenImageAutoBlocks |
31 | 37 | repo = "hf-internal-testing/tiny-qwenimage-modular" |
@@ -79,7 +85,20 @@ def test_guider_cfg(self): |
79 | 85 |
|
80 | 86 |
|
81 | 87 | class QwenImageModularPipelineFastTests( |
82 | | - QwenImagexModularTests, QwenImageModularGuiderTests, ModularPipelineTesterMixin, unittest.TestCase |
| 88 | + QwenImageModularTests, QwenImageModularGuiderTests, ModularPipelineTesterMixin, unittest.TestCase |
83 | 89 | ): |
84 | 90 | def __init__(self, *args, **kwargs): |
85 | 91 | super().__init__(*args, **kwargs) |
| 92 | + |
| 93 | + |
| 94 | +class QwenImageEditModularPipelineFastTests( |
| 95 | + QwenImageModularTests, QwenImageModularGuiderTests, ModularPipelineTesterMixin, unittest.TestCase |
| 96 | +): |
| 97 | + pipeline_class = QwenImageEditModularPipeline |
| 98 | + pipeline_blocks_class = QwenImageEditAutoBlocks |
| 99 | + repo = "hf-internal-testing/tiny-qwenimage-edit-modular" |
| 100 | + |
| 101 | + def get_dummy_inputs(self, device, seed=0): |
| 102 | + inputs = super().get_dummy_inputs(device, seed) |
| 103 | + inputs["image"] = PIL.Image.new("RGB", (32, 32), 0) |
| 104 | + return inputs |
0 commit comments