Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 094f7c2

Browse files
committedOct 11, 2024·
add tests
1 parent c25a46b commit 094f7c2

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed
 

‎optimum/intel/openvino/modeling_diffusion.py

+4
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ def _from_transformers(
511511
no_post_process=True,
512512
revision=revision,
513513
cache_dir=cache_dir,
514+
task=cls.export_feature,
514515
token=token,
515516
local_files_only=local_files_only,
516517
force_download=force_download,
@@ -1479,13 +1480,16 @@ def from_pretrained(cls, pretrained_model_or_path, **kwargs):
14791480
class OVPipelineForText2Image(OVPipelineForTask):
14801481
auto_model_class = AutoPipelineForText2Image
14811482
ov_pipelines_mapping = OV_TEXT2IMAGE_PIPELINES_MAPPING
1483+
export_feature = "text-to-image"
14821484

14831485

14841486
class OVPipelineForImage2Image(OVPipelineForTask):
14851487
auto_model_class = AutoPipelineForImage2Image
14861488
ov_pipelines_mapping = OV_IMAGE2IMAGE_PIPELINES_MAPPING
1489+
export_feature = "image-to-image"
14871490

14881491

14891492
class OVPipelineForInpainting(OVPipelineForTask):
14901493
auto_model_class = AutoPipelineForInpainting
14911494
ov_pipelines_mapping = OV_INPAINT_PIPELINES_MAPPING
1495+
export_feature = "inpainting"

‎tests/openvino/test_diffusion.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def _generate_images(height=128, width=128, batch_size=1, channel=3, input_type=
7272

7373

7474
class OVPipelineForText2ImageTest(unittest.TestCase):
75-
SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "latent-consistency"]
75+
SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "latent-consistency", "stable-diffusion-3"]
7676

7777
OVMODEL_CLASS = OVPipelineForText2Image
7878
AUTOMODEL_CLASS = AutoPipelineForText2Image
@@ -323,7 +323,7 @@ def test_textual_inversion(self):
323323

324324

325325
class OVPipelineForImage2ImageTest(unittest.TestCase):
326-
SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "latent-consistency"]
326+
SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "latent-consistency", "stable-diffusion-3"]
327327

328328
AUTOMODEL_CLASS = AutoPipelineForImage2Image
329329
OVMODEL_CLASS = OVPipelineForImage2Image
@@ -535,7 +535,7 @@ def test_textual_inversion(self):
535535

536536

537537
class OVPipelineForInpaintingTest(unittest.TestCase):
538-
SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl"]
538+
SUPPORTED_ARCHITECTURES = ["stable-diffusion", "stable-diffusion-xl", "stable-diffusion-3"]
539539

540540
AUTOMODEL_CLASS = AutoPipelineForInpainting
541541
OVMODEL_CLASS = OVPipelineForInpainting

‎tests/openvino/utils_tests.py

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
"stable-diffusion-openvino": "hf-internal-testing/tiny-stable-diffusion-openvino",
119119
"stable-diffusion-xl": "echarlaix/tiny-random-stable-diffusion-xl",
120120
"stable-diffusion-xl-refiner": "echarlaix/tiny-random-stable-diffusion-xl-refiner",
121+
"stable-diffusion-3": "yujiepan/stable-diffusion-3-tiny-random",
121122
"stablelm": "hf-internal-testing/tiny-random-StableLmForCausalLM",
122123
"starcoder2": "hf-internal-testing/tiny-random-Starcoder2ForCausalLM",
123124
"latent-consistency": "echarlaix/tiny-random-latent-consistency",

0 commit comments

Comments
 (0)
Please sign in to comment.