Skip to content

Commit da5903d

Browse files
authored
use small model for testing textual inversion (#1030)
* use small model for testing textual inversion * enable tests in precommit
1 parent 0a9a10b commit da5903d

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

tests/openvino/test_diffusion.py

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from pathlib import Path
1818

1919
import numpy as np
20-
import pytest
2120
import torch
2221
from diffusers import (
2322
AutoPipelineForImage2Image,
@@ -28,7 +27,6 @@
2827
from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
2928
from diffusers.utils import load_image
3029
from parameterized import parameterized
31-
from transformers.testing_utils import slow
3230
from utils_tests import MODEL_NAMES, SEED
3331

3432
from optimum.intel.openvino import (
@@ -379,15 +377,10 @@ def test_height_width_properties(self, model_arch: str):
379377
self.assertEqual(ov_pipeline.height, height)
380378
self.assertEqual(ov_pipeline.width, width)
381379

382-
@pytest.mark.run_slow
383-
@slow
384380
@require_diffusers
385381
def test_textual_inversion(self):
386-
# for now we only test for stable-diffusion
387-
# this is very slow and costly to run right now
388-
389-
model_id = "runwayml/stable-diffusion-v1-5"
390-
ti_id = "sd-concepts-library/cat-toy"
382+
model_id = "hf-internal-testing/tiny-stable-diffusion-torch"
383+
ti_id = "katuni4ka/textual_inversion_cat"
391384

392385
inputs = self.generate_inputs()
393386
inputs["prompt"] = "A <cat-toy> backpack"
@@ -623,15 +616,10 @@ def test_height_width_properties(self, model_arch: str):
623616
self.assertEqual(ov_pipeline.height, height)
624617
self.assertEqual(ov_pipeline.width, width)
625618

626-
@pytest.mark.run_slow
627-
@slow
628619
@require_diffusers
629620
def test_textual_inversion(self):
630-
# for now we only test for stable-diffusion
631-
# this is very slow and costly to run right now
632-
633-
model_id = "runwayml/stable-diffusion-v1-5"
634-
ti_id = "sd-concepts-library/cat-toy"
621+
model_id = "hf-internal-testing/tiny-stable-diffusion-torch"
622+
ti_id = "katuni4ka/textual_inversion_cat"
635623

636624
inputs = self.generate_inputs(model_type="stable-diffusion")
637625
inputs["prompt"] = "A <cat-toy> backpack"
@@ -867,15 +855,10 @@ def test_height_width_properties(self, model_arch: str):
867855
self.assertEqual(ov_pipeline.height, height)
868856
self.assertEqual(ov_pipeline.width, width)
869857

870-
@pytest.mark.run_slow
871-
@slow
872858
@require_diffusers
873859
def test_textual_inversion(self):
874-
# for now we only test for stable-diffusion
875-
# this is very slow and costly to run right now
876-
877-
model_id = "runwayml/stable-diffusion-v1-5"
878-
ti_id = "sd-concepts-library/cat-toy"
860+
model_id = "hf-internal-testing/tiny-stable-diffusion-torch"
861+
ti_id = "katuni4ka/textual_inversion_cat"
879862

880863
inputs = self.generate_inputs()
881864
inputs["prompt"] = "A <cat-toy> backpack"

0 commit comments

Comments
 (0)