
"""simple docstring"""


import io
import json

import fsspec
import pytest

from datasets import Dataset, DatasetDict, Features, NamedSplit, Value
from datasets.io.json import JsonDatasetReader, JsonDatasetWriter

from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases






def       _snake_case				(		snake_case__   :     List[Any]	,      snake_case__   :     Optional[int]     ):
	assert isinstance(_lowerCamelCase	,      _lowerCamelCase     )
	assert dataset.num_rows == 4
	assert dataset.num_columns == 3
	assert dataset.column_names == ["col_1", "col_2", "col_3"]
	for feature, expected_dtype in expected_features.items():
		assert dataset.features[feature].dtype == expected_dtype






@pytest.mark.parametrize('keep_in_memory'	,      [False, True]     )
def       _snake_case				(		snake_case__   :     Dict	,      snake_case__   :     Optional[int]	,      snake_case__   :     str     ):
	A						   =   tmp_path / "cache"
	A						   =   {"col_1": "string", "col_2": "int64", "col_3": "float64"}
	with assert_arrow_memory_increases() if keep_in_memory else assert_arrow_memory_doesnt_increase():
		A						   =   JsonDatasetReader(_lowerCamelCase	,      cache_dir=_lowerCamelCase	,      keep_in_memory=_lowerCamelCase     ).read()
	_check_json_dataset(_lowerCamelCase	,      _lowerCamelCase     )






@pytest.mark.parametrize(
    'features'	,      [
        None,
        {'col_1': 'string', 'col_2': 'int64', 'col_3': 'float64'},
        {'col_1': 'string', 'col_2': 'string', 'col_3': 'string'},
        {'col_1': 'int32', 'col_2': 'int32', 'col_3': 'int32'},
        {'col_1': 'float32', 'col_2': 'float32', 'col_3': 'float32'},
    ]	,      )
def       _snake_case				(		snake_case__   :     Tuple	,      snake_case__   :     Union[str, Any]	,      snake_case__   :     Union[str, Any]     ):
	A						   =   tmp_path / "cache"
	A						   =   {"col_1": "string", "col_2": "int64", "col_3": "float64"}
	A						   =   features.copy() if features else default_expected_features
	A						   =   (
	    Features({feature: Value(_lowerCamelCase     ) for feature, dtype in features.items()}     ) if features is not None else None
	)
	A						   =   JsonDatasetReader(_lowerCamelCase	,      features=_lowerCamelCase	,      cache_dir=_lowerCamelCase     ).read()
	_check_json_dataset(_lowerCamelCase	,      _lowerCamelCase     )






@pytest.mark.parametrize(
    'features'	,      [
        None,
        {'col_3': 'float64', 'col_1': 'string', 'col_2': 'int64'},
    ]	,      )
def       _snake_case				(		snake_case__   :     int	,      snake_case__   :     str	,      snake_case__   :     List[Any]     ):
	A						   =   tmp_path / "cache"
	A						   =   {"col_3": "float64", "col_1": "string", "col_2": "int64"}
	A						   =   features.copy() if features else default_expected_features
	A						   =   (
	    Features({feature: Value(_lowerCamelCase     ) for feature, dtype in features.items()}     ) if features is not None else None
	)
	A						   =   JsonDatasetReader(_lowerCamelCase	,      features=_lowerCamelCase	,      cache_dir=_lowerCamelCase     ).read()
	assert isinstance(_lowerCamelCase	,      _lowerCamelCase     )
	assert dataset.num_rows == 2
	assert dataset.num_columns == 3
	assert dataset.column_names == ["col_3", "col_1", "col_2"]
	for feature, expected_dtype in expected_features.items():
		assert dataset.features[feature].dtype == expected_dtype






def       _snake_case				(		snake_case__   :     Optional[Any]	,      snake_case__   :     str     ):
	A						   =   {"col_2": "int64", "col_3": "float64", "col_1": "string"}
	A						   =   features.copy()
	A						   =   (
	    Features({feature: Value(_lowerCamelCase     ) for feature, dtype in features.items()}     ) if features is not None else None
	)
	A						   =   tmp_path / "cache"
	A						   =   JsonDatasetReader(_lowerCamelCase	,      features=_lowerCamelCase	,      cache_dir=_lowerCamelCase     ).read()
	assert isinstance(_lowerCamelCase	,      _lowerCamelCase     )
	assert dataset.num_rows == 2
	assert dataset.num_columns == 3
	assert dataset.column_names == ["col_2", "col_3", "col_1"]
	for feature, expected_dtype in expected_features.items():
		assert dataset.features[feature].dtype == expected_dtype






