|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 | 15 | import json
|
| 16 | +import logging |
16 | 17 | import unittest
|
17 | 18 | from pathlib import Path
|
18 | 19 |
|
@@ -442,19 +443,28 @@ def test_load_custom_weight_variant(self):
|
442 | 443 | @require_diffusers
|
443 | 444 | def test_static_shape_image_generation(self, model_arch):
|
444 | 445 | pipeline = self.OVMODEL_CLASS.from_pretrained(MODEL_NAMES[model_arch], compile=False)
|
445 |
| - pipeline.reshape(batch_size=1, height=64, width=32) |
| 446 | + pipeline.reshape(batch_size=1, height=32, width=32) |
446 | 447 | pipeline.compile()
|
447 | 448 | # generation with incompatible size
|
448 | 449 | height, width, batch_size = 64, 64, 1
|
449 | 450 | inputs = self.generate_inputs(height=height, width=width, batch_size=batch_size)
|
450 | 451 | inputs["output_type"] = "pil"
|
451 |
| - image = pipeline(**inputs).images[0] |
452 |
| - self.assertTupleEqual(image.size, (32, 64)) |
| 452 | + from optimum.intel.openvino.modeling_diffusion import logger as diffusers_logger |
| 453 | + |
| 454 | + with self.assertLogs(diffusers_logger, logging.WARN) as warning_log: |
| 455 | + image = pipeline(**inputs).images[0] |
| 456 | + self.assertTrue( |
| 457 | + any( |
| 458 | + "Incompatible width argument provided" in log or "Incompatible height argument provided" in log |
| 459 | + for log in warning_log.output |
| 460 | + ) |
| 461 | + ) |
| 462 | + self.assertTupleEqual(image.size, (32, 32)) |
453 | 463 | # generation without height / width provided
|
454 | 464 | inputs.pop("height")
|
455 | 465 | inputs.pop("width")
|
456 | 466 | image = pipeline(**inputs).images[0]
|
457 |
| - self.assertTupleEqual(image.size, (32, 64)) |
| 467 | + self.assertTupleEqual(image.size, (32, 32)) |
458 | 468 |
|
459 | 469 |
|
460 | 470 | class OVPipelineForImage2ImageTest(unittest.TestCase):
|
|
0 commit comments