|
35 | 35 | OVPipelineForInpainting,
|
36 | 36 | OVPipelineForText2Image,
|
37 | 37 | )
|
| 38 | +from optimum.intel.utils.import_utils import is_transformers_version |
38 | 39 | from optimum.utils.testing_utils import require_diffusers
|
39 | 40 |
|
40 | 41 |
|
@@ -72,7 +73,10 @@ def _generate_images(height=128, width=128, batch_size=1, channel=3, input_type=
|
72 | 73 |
|
73 | 74 |
|
74 | 75 | class OVPipelineForText2ImageTest(unittest.TestCase):
|
75 |
| - SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "latent-consistency", "stable-diffusion-3"] |
| 76 | + SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "latent-consistency"] |
| 77 | + if is_transformers_version(">=", "4.40.0"): |
| 78 | + SUPPORTED_ARCHITECTURES.append("stable-diffusion-3") |
| 79 | + CALLBACK_SUPPORT_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "latent-consistency"] |
76 | 80 |
|
77 | 81 | OVMODEL_CLASS = OVPipelineForText2Image
|
78 | 82 | AUTOMODEL_CLASS = AutoPipelineForText2Image
|
@@ -138,7 +142,7 @@ def test_compare_to_diffusers_pipeline(self, model_arch: str):
|
138 | 142 |
|
139 | 143 | np.testing.assert_allclose(ov_output, diffusers_output, atol=6e-3, rtol=1e-2)
|
140 | 144 |
|
141 |
| - @parameterized.expand(["stable-diffusion", "stable-diffusion-xl", "latent-consistency"]) |
| 145 | + @parameterized.expand(CALLBACK_SUPPORT_ARCHITECTURES) |
142 | 146 | @require_diffusers
|
143 | 147 | def test_callback(self, model_arch: str):
|
144 | 148 | height, width, batch_size = 64, 128, 1
|
@@ -353,7 +357,9 @@ def test_textual_inversion(self):
|
353 | 357 |
|
354 | 358 |
|
355 | 359 | class OVPipelineForImage2ImageTest(unittest.TestCase):
|
356 |
| - SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "latent-consistency", "stable-diffusion-3"] |
| 360 | + SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "latent-consistency"] |
| 361 | + if is_transformers_version(">=", "4.40.0"): |
| 362 | + SUPPORTED_ARCHITECTURES.append("stable-diffusion-3") |
357 | 363 |
|
358 | 364 | AUTOMODEL_CLASS = AutoPipelineForImage2Image
|
359 | 365 | OVMODEL_CLASS = OVPipelineForImage2Image
|
@@ -576,7 +582,10 @@ def test_textual_inversion(self):
|
576 | 582 |
|
577 | 583 |
|
578 | 584 | class OVPipelineForInpaintingTest(unittest.TestCase):
|
579 |
| - SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "stable-diffusion-3"] |
| 585 | + SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl"] |
| 586 | + |
| 587 | + if is_transformers_version(">=", "4.40.0"): |
| 588 | + SUPPORTED_ARCHITECTURES.append("stable-diffusion-3") |
580 | 589 |
|
581 | 590 | AUTOMODEL_CLASS = AutoPipelineForInpainting
|
582 | 591 | OVMODEL_CLASS = OVPipelineForInpainting
|
|
0 commit comments