@pytest.mark.parametrize('split'	,      [None, NamedSplit('train'     ), 'train', 'test']     )
def       _snake_case				(		snake_case__   :     str	,      snake_case__   :     Optional[int]	,      snake_case__   :     Optional[int]     ):
	A						   =   tmp_path / "cache"
	A						   =   {"col_1": "string", "col_2": "int64", "col_3": "float64"}
	A						   =   JsonDatasetReader(_lowerCamelCase	,      cache_dir=_lowerCamelCase	,      split=_lowerCamelCase     ).read()
	_check_json_dataset(_lowerCamelCase	,      _lowerCamelCase     )
	assert dataset.split == split if split else "train"






@pytest.mark.parametrize('path_type'	,      [str, list]     )
def       _snake_case				(		snake_case__   :     Any	,      snake_case__   :     Tuple	,      snake_case__   :     List[Any]     ):


	if issubclass(_lowerCamelCase	,      _lowerCamelCase     ):
		A						   =   jsonl_path
	elif issubclass(_lowerCamelCase	,      _lowerCamelCase     ):
		A						   =   [jsonl_path]
	A						   =   tmp_path / "cache"
	A						   =   {"col_1": "string", "col_2": "int64", "col_3": "float64"}
	A						   =   JsonDatasetReader(_lowerCamelCase	,      cache_dir=_lowerCamelCase     ).read()
	_check_json_dataset(_lowerCamelCase	,      _lowerCamelCase     )






def       _snake_case				(		snake_case__   :     Dict	,      snake_case__   :     Tuple	,      snake_case__   :     Union[str, Any]=("train",)     ):
	assert isinstance(_lowerCamelCase	,      _lowerCamelCase     )
	for split in splits:
		A						   =   dataset_dict[split]
		assert dataset.num_rows == 4
		assert dataset.num_columns == 3
		assert dataset.column_names == ["col_1", "col_2", "col_3"]
		for feature, expected_dtype in expected_features.items():
			assert dataset.features[feature].dtype == expected_dtype






@pytest.mark.parametrize('keep_in_memory'	,      [False, True]     )
def       _snake_case				(		snake_case__   :     Optional[Any]	,      snake_case__   :     Dict	,      snake_case__   :     int     ):
	A						   =   tmp_path / "cache"
	A						   =   {"col_1": "string", "col_2": "int64", "col_3": "float64"}
	with assert_arrow_memory_increases() if keep_in_memory else assert_arrow_memory_doesnt_increase():
		A						   =   JsonDatasetReader({'train': jsonl_path}	,      cache_dir=_lowerCamelCase	,      keep_in_memory=_lowerCamelCase     ).read()
	_check_json_datasetdict(_lowerCamelCase	,      _lowerCamelCase     )






@pytest.mark.parametrize(
    'features'	,      [
        None,
        {'col_1': 'string', 'col_2': 'int64', 'col_3': 'float64'},
        {'col_1': 'string', 'col_2': 'string', 'col_3': 'string'},
        {'col_1': 'int32', 'col_2': 'int32', 'col_3': 'int32'},
        {'col_1': 'float32', 'col_2': 'float32', 'col_3': 'float32'},
    ]	,      )
def       _snake_case				(		snake_case__   :     str	,      snake_case__   :     Any	,      snake_case__   :     Tuple     ):
	A						   =   tmp_path / "cache"
	A						   =   {"col_1": "string", "col_2": "int64", "col_3": "float64"}
	A						   =   features.copy() if features else default_expected_features
	A						   =   (
	    Features({feature: Value(_lowerCamelCase     ) for feature, dtype in features.items()}     ) if features is not None else None
	)
	A						   =   JsonDatasetReader({'train': jsonl_path}	,      features=_lowerCamelCase	,      cache_dir=_lowerCamelCase     ).read()
	_check_json_datasetdict(_lowerCamelCase	,      _lowerCamelCase     )






