




'''simple docstring'''






import collections
import inspect
import unittest

from transformers import DinatConfig
from transformers.testing_utils import require_natten, require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_backbone_common import BackboneTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
				import torch
				from torch import nn

				from transformers import DinatBackbone, DinatForImageClassification, DinatModel
				from transformers.models.dinat.modeling_dinat import DINAT_PRETRAINED_MODEL_ARCHIVE_LIST

if is_vision_available():
				from PIL import Image

				from transformers import AutoImageProcessor



class  A		:




				'''simple docstring'''





				def __init__(self			,  _UpperCAmelCase			,  _UpperCAmelCase=1_3			,  _UpperCAmelCase=6_4			,  _UpperCAmelCase=4			,  _UpperCAmelCase=3			,  _UpperCAmelCase=1_6			,  _UpperCAmelCase=[1, 2, 1]			,  _UpperCAmelCase=[2, 4, 8]			,  _UpperCAmelCase=3			,  _UpperCAmelCase=[[3], [1, 2], [1]]			,  _UpperCAmelCase=2.0			,  _UpperCAmelCase=True			,  _UpperCAmelCase=0.0			,  _UpperCAmelCase=0.0			,  _UpperCAmelCase=0.1			,  _UpperCAmelCase="gelu"			,  _UpperCAmelCase=True			,  _UpperCAmelCase=0.02			,  _UpperCAmelCase=1E-5			,  _UpperCAmelCase=True			,  _UpperCAmelCase=None			,  _UpperCAmelCase=True			,  _UpperCAmelCase=1_0			,  _UpperCAmelCase=["stage1", "stage2"]			,  _UpperCAmelCase=[1, 2]			,  )     ->	List[str]:
							__UpperCamelCase				:      int									=       parent
							__UpperCamelCase				:      Optional[int]									=       batch_size
							__UpperCamelCase				:      Optional[int]									=       image_size
							__UpperCamelCase				:      Any									=       patch_size
							__UpperCamelCase				:      List[Any]									=       num_channels
							__UpperCamelCase				:      List[Any]									=       embed_dim
							__UpperCamelCase				:      Union[str, Any]									=       depths
							__UpperCamelCase				:      int									=       num_heads
							__UpperCamelCase				:      Optional[Any]									=       kernel_size
							__UpperCamelCase				:      str									=       dilations
							__UpperCamelCase				:      List[str]									=       mlp_ratio
							__UpperCamelCase				:      int									=       qkv_bias
							__UpperCamelCase				:      str									=       hidden_dropout_prob
							__UpperCamelCase				:      Union[str, Any]									=       attention_probs_dropout_prob
							__UpperCamelCase				:      Union[str, Any]									=       drop_path_rate
							__UpperCamelCase				:      int									=       hidden_act
							__UpperCamelCase				:      Union[str, Any]									=       patch_norm
							__UpperCamelCase				:      Union[str, Any]									=       layer_norm_eps
							__UpperCamelCase				:      Dict									=       initializer_range
							__UpperCamelCase				:      Optional[int]									=       is_training
							__UpperCamelCase				:      Tuple									=       scope
							__UpperCamelCase				:      Dict									=       use_labels
							__UpperCamelCase				:      List[Any]									=       num_labels
							__UpperCamelCase				:      Optional[int]									=       out_features
							__UpperCamelCase				:      Optional[int]									=       out_indices
				def 	a_	(self      )     ->	Tuple:
							__UpperCamelCase				:      Optional[Any]									=       floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]      )

							__UpperCamelCase				:      Tuple									=       None
							if self.use_labels:
										__UpperCamelCase				:      Optional[int]									=       ids_tensor([self.batch_size]			,  self.num_labels      )

							__UpperCamelCase				:      Optional[Any]									=       self.get_config()

							return config, pixel_values, labels
				def 	a_	(self      )     ->	Tuple:
							return DinatConfig(
							    num_labels=self.num_labels			,  image_size=self.image_size			,  patch_size=self.patch_size			,  num_channels=self.num_channels			,  embed_dim=self.embed_dim			,  depths=self.depths			,  num_heads=self.num_heads			,  kernel_size=self.kernel_size			,  dilations=self.dilations			,  mlp_ratio=self.mlp_ratio			,  qkv_bias=self.qkv_bias			,  hidden_dropout_prob=self.hidden_dropout_prob			,  attention_probs_dropout_prob=self.attention_probs_dropout_prob			,  drop_path_rate=self.drop_path_rate			,  hidden_act=self.hidden_act			,  patch_norm=self.patch_norm			,  layer_norm_eps=self.layer_norm_eps			,  initializer_range=self.initializer_range			,  out_features=self.out_features			,  out_indices=self.out_indices			,  )
				def 	a_	(self			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase      )     ->	Tuple:
							__UpperCamelCase				:      int									=       DinatModel(config=_UpperCAmelCase      )
							model.to(_UpperCAmelCase      )
							model.eval()
							__UpperCamelCase				:      List[Any]									=       model(_UpperCAmelCase      )

							__UpperCamelCase				:      Union[str, Any]									=       (config.image_size // config.patch_size) // (2 ** (len(config.depths      ) - 1))
							__UpperCamelCase				:      Any									=       int(config.embed_dim * 2 ** (len(config.depths      ) - 1)      )

							self.parent.assertEqual(
							    result.last_hidden_state.shape			,  (self.batch_size, expected_height, expected_width, expected_dim)      )
				def 	a_	(self			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase      )     ->	Tuple:
							__UpperCamelCase				:      Optional[int]									=       DinatForImageClassification(_UpperCAmelCase      )
							model.to(_UpperCAmelCase      )
							model.eval()
							__UpperCamelCase				:      Union[str, Any]									=       model(_UpperCAmelCase			,  labels=_UpperCAmelCase      )
							self.parent.assertEqual(result.logits.shape			,  (self.batch_size, self.num_labels)      )

							# test greyscale images
							__UpperCamelCase				:      List[Any]									=       1
							__UpperCamelCase				:      str									=       DinatForImageClassification(_UpperCAmelCase      )
							model.to(_UpperCAmelCase      )
							model.eval()

							__UpperCamelCase				:      Union[str, Any]									=       floats_tensor([self.batch_size, 1, self.image_size, self.image_size]      )
							__UpperCamelCase				:      Dict									=       model(_UpperCAmelCase      )
							self.parent.assertEqual(result.logits.shape			,  (self.batch_size, self.num_labels)      )
				def 	a_	(self			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase      )     ->	List[Any]:
							__UpperCamelCase				:      Any									=       DinatBackbone(config=_UpperCAmelCase      )
							model.to(_UpperCAmelCase      )
							model.eval()
							__UpperCamelCase				:      Tuple									=       model(_UpperCAmelCase      )

							# verify hidden states
							self.parent.assertEqual(len(result.feature_maps      )			,  len(config.out_features      )      )
							self.parent.assertListEqual(list(result.feature_maps[0].shape      )			,  [self.batch_size, model.channels[0], 1_6, 1_6]      )

							# verify channels
							self.parent.assertEqual(len(model.channels      )			,  len(config.out_features      )      )

							# verify backbone works with out_features=None
							__UpperCamelCase				:      str									=       None
							__UpperCamelCase				:      List[str]									=       DinatBackbone(config=_UpperCAmelCase      )
							model.to(_UpperCAmelCase      )
							model.eval()
							__UpperCamelCase				:      int									=       model(_UpperCAmelCase      )

							# verify feature maps
							self.parent.assertEqual(len(result.feature_maps      )			,  1      )
							self.parent.assertListEqual(list(result.feature_maps[0].shape      )			,  [self.batch_size, model.channels[-1], 4, 4]      )

							# verify channels
							self.parent.assertEqual(len(model.channels      )			,  1      )





				def 	a_	(self      )     ->	List[str]:
							__UpperCamelCase				:      Optional[Any]									=       self.prepare_config_and_inputs()
							__UpperCamelCase		, __UpperCamelCase		, __UpperCamelCase				:      List[str]									=       config_and_inputs
							__UpperCamelCase				:      List[str]									=       {"pixel_values": pixel_values}
							return config, inputs_dict







@require_natten
@require_torch
class  A		(			SCREAMING_SNAKE_CASE__      ,							SCREAMING_SNAKE_CASE__      ,							unittest.TestCase		):




				'''simple docstring'''





				A				     =    (
				    (
				        DinatModel,
				        DinatForImageClassification,
				        DinatBackbone,
				    )
				    if is_torch_available()
				    else ()
				)
				A				     =    (
				    {"feature-extraction": DinatModel, "image-classification": DinatForImageClassification}
				    if is_torch_available()
				    else {}
				)
				A				     =    False

				A				     =    False
				A				     =    False
				A				     =    False
				A				     =    False
				def 	a_	(self      )     ->	List[str]:
							__UpperCamelCase				:      Dict									=       DinatModelTester(self      )
							__UpperCamelCase				:      int									=       ConfigTester(self			,  config_class=_UpperCAmelCase			,  embed_dim=3_7      )
				def 	a_	(self      )     ->	Any:
							self.create_and_test_config_common_properties()
							self.config_tester.create_and_test_config_to_json_string()
							self.config_tester.create_and_test_config_to_json_file()
							self.config_tester.create_and_test_config_from_and_save_pretrained()
							self.config_tester.create_and_test_config_with_num_labels()
							self.config_tester.check_config_can_be_init_without_params()
							self.config_tester.check_config_arguments_init()
				def 	a_	(self      )     ->	Any:
							return
				def 	a_	(self      )     ->	Any:
							__UpperCamelCase				:      Optional[int]									=       self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_model(*_UpperCAmelCase      )
				def 	a_	(self      )     ->	List[Any]:
							__UpperCamelCase				:      Optional[Any]									=       self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_for_image_classification(*_UpperCAmelCase      )
				def 	a_	(self      )     ->	List[str]:
							__UpperCamelCase				:      Dict									=       self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_backbone(*_UpperCAmelCase      )
				@unittest.skip(reason="Dinat does not use inputs_embeds"      )
				def 	a_	(self      )     ->	Optional[Any]:
							pass
				@unittest.skip(reason="Dinat does not use feedforward chunking"      )
				def 	a_	(self      )     ->	Any:
							pass
				def 	a_	(self      )     ->	List[str]:
							__UpperCamelCase		, __UpperCamelCase				:      int									=       self.model_tester.prepare_config_and_inputs_for_common()

							for model_class in self.all_model_classes:
										__UpperCamelCase				:      Dict									=       model_class(_UpperCAmelCase      )
										self.assertIsInstance(model.get_input_embeddings()			,  (nn.Module)      )
										__UpperCamelCase				:      Optional[int]									=       model.get_output_embeddings()
										self.assertTrue(x is None or isinstance(_UpperCAmelCase			,  nn.Linear      )      )
				def 	a_	(self      )     ->	int:
							__UpperCamelCase		, __UpperCamelCase				:      str									=       self.model_tester.prepare_config_and_inputs_for_common()

							for model_class in self.all_model_classes:
										__UpperCamelCase				:      List[str]									=       model_class(_UpperCAmelCase      )
										__UpperCamelCase				:      List[str]									=       inspect.signature(model.forward      )
										# signature.parameters is an OrderedDict => so arg_names order is deterministic
										__UpperCamelCase				:      Optional[int]									=       [*signature.parameters.keys()]

										__UpperCamelCase				:      Optional[Any]									=       ["pixel_values"]
										self.assertListEqual(arg_names[:1]			,  _UpperCAmelCase      )
				def 	a_	(self      )     ->	Tuple:
							self.skipTest("Dinat's attention operation is handled entirely by NATTEN."      )
				def 	a_	(self			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase      )     ->	Optional[int]:
							__UpperCamelCase				:      List[str]									=       model_class(_UpperCAmelCase      )
							model.to(_UpperCAmelCase      )
							model.eval()

							with torch.no_grad():
										__UpperCamelCase				:      Optional[int]									=       model(**self._prepare_for_class(_UpperCAmelCase			,  _UpperCAmelCase      )      )

							__UpperCamelCase				:      List[Any]									=       outputs.hidden_states

							__UpperCamelCase				:      Dict									=       getattr(
							    self.model_tester			,  "expected_num_hidden_layers"			,  len(self.model_tester.depths      ) + 1      )
							self.assertEqual(len(_UpperCAmelCase      )			,  _UpperCAmelCase      )

							# Dinat has a different seq_length
							__UpperCamelCase				:      List[str]									=       (
							    config.patch_size
							    if isinstance(config.patch_size			,  collections.abc.Iterable      )
							    else (config.patch_size, config.patch_size)
							)

							__UpperCamelCase				:      str									=       image_size[0] // patch_size[0]
							__UpperCamelCase				:      Dict									=       image_size[1] // patch_size[1]

							self.assertListEqual(
							    list(hidden_states[0].shape[-3:]      )			,  [height, width, self.model_tester.embed_dim]			,  )

							if model_class.__name__ != "DinatBackbone":
										__UpperCamelCase				:      Union[str, Any]									=       outputs.reshaped_hidden_states
										self.assertEqual(len(_UpperCAmelCase      )			,  _UpperCAmelCase      )

										__UpperCamelCase		, __UpperCamelCase		, __UpperCamelCase		, __UpperCamelCase				:      Tuple									=       reshaped_hidden_states[0].shape
										__UpperCamelCase				:      Dict									=       (
										    reshaped_hidden_states[0].view(_UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase      ).permute(0			,  2			,  3			,  1      )
										)
										self.assertListEqual(
										    list(reshaped_hidden_states.shape[-3:]      )			,  [height, width, self.model_tester.embed_dim]			,  )
				def 	a_	(self      )     ->	int:
							__UpperCamelCase		, __UpperCamelCase				:      Tuple									=       self.model_tester.prepare_config_and_inputs_for_common()

							__UpperCamelCase				:      Optional[Any]									=       (
							    self.model_tester.image_size
							    if isinstance(self.model_tester.image_size			,  collections.abc.Iterable      )
							    else (self.model_tester.image_size, self.model_tester.image_size)
							)

							for model_class in self.all_model_classes:
										__UpperCamelCase				:      Tuple									=       True
										self.check_hidden_states_output(_UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase      )

										# check that output_hidden_states also work using config
										del inputs_dict["output_hidden_states"]
										__UpperCamelCase				:      List[str]									=       True

										self.check_hidden_states_output(_UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase      )
				@slow
				def 	a_	(self      )     ->	str:
							for model_name in DINAT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
										__UpperCamelCase				:      Optional[Any]									=       DinatModel.from_pretrained(_UpperCAmelCase      )
										self.assertIsNotNone(_UpperCAmelCase      )





				def 	a_	(self      )     ->	Tuple:
							__UpperCamelCase		, __UpperCamelCase				:      Dict									=       self.model_tester.prepare_config_and_inputs_for_common()

							__UpperCamelCase				:      Union[str, Any]									=       _config_zero_init(_UpperCAmelCase      )
							for model_class in self.all_model_classes:
										__UpperCamelCase				:      List[str]									=       model_class(config=_UpperCAmelCase      )
										for name, param in model.named_parameters():
													if "embeddings" not in name and param.requires_grad:
																self.assertIn(
																    ((param.data.mean() * 1E9).round() / 1E9).item()			,  [0.0, 1.0]			,  msg=f"Parameter {name} of model {model_class} seems not properly initialized"			,  )







@require_natten
@require_vision
@require_torch
class  A		(			unittest.TestCase		):




				'''simple docstring'''





				@cached_property
				def 	a_	(self      )     ->	Union[str, Any]:
							return AutoImageProcessor.from_pretrained("shi-labs/dinat-mini-in1k-224"      ) if is_vision_available() else None





				@slow
				def 	a_	(self      )     ->	Optional[int]:
							__UpperCamelCase				:      List[Any]									=       DinatForImageClassification.from_pretrained("shi-labs/dinat-mini-in1k-224"      ).to(_UpperCAmelCase      )
							__UpperCamelCase				:      Union[str, Any]									=       self.default_image_processor

							__UpperCamelCase				:      Dict									=       Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"      )
							__UpperCamelCase				:      Tuple									=       image_processor(images=_UpperCAmelCase			,  return_tensors="pt"      ).to(_UpperCAmelCase      )

							# forward pass
							with torch.no_grad():
										__UpperCamelCase				:      Any									=       model(**_UpperCAmelCase      )

							# verify the logits
							__UpperCamelCase				:      Optional[int]									=       torch.Size((1, 1_0_0_0)      )
							self.assertEqual(outputs.logits.shape			,  _UpperCAmelCase      )
							__UpperCamelCase				:      Optional[Any]									=       torch.tensor([-0.1_545, -0.7_667, 0.4_642]      ).to(_UpperCAmelCase      )
							self.assertTrue(torch.allclose(outputs.logits[0, :3]			,  _UpperCAmelCase			,  atol=1E-4      )      )







@require_torch
@require_natten
class  A		(			unittest.TestCase      ,							SCREAMING_SNAKE_CASE__		):




				'''simple docstring'''





				A				     =    (DinatBackbone,) if is_torch_available() else ()
				A				     =    DinatConfig
				def 	a_	(self      )     ->	List[str]:
							__UpperCamelCase				:      Union[str, Any]									=       DinatModelTester(self      )









'''simple docstring'''






from typing import Any, Callable, Dict, List, Optional, Union

import PIL.Image
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMScheduler,
    DiffusionPipeline,
    LMSDiscreteScheduler,
    PNDMScheduler,
    StableDiffusionImgaImgPipeline,
    StableDiffusionInpaintPipelineLegacy,
    StableDiffusionPipeline,
    UNetaDConditionModel,
)
from diffusers.configuration_utils import FrozenDict
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
from diffusers.utils import deprecate, logging


_lowerCAmelCase				     = logging.get_logger(__name__)  # pylint: disable=invalid-name



class  A		(			SCREAMING_SNAKE_CASE__		):




				'''simple docstring'''





				A				     =    ["safety_checker", "feature_extractor"]
				def __init__(self			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase = True			,  )     ->	List[str]:
							super().__init__()
							if hasattr(scheduler.config			,  "steps_offset"      ) and scheduler.config.steps_offset != 1:
										__UpperCamelCase				:      List[str]									=       (
										    f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
										    f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
										    "to update the config accordingly as leaving `steps_offset` might led to incorrect results"
										    " in future versions. If you have downloaded this checkpoint from the Hugging Face Hub,"
										    " it would be very nice if you could open a Pull request for the `scheduler/scheduler_config.json`"
										    " file"
										)
										deprecate("steps_offset!=1"			,  "1.0.0"			,  _UpperCAmelCase			,  standard_warn=_UpperCAmelCase      )
										__UpperCamelCase				:      str									=       dict(scheduler.config      )
										__UpperCamelCase				:      Optional[Any]									=       1
										__UpperCamelCase				:      Dict									=       FrozenDict(_UpperCAmelCase      )

							self.register_modules(
							    vae=_UpperCAmelCase			,  text_encoder=_UpperCAmelCase			,  tokenizer=_UpperCAmelCase			,  unet=_UpperCAmelCase			,  scheduler=_UpperCAmelCase			,  safety_checker=_UpperCAmelCase			,  feature_extractor=_UpperCAmelCase			,  )
							self.register_to_config(requires_safety_checker=_UpperCAmelCase      )
				@property
				def 	a_	(self      )     ->	Dict[str, Any]:
							return {k: getattr(self			,  _UpperCAmelCase      ) for k in self.config.keys() if not k.startswith("_"      )}
				def 	a_	(self			,  _UpperCAmelCase = "auto"      )     ->	List[str]:
							if slice_size == "auto":
										# half the attention head size is usually a good trade-off between
										# speed and memory
										__UpperCamelCase				:      Dict									=       self.unet.config.attention_head_dim // 2
							self.unet.set_attention_slice(_UpperCAmelCase      )
				def 	a_	(self      )     ->	Dict:
							self.enable_attention_slicing(_UpperCAmelCase      )
				@torch.no_grad()
				def 	a_	(self			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase = 0.8			,  _UpperCAmelCase = 5_0			,  _UpperCAmelCase = 7.5			,  _UpperCAmelCase = None			,  _UpperCAmelCase = 1			,  _UpperCAmelCase = 0.0			,  _UpperCAmelCase = None			,  _UpperCAmelCase = "pil"			,  _UpperCAmelCase = True			,  _UpperCAmelCase = None			,  _UpperCAmelCase = 1			,  )     ->	List[str]:
							# For more information on how this function works, please see: https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion#diffusers.StableDiffusionImg2ImgPipeline
							return StableDiffusionInpaintPipelineLegacy(**self.components      )(
							    prompt=_UpperCAmelCase			,  image=_UpperCAmelCase			,  mask_image=_UpperCAmelCase			,  strength=_UpperCAmelCase			,  num_inference_steps=_UpperCAmelCase			,  guidance_scale=_UpperCAmelCase			,  negative_prompt=_UpperCAmelCase			,  num_images_per_prompt=_UpperCAmelCase			,  eta=_UpperCAmelCase			,  generator=_UpperCAmelCase			,  output_type=_UpperCAmelCase			,  return_dict=_UpperCAmelCase			,  callback=_UpperCAmelCase			,  )
				@torch.no_grad()
				def 	a_	(self			,  _UpperCAmelCase			,  _UpperCAmelCase			,  _UpperCAmelCase = 0.8			,  _UpperCAmelCase = 5_0			,  _UpperCAmelCase = 7.5			,  _UpperCAmelCase = None			,  _UpperCAmelCase = 1			,  _UpperCAmelCase = 0.0			,  _UpperCAmelCase = None			,  _UpperCAmelCase = "pil"			,  _UpperCAmelCase = True			,  _UpperCAmelCase = None			,  _UpperCAmelCase = 1			,  **_UpperCAmelCase			,  )     ->	Optional[Any]:
							# For more information on how this function works, please see: https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion#diffusers.StableDiffusionImg2ImgPipeline
							return StableDiffusionImgaImgPipeline(**self.components      )(
							    prompt=_UpperCAmelCase			,  image=_UpperCAmelCase			,  strength=_UpperCAmelCase			,  num_inference_steps=_UpperCAmelCase			,  guidance_scale=_UpperCAmelCase			,  negative_prompt=_UpperCAmelCase			,  num_images_per_prompt=_UpperCAmelCase			,  eta=_UpperCAmelCase			,  generator=_UpperCAmelCase			,  output_type=_UpperCAmelCase			,  return_dict=_UpperCAmelCase			,  callback=_UpperCAmelCase			,  callback_steps=_UpperCAmelCase			,  )





				@torch.no_grad()
				def 	a_	(self			,  _UpperCAmelCase			,  _UpperCAmelCase = 5_1_2			,  _UpperCAmelCase = 5_1_2			,  _UpperCAmelCase = 5_0			,  _UpperCAmelCase = 7.5			,  _UpperCAmelCase = None			,  _UpperCAmelCase = 1			,  _UpperCAmelCase = 0.0			,  _UpperCAmelCase = None			,  _UpperCAmelCase = None			,  _UpperCAmelCase = "pil"			,  _UpperCAmelCase = True			,  _UpperCAmelCase = None			,  _UpperCAmelCase = 1			,  )     ->	Union[str, Any]:
							# For more information on how this function https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion#diffusers.StableDiffusionPipeline
							return StableDiffusionPipeline(**self.components      )(
							    prompt=_UpperCAmelCase			,  height=_UpperCAmelCase			,  width=_UpperCAmelCase			,  num_inference_steps=_UpperCAmelCase			,  guidance_scale=_UpperCAmelCase			,  negative_prompt=_UpperCAmelCase			,  num_images_per_prompt=_UpperCAmelCase			,  eta=_UpperCAmelCase			,  generator=_UpperCAmelCase			,  latents=_UpperCAmelCase			,  output_type=_UpperCAmelCase			,  return_dict=_UpperCAmelCase			,  callback=_UpperCAmelCase			,  callback_steps=_UpperCAmelCase			,  )