@pytest.mark.parametrize('split'	,      [None, NamedSplit('train'     ), 'train', 'test']     )
def       _snake_case				(		snake_case__   :     str	,      snake_case__   :     Union[str, Any]	,      snake_case__   :     List[Any]     ):


	if split:
		A						   =   {split: jsonl_path}
	else:
		A						   =   "train"
		A						   =   {"train": jsonl_path, "test": jsonl_path}
	A						   =   tmp_path / "cache"
	A						   =   {"col_1": "string", "col_2": "int64", "col_3": "float64"}
	A						   =   JsonDatasetReader(_lowerCamelCase	,      cache_dir=_lowerCamelCase     ).read()
	_check_json_datasetdict(_lowerCamelCase	,      _lowerCamelCase	,      splits=list(path.keys()     )     )
	assert all(dataset[split].split == split for split in path.keys()     )






def       _snake_case				(		snake_case__   :     Any     ):
	return json.load(_lowerCamelCase     )






def       _snake_case				(		snake_case__   :     Any     ):
	return [json.loads(_lowerCamelCase     ) for line in buffer]







class 				lowerCAmelCase_				:



						'''simple docstring'''


						@pytest.mark.parametrize('lines, load_json_function'  ,[(True, load_json_lines), (False, load_json)]      )
						def 						_SCREAMING_SNAKE_CASE      ( self     :      List[Any]  ,A_     :      Tuple  ,A_     :      List[str]  ,A_     :      Optional[int]      )     ->   Optional[Any]:
							with io.BytesIO() as buffer:
								JsonDatasetWriter(A_  ,A_  ,lines=A_      ).write()
								buffer.seek(0      )
								A						   =   load_json_function(A_      )
							assert isinstance(A_  ,A_      )
							assert isinstance(exported_content[0]  ,A_      )
							assert len(A_      ) == 10


						@pytest.mark.parametrize(
						    'orient, container, keys, len_at'  ,[
						        ('records', list, {'tokens', 'labels', 'answers', 'id'}, None),
						        ('split', dict, {'columns', 'data'}, 'data'),
						        ('index', dict, set('0123456789'      ), None),
						        ('columns', dict, {'tokens', 'labels', 'answers', 'id'}, 'tokens'),
						        ('values', list, None, None),
						        ('table', dict, {'schema', 'data'}, 'data'),
						    ]  ,)
						def 						_SCREAMING_SNAKE_CASE      ( self     :      Optional[int]  ,A_     :      List[Any]  ,A_     :      Tuple  ,A_     :      Optional[Any]  ,A_     :      Optional[int]  ,A_     :      List[str]      )     ->   str:
							with io.BytesIO() as buffer:
								JsonDatasetWriter(A_  ,A_  ,lines=A_  ,orient=A_      ).write()
								buffer.seek(0      )
								A						   =   load_json(A_      )
							assert isinstance(A_  ,A_      )
							if keys:
								if container is dict:
									assert exported_content.keys() == keys
								else:
									assert exported_content[0].keys() == keys
							else:
								assert not hasattr(A_  ,'keys'      ) and not hasattr(exported_content[0]  ,'keys'      )
							if len_at:
								assert len(exported_content[len_at]      ) == 10
							else:
								assert len(A_      ) == 10


						@pytest.mark.parametrize('lines, load_json_function'  ,[(True, load_json_lines), (False, load_json)]      )
						def 						_SCREAMING_SNAKE_CASE      ( self     :      List[Any]  ,A_     :      Optional[Any]  ,A_     :      str  ,A_     :      str      )     ->   Optional[Any]:
							with io.BytesIO() as buffer:
								JsonDatasetWriter(A_  ,A_  ,lines=A_  ,num_proc=2      ).write()
								buffer.seek(0      )
								A						   =   load_json_function(A_      )
							assert isinstance(A_  ,A_      )
							assert isinstance(exported_content[0]  ,A_      )
							assert len(A_      ) == 10


						@pytest.mark.parametrize(
						    'orient, container, keys, len_at'  ,[
						        ('records', list, {'tokens', 'labels', 'answers', 'id'}, None),
						        ('split', dict, {'columns', 'data'}, 'data'),
						        ('index', dict, set('0123456789'      ), None),
						        ('columns', dict, {'tokens', 'labels', 'answers', 'id'}, 'tokens'),
						        ('values', list, None, None),
						        ('table', dict, {'schema', 'data'}, 'data'),
						    ]  ,)
						def 						_SCREAMING_SNAKE_CASE      ( self     :      Optional[Any]  ,A_     :      Optional[Any]  ,A_     :      List[str]  ,A_     :      Dict  ,A_     :      Optional[Any]  ,A_     :      Optional[Any]      )     ->   Any:
							with io.BytesIO() as buffer:
								JsonDatasetWriter(A_  ,A_  ,lines=A_  ,orient=A_  ,num_proc=2      ).write()
								buffer.seek(0      )
								A						   =   load_json(A_      )
							assert isinstance(A_  ,A_      )
							if keys:
								if container is dict:
									assert exported_content.keys() == keys
								else:
									assert exported_content[0].keys() == keys
							else:
								assert not hasattr(A_  ,'keys'      ) and not hasattr(exported_content[0]  ,'keys'      )
							if len_at:
								assert len(exported_content[len_at]      ) == 10
							else:
								assert len(A_      ) == 10


						def 						_SCREAMING_SNAKE_CASE      ( self     :      str  ,A_     :      Dict      )     ->   Optional[Any]:
							with pytest.raises(A_      ):
								with io.BytesIO() as buffer:
									JsonDatasetWriter(A_  ,A_  ,num_proc=0      )




						@pytest.mark.parametrize('compression, extension'  ,[('gzip', 'gz'), ('bz2', 'bz2'), ('xz', 'xz')]      )
						def 						_SCREAMING_SNAKE_CASE      ( self     :      Union[str, Any]  ,A_     :      Dict  ,A_     :      Union[str, Any]  ,A_     :      List[Any]  ,A_     :      List[Any]  ,A_     :      Optional[Any]      )     ->   Tuple:
							A						   =   tmp_path_factory.mktemp('data'      ) / F'test.json.{extension}'
							A						   =   str(shared_datadir / F'test_file.json.{extension}'      )
							JsonDatasetWriter(A_  ,A_  ,compression=A_      ).write()

							with fsspec.open(A_  ,'rb'  ,compression='infer'      ) as f:
								A						   =   f.read()
							with fsspec.open(A_  ,'rb'  ,compression='infer'      ) as f:
								A						   =   f.read()
							assert exported_content == original_content






"""simple docstring"""


import random
import unittest

import numpy as np

from diffusers import (
    DPMSolverMultistepScheduler,
    EulerAncestralDiscreteScheduler,
    EulerDiscreteScheduler,
    LMSDiscreteScheduler,
    OnnxStableDiffusionImgaImgPipeline,
    PNDMScheduler,
)
from diffusers.utils import floats_tensor
from diffusers.utils.testing_utils import (
    is_onnx_available,
    load_image,
    nightly,
    require_onnxruntime,
    require_torch_gpu,
)

from ..test_pipelines_onnx_common import OnnxPipelineTesterMixin


if is_onnx_available():
		import onnxruntime as ort







class 				lowerCAmelCase_				(      _lowercase		,					unittest.TestCase    ):



						'''simple docstring'''


						_lowerCamelCase:    Tuple      =    '''hf-internal-testing/tiny-random-OnnxStableDiffusionPipeline'''


						def 						_SCREAMING_SNAKE_CASE      ( self     :      List[Any]  ,A_     :      List[str]=0      )     ->   Dict:
							A						   =   floats_tensor((1, 3, 128, 128)  ,rng=random.Random(A_      )      )
							A						   =   np.random.RandomState(A_      )
							A						   =   {
							    'prompt': 'A painting of a squirrel eating a burger',
							    'image': image,
							    'generator': generator,
							    'num_inference_steps': 3,
							    'strength': 0.75,
							    'guidance_scale': 7.5,
							    'output_type': 'numpy',
							}
							return inputs


						def 						_SCREAMING_SNAKE_CASE      ( self     :      str      )     ->   Optional[int]:
							A						   =   OnnxStableDiffusionImgaImgPipeline.from_pretrained(self.hub_checkpoint  ,provider='CPUExecutionProvider'      )
							pipe.set_progress_bar_config(disable=A_      )

							A						   =   self.get_dummy_inputs()
							A						   =   pipe(**A_      ).images
							A						   =   image[0, -3:, -3:, -1].flatten()

							assert image.shape == (1, 128, 128, 3)
							A						   =   np.array([0.6_96_43, 0.5_84_84, 0.5_03_14, 0.5_87_60, 0.5_53_68, 0.5_96_43, 0.5_15_29, 0.4_12_17, 0.4_90_87]      )
							assert np.abs(image_slice - expected_slice      ).max() < 1e-1


						def 						_SCREAMING_SNAKE_CASE      ( self     :      str      )     ->   Union[str, Any]:
							A						   =   OnnxStableDiffusionImgaImgPipeline.from_pretrained(self.hub_checkpoint  ,provider='CPUExecutionProvider'      )
							A						   =   PNDMScheduler.from_config(pipe.scheduler.config  ,skip_prk_steps=A_      )
							pipe.set_progress_bar_config(disable=A_      )

							A						   =   self.get_dummy_inputs()
							A						   =   pipe(**A_      ).images
							A						   =   image[0, -3:, -3:, -1]

							assert image.shape == (1, 128, 128, 3)
							A						   =   np.array([0.6_17_37, 0.5_46_42, 0.5_31_83, 0.5_44_65, 0.5_27_42, 0.6_05_25, 0.4_99_69, 0.4_06_55, 0.4_81_54]      )

							assert np.abs(image_slice.flatten() - expected_slice      ).max() < 1e-1


						def 						_SCREAMING_SNAKE_CASE      ( self     :      Optional[Any]      )     ->   Dict:
							A						   =   OnnxStableDiffusionImgaImgPipeline.from_pretrained(self.hub_checkpoint  ,provider='CPUExecutionProvider'      )
							A						   =   LMSDiscreteScheduler.from_config(pipe.scheduler.config      )
							pipe.set_progress_bar_config(disable=A_      )

							# warmup pass to apply optimizations
							A						   =   pipe(**self.get_dummy_inputs()      )

							A						   =   self.get_dummy_inputs()
							A						   =   pipe(**A_      ).images
							A						   =   image[0, -3:, -3:, -1]

							assert image.shape == (1, 128, 128, 3)
							A						   =   np.array([0.5_27_61, 0.5_99_77, 0.4_90_33, 0.4_96_19, 0.5_42_82, 0.5_03_11, 0.4_76_00, 0.4_09_18, 0.4_52_03]      )

							assert np.abs(image_slice.flatten() - expected_slice      ).max() < 1e-1


						def 						_SCREAMING_SNAKE_CASE      ( self     :      int      )     ->   Optional[int]:
							A						   =   OnnxStableDiffusionImgaImgPipeline.from_pretrained(self.hub_checkpoint  ,provider='CPUExecutionProvider'      )
							A						   =   EulerDiscreteScheduler.from_config(pipe.scheduler.config      )
							pipe.set_progress_bar_config(disable=A_      )

							A						   =   self.get_dummy_inputs()
							A						   =   pipe(**A_      ).images
							A						   =   image[0, -3:, -3:, -1]

							assert image.shape == (1, 128, 128, 3)
							A						   =   np.array([0.5_29_11, 0.6_00_04, 0.4_92_29, 0.4_98_05, 0.5_45_02, 0.5_06_80, 0.4_77_77, 0.4_10_28, 0.4_53_04]      )

							assert np.abs(image_slice.flatten() - expected_slice      ).max() < 1e-1


						def 						_SCREAMING_SNAKE_CASE      ( self     :      List[str]      )     ->   Optional[int]:
							A						   =   OnnxStableDiffusionImgaImgPipeline.from_pretrained(self.hub_checkpoint  ,provider='CPUExecutionProvider'      )
							A						   =   EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config      )
							pipe.set_progress_bar_config(disable=A_      )

							A						   =   self.get_dummy_inputs()
							A						   =   pipe(**A_      ).images
							A						   =   image[0, -3:, -3:, -1]

							assert image.shape == (1, 128, 128, 3)
							A						   =   np.array([0.5_29_11, 0.6_00_04, 0.4_92_29, 0.4_98_05, 0.5_45_02, 0.5_06_80, 0.4_77_77, 0.4_10_28, 0.4_53_04]      )

							assert np.abs(image_slice.flatten() - expected_slice      ).max() < 1e-1




						def 						_SCREAMING_SNAKE_CASE      ( self     :      str      )     ->   Optional[Any]:
							A						   =   OnnxStableDiffusionImgaImgPipeline.from_pretrained(self.hub_checkpoint  ,provider='CPUExecutionProvider'      )
							A						   =   DPMSolverMultistepScheduler.from_config(pipe.scheduler.config      )
							pipe.set_progress_bar_config(disable=A_      )

							A						   =   self.get_dummy_inputs()
							A						   =   pipe(**A_      ).images
							A						   =   image[0, -3:, -3:, -1]

							assert image.shape == (1, 128, 128, 3)
							A						   =   np.array([0.6_53_31, 0.5_82_77, 0.4_82_04, 0.5_60_59, 0.5_36_65, 0.5_62_35, 0.5_09_69, 0.4_00_09, 0.4_65_52]      )

							assert np.abs(image_slice.flatten() - expected_slice      ).max() < 1e-1







@nightly
@require_onnxruntime
@require_torch_gpu
class 				lowerCAmelCase_				(      unittest.TestCase    ):



						'''simple docstring'''


						@property
						def 						_SCREAMING_SNAKE_CASE      ( self     :      Any      )     ->   Union[str, Any]:
							return (
							    "CUDAExecutionProvider",
							    {
							        "gpu_mem_limit": "15000000000",  # 15GB
							        "arena_extend_strategy": "kSameAsRequested",
							    },
							)


						@property
						def 						_SCREAMING_SNAKE_CASE      ( self     :      Dict      )     ->   str:
							A						   =   ort.SessionOptions()
							A						   =   False
							return options


						def 						_SCREAMING_SNAKE_CASE      ( self     :      str      )     ->   Tuple:
							A						   =   load_image(
							    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main'
							    '/img2img/sketch-mountains-input.jpg'      )
							A						   =   init_image.resize((768, 512)      )
							# using the PNDM scheduler by default
							A						   =   OnnxStableDiffusionImgaImgPipeline.from_pretrained(
							    'CompVis/stable-diffusion-v1-4'  ,revision='onnx'  ,safety_checker=A_  ,feature_extractor=A_  ,provider=self.gpu_provider  ,sess_options=self.gpu_options  ,)
							pipe.set_progress_bar_config(disable=A_      )

							A						   =   'A fantasy landscape, trending on artstation'

							A						   =   np.random.RandomState(0      )
							A						   =   pipe(
							    prompt=A_  ,image=A_  ,strength=0.75  ,guidance_scale=7.5  ,num_inference_steps=10  ,generator=A_  ,output_type='np'  ,)
							A						   =   output.images
							A						   =   images[0, 255:258, 383:386, -1]

							assert images.shape == (1, 512, 768, 3)
							A						   =   np.array([0.49_09, 0.50_59, 0.53_72, 0.46_23, 0.48_76, 0.50_49, 0.48_20, 0.49_56, 0.50_19]      )
							# TODO: lower the tolerance after finding the cause of onnxruntime reproducibility issues

							assert np.abs(image_slice.flatten() - expected_slice      ).max() < 2e-2




						def 						_SCREAMING_SNAKE_CASE      ( self     :      Optional[Any]      )     ->   Any:
							A						   =   load_image(
							    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main'
							    '/img2img/sketch-mountains-input.jpg'      )
							A						   =   init_image.resize((768, 512)      )
							A						   =   LMSDiscreteScheduler.from_pretrained(
							    'runwayml/stable-diffusion-v1-5'  ,subfolder='scheduler'  ,revision='onnx'      )
							A						   =   OnnxStableDiffusionImgaImgPipeline.from_pretrained(
							    'runwayml/stable-diffusion-v1-5'  ,revision='onnx'  ,scheduler=A_  ,safety_checker=A_  ,feature_extractor=A_  ,provider=self.gpu_provider  ,sess_options=self.gpu_options  ,)
							pipe.set_progress_bar_config(disable=A_      )

							A						   =   'A fantasy landscape, trending on artstation'

							A						   =   np.random.RandomState(0      )
							A						   =   pipe(
							    prompt=A_  ,image=A_  ,strength=0.75  ,guidance_scale=7.5  ,num_inference_steps=20  ,generator=A_  ,output_type='np'  ,)
							A						   =   output.images
							A						   =   images[0, 255:258, 383:386, -1]

							assert images.shape == (1, 512, 768, 3)
							A						   =   np.array([0.80_43, 0.9_26, 0.95_81, 0.81_19, 0.89_54, 0.9_13, 0.72_09, 0.74_63, 0.74_31]      )
							# TODO: lower the tolerance after finding the cause of onnxruntime reproducibility issues

							assert np.abs(image_slice.flatten() - expected_slice      ).max() < 2e-2