



'''simple docstring'''




import unittest

from transformers import MPNetConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
							import torch

							from transformers import (
							    MPNetForMaskedLM,
							    MPNetForMultipleChoice,
							    MPNetForQuestionAnswering,
							    MPNetForSequenceClassification,
							    MPNetForTokenClassification,
							    MPNetModel,
							)

class 			UpperCamelCase_ :





	def __init__(  self		,		A		,		A=13		,		A=7		,		A=True		,		A=True		,		A=False		,		A=True		,		A=99		,		A=64		,		A=5		,		A=4		,		A=64		,		A="gelu"		,		A=0.1		,		A=0.1		,		A=512		,		A=16		,		A=2		,		A=0.0_2		,		A=3		,		A=4		,		A=None		,		)			->			Tuple:
								UpperCAmelCase     :		Union[str, Any]							     =		parent
								UpperCAmelCase     :		Union[str, Any]							     =		batch_size
								UpperCAmelCase     :		Dict							     =		seq_length
								UpperCAmelCase     :		Optional[int]							     =		is_training
								UpperCAmelCase     :		int							     =		use_input_mask
								UpperCAmelCase     :		Union[str, Any]							     =		use_token_type_ids
								UpperCAmelCase     :		Optional[Any]							     =		use_labels
								UpperCAmelCase     :		List[str]							     =		vocab_size
								UpperCAmelCase     :		str							     =		hidden_size
								UpperCAmelCase     :		Optional[Any]							     =		num_hidden_layers
								UpperCAmelCase     :		Optional[int]							     =		num_attention_heads
								UpperCAmelCase     :		Dict							     =		intermediate_size
								UpperCAmelCase     :		Optional[int]							     =		hidden_act
								UpperCAmelCase     :		Tuple							     =		hidden_dropout_prob
								UpperCAmelCase     :		Optional[int]							     =		attention_probs_dropout_prob
								UpperCAmelCase     :		Optional[int]							     =		max_position_embeddings
								UpperCAmelCase     :		List[Any]							     =		type_vocab_size
								UpperCAmelCase     :		Optional[int]							     =		type_sequence_label_size
								UpperCAmelCase     :		Any							     =		initializer_range
								UpperCAmelCase     :		Union[str, Any]							     =		num_labels
								UpperCAmelCase     :		List[Any]							     =		num_choices
								UpperCAmelCase     :		List[str]							     =		scope





	def  _lowercase(  self    )			->			List[str]:
								return MPNetConfig.from_pretrained("""microsoft/mpnet-base"""    )





	def  _lowercase(  self    )			->			Optional[int]:
								UpperCAmelCase     :		str							     =		ids_tensor([self.batch_size, self.seq_length]		,		self.vocab_size    )

								UpperCAmelCase     :		Union[str, Any]							     =		None
								if self.use_input_mask:
															UpperCAmelCase     :		str							     =		random_attention_mask([self.batch_size, self.seq_length]    )

								UpperCAmelCase     :		Optional[Any]							     =		None
								UpperCAmelCase     :		List[Any]							     =		None
								UpperCAmelCase     :		int							     =		None
								if self.use_labels:
															UpperCAmelCase     :		int							     =		ids_tensor([self.batch_size]		,		self.type_sequence_label_size    )
															UpperCAmelCase     :		Union[str, Any]							     =		ids_tensor([self.batch_size, self.seq_length]		,		self.num_labels    )
															UpperCAmelCase     :		Optional[Any]							     =		ids_tensor([self.batch_size]		,		self.num_choices    )

								UpperCAmelCase     :		Dict							     =		self.get_config()
								return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels





	def  _lowercase(  self    )			->			List[str]:
								return MPNetConfig(
								    vocab_size=self.vocab_size		,		hidden_size=self.hidden_size		,		num_hidden_layers=self.num_hidden_layers		,		num_attention_heads=self.num_attention_heads		,		intermediate_size=self.intermediate_size		,		hidden_act=self.hidden_act		,		hidden_dropout_prob=self.hidden_dropout_prob		,		attention_probs_dropout_prob=self.attention_probs_dropout_prob		,		max_position_embeddings=self.max_position_embeddings		,		initializer_range=self.initializer_range		,		)





	def  _lowercase(  self		,		A		,		A		,		A		,		A		,		A		,		A    )			->			Optional[Any]:
								UpperCAmelCase     :		Any							     =		MPNetModel(config=UpperCAmelCase__    )
								model.to(UpperCAmelCase__    )
								model.eval()
								UpperCAmelCase     :		Union[str, Any]							     =		model(UpperCAmelCase__		,		UpperCAmelCase__    )
								UpperCAmelCase     :		Any							     =		model(UpperCAmelCase__    )
								self.parent.assertEqual(result.last_hidden_state.shape		,		(self.batch_size, self.seq_length, self.hidden_size)    )
								self.parent.assertEqual(result.pooler_output.shape		,		(self.batch_size, self.hidden_size)    )





	def  _lowercase(  self		,		A		,		A		,		A		,		A		,		A		,		A    )			->			Optional[int]:
								UpperCAmelCase     :		Union[str, Any]							     =		MPNetForQuestionAnswering(config=UpperCAmelCase__    )
								model.to(UpperCAmelCase__    )
								model.eval()
								UpperCAmelCase     :		int							     =		model(
								    UpperCAmelCase__		,		attention_mask=UpperCAmelCase__		,		start_positions=UpperCAmelCase__		,		end_positions=UpperCAmelCase__		,		)
								self.parent.assertEqual(result.start_logits.shape		,		(self.batch_size, self.seq_length)    )
								self.parent.assertEqual(result.end_logits.shape		,		(self.batch_size, self.seq_length)    )





	def  _lowercase(  self		,		A		,		A		,		A		,		A		,		A		,		A    )			->			int:
								UpperCAmelCase     :		Optional[int]							     =		self.num_labels
								UpperCAmelCase     :		List[Any]							     =		MPNetForSequenceClassification(UpperCAmelCase__    )
								model.to(UpperCAmelCase__    )
								model.eval()
								UpperCAmelCase     :		List[Any]							     =		model(UpperCAmelCase__		,		attention_mask=UpperCAmelCase__		,		labels=UpperCAmelCase__    )
								self.parent.assertEqual(result.logits.shape		,		(self.batch_size, self.num_labels)    )





	def  _lowercase(  self		,		A		,		A		,		A		,		A		,		A		,		A    )			->			List[str]:
								UpperCAmelCase     :		str							     =		self.num_choices
								UpperCAmelCase     :		int							     =		MPNetForMultipleChoice(config=UpperCAmelCase__    )
								model.to(UpperCAmelCase__    )
								model.eval()
								UpperCAmelCase     :		Optional[int]							     =		input_ids.unsqueeze(1    ).expand(-1		,		self.num_choices		,		-1    ).contiguous()
								UpperCAmelCase     :		Tuple							     =		input_mask.unsqueeze(1    ).expand(-1		,		self.num_choices		,		-1    ).contiguous()
								UpperCAmelCase     :		str							     =		model(
								    UpperCAmelCase__		,		attention_mask=UpperCAmelCase__		,		labels=UpperCAmelCase__		,		)
								self.parent.assertEqual(result.logits.shape		,		(self.batch_size, self.num_choices)    )





	def  _lowercase(  self		,		A		,		A		,		A		,		A		,		A		,		A    )			->			str:
								UpperCAmelCase     :		Dict							     =		self.num_labels
								UpperCAmelCase     :		Optional[int]							     =		MPNetForTokenClassification(config=UpperCAmelCase__    )
								model.to(UpperCAmelCase__    )
								model.eval()
								UpperCAmelCase     :		int							     =		model(UpperCAmelCase__		,		attention_mask=UpperCAmelCase__		,		labels=UpperCAmelCase__    )
								self.parent.assertEqual(result.logits.shape		,		(self.batch_size, self.seq_length, self.num_labels)    )






	def  _lowercase(  self    )			->			Union[str, Any]:
								UpperCAmelCase     :		Any							     =		self.prepare_config_and_inputs()
								((UpperCAmelCase)     ,     (UpperCAmelCase)     ,     (UpperCAmelCase)     ,     (UpperCAmelCase)     ,     (UpperCAmelCase)     ,     (UpperCAmelCase))     :		List[Any]							     =		config_and_inputs
								UpperCAmelCase     :		Dict							     =		{"""input_ids""": input_ids, """attention_mask""": input_mask}
								return config, inputs_dict




@require_torch
class 			UpperCamelCase_ (							__magic_name__      ,     __magic_name__      ,     unittest.TestCase			):
	lowercase          = (
	    (
	        MPNetForMaskedLM,
	        MPNetForMultipleChoice,
	        MPNetForQuestionAnswering,
	        MPNetForSequenceClassification,
	        MPNetForTokenClassification,
	        MPNetModel,
	    )
	    if is_torch_available()
	    else ()
	)
	lowercase          = (
	    {
	        "feature-extraction": MPNetModel,
	        "fill-mask": MPNetForMaskedLM,
	        "question-answering": MPNetForQuestionAnswering,
	        "text-classification": MPNetForSequenceClassification,
	        "token-classification": MPNetForTokenClassification,
	        "zero-shot": MPNetForSequenceClassification,
	    }
	    if is_torch_available()
	    else {}
	)
	lowercase          = False
	lowercase          = True





	def  _lowercase(  self    )			->			Any:
								UpperCAmelCase     :		int							     =		MPNetModelTester(self    )
								UpperCAmelCase     :		Dict							     =		ConfigTester(self		,		config_class=UpperCAmelCase__		,		hidden_size=37    )





	def  _lowercase(  self    )			->			Tuple:
								self.config_tester.run_common_tests()





	def  _lowercase(  self    )			->			Any:
								UpperCAmelCase     :		Tuple							     =		self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mpnet_model(*UpperCAmelCase__    )





	def  _lowercase(  self    )			->			Union[str, Any]:
								UpperCAmelCase     :		int							     =		self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mpnet_for_sequence_classification(*UpperCAmelCase__    )





	def  _lowercase(  self    )			->			Any:
								UpperCAmelCase     :		Any							     =		self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mpnet_for_multiple_choice(*UpperCAmelCase__    )





	def  _lowercase(  self    )			->			Dict:
								UpperCAmelCase     :		str							     =		self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mpnet_for_token_classification(*UpperCAmelCase__    )






	def  _lowercase(  self    )			->			Optional[int]:
								UpperCAmelCase     :		Union[str, Any]							     =		self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_mpnet_for_question_answering(*UpperCAmelCase__    )




@require_torch
class 			UpperCamelCase_ (							unittest.TestCase			):





	@slow
	def  _lowercase(  self    )			->			Optional[int]:
								UpperCAmelCase     :		List[Any]							     =		MPNetModel.from_pretrained("""microsoft/mpnet-base"""    )
								UpperCAmelCase     :		Optional[Any]							     =		torch.tensor([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 1588, 2]]    )
								UpperCAmelCase     :		int							     =		model(UpperCAmelCase__    )[0]
								UpperCAmelCase     :		Any							     =		torch.Size((1, 11, 768)    )
								self.assertEqual(output.shape		,		UpperCAmelCase__    )
								UpperCAmelCase     :		Any							     =		torch.tensor(
								    [[[-0.0_5_5_0, 0.1_9_4_3, -0.0_7_4_0], [-0.0_5_6_2, 0.2_2_1_1, -0.0_5_7_9], [-0.0_4_3_7, 0.3_3_3_7, -0.0_6_4_1]]]    )
								# compare the actual values for a slice.
								self.assertTrue(torch.allclose(output[:, :3, :3]		,		UpperCAmelCase__		,		atol=1e-4    )    )




"""simple docstring"""





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

import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMScheduler,
    DiffusionPipeline,
    LMSDiscreteScheduler,
    PNDMScheduler,
    StableDiffusionPipeline,
    UNetaDConditionModel,
)
from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker


_a       =							'CompVis/stable-diffusion-v1-1'
_a       =							'CompVis/stable-diffusion-v1-2'
_a       =							'CompVis/stable-diffusion-v1-3'
_a       =							'CompVis/stable-diffusion-v1-4'




class 					_lowerCAmelCase  (	lowercase   ):







 """simple docstring"""







 def __init__(			self							:			Dict,					UpperCAmelCase__							:			AutoencoderKL,					UpperCAmelCase__							:			CLIPTextModel,					UpperCAmelCase__							:			CLIPTokenizer,					UpperCAmelCase__							:			UNetaDConditionModel,					UpperCAmelCase__							:			Union[DDIMScheduler, PNDMScheduler, LMSDiscreteScheduler],					UpperCAmelCase__							:			StableDiffusionSafetyChecker,					UpperCAmelCase__							:			CLIPImageProcessor,					UpperCAmelCase__							:			bool = True,					):
    super()._init_()

    __lowercase								=						StableDiffusionPipeline.from_pretrained(UpperCAmelCase__	)
    __lowercase								=						StableDiffusionPipeline.from_pretrained(UpperCAmelCase__	)
    __lowercase								=						StableDiffusionPipeline.from_pretrained(UpperCAmelCase__	)
    __lowercase								=						StableDiffusionPipeline(
        vae=UpperCAmelCase__,					text_encoder=UpperCAmelCase__,					tokenizer=UpperCAmelCase__,					unet=UpperCAmelCase__,					scheduler=UpperCAmelCase__,					safety_checker=UpperCAmelCase__,					feature_extractor=UpperCAmelCase__,					requires_safety_checker=UpperCAmelCase__,					)

    self.register_modules(pipelinea=self.pipea,					pipelinea=self.pipea,					pipelinea=self.pipea,					pipelinea=self.pipea	)


 @property
 def 					_lowercase (			self							:			List[str]	):
    return {k: getattr(self,					UpperCAmelCase__	) for k in self.config.keys() if not k.startswith("_"	)}


 def 					_lowercase (			self							:			Union[str, Any],					UpperCAmelCase__							:			Optional[Union[str, int]] = "auto"	):
    if slice_size == "auto":
       # half the attention head size is usually a good trade-off between
       # speed and memory
       __lowercase								=						self.unet.config.attention_head_dim // 2
    self.unet.set_attention_slice(UpperCAmelCase__	)


 def 					_lowercase (			self							:			List[str]	):
    self.enable_attention_slicing(UpperCAmelCase__	)


 @torch.no_grad()
 def 					_lowercase (			self							:			Optional[Any],					UpperCAmelCase__							:			Union[str, List[str]],					UpperCAmelCase__							:			int = 5_1_2,					UpperCAmelCase__							:			int = 5_1_2,					UpperCAmelCase__							:			int = 5_0,					UpperCAmelCase__							:			float = 7.5,					UpperCAmelCase__							:			Optional[Union[str, List[str]]] = None,					UpperCAmelCase__							:			Optional[int] = 1,					UpperCAmelCase__							:			float = 0.0,					UpperCAmelCase__							:			Optional[torch.Generator] = None,					UpperCAmelCase__							:			Optional[torch.FloatTensor] = None,					UpperCAmelCase__							:			Optional[str] = "pil",					UpperCAmelCase__							:			bool = True,					UpperCAmelCase__							:			Optional[Callable[[int, int, torch.FloatTensor], None]] = None,					UpperCAmelCase__							:			int = 1,					**UpperCAmelCase__							:			Tuple,					):
    return self.pipea(
        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__,					**UpperCAmelCase__,					)


 @torch.no_grad()
 def 					_lowercase (			self							:			Tuple,					UpperCAmelCase__							:			Union[str, List[str]],					UpperCAmelCase__							:			int = 5_1_2,					UpperCAmelCase__							:			int = 5_1_2,					UpperCAmelCase__							:			int = 5_0,					UpperCAmelCase__							:			float = 7.5,					UpperCAmelCase__							:			Optional[Union[str, List[str]]] = None,					UpperCAmelCase__							:			Optional[int] = 1,					UpperCAmelCase__							:			float = 0.0,					UpperCAmelCase__							:			Optional[torch.Generator] = None,					UpperCAmelCase__							:			Optional[torch.FloatTensor] = None,					UpperCAmelCase__							:			Optional[str] = "pil",					UpperCAmelCase__							:			bool = True,					UpperCAmelCase__							:			Optional[Callable[[int, int, torch.FloatTensor], None]] = None,					UpperCAmelCase__							:			int = 1,					**UpperCAmelCase__							:			str,					):
    return self.pipea(
        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__,					**UpperCAmelCase__,					)


 @torch.no_grad()
 def 					_lowercase (			self							:			str,					UpperCAmelCase__							:			Union[str, List[str]],					UpperCAmelCase__							:			int = 5_1_2,					UpperCAmelCase__							:			int = 5_1_2,					UpperCAmelCase__							:			int = 5_0,					UpperCAmelCase__							:			float = 7.5,					UpperCAmelCase__							:			Optional[Union[str, List[str]]] = None,					UpperCAmelCase__							:			Optional[int] = 1,					UpperCAmelCase__							:			float = 0.0,					UpperCAmelCase__							:			Optional[torch.Generator] = None,					UpperCAmelCase__							:			Optional[torch.FloatTensor] = None,					UpperCAmelCase__							:			Optional[str] = "pil",					UpperCAmelCase__							:			bool = True,					UpperCAmelCase__							:			Optional[Callable[[int, int, torch.FloatTensor], None]] = None,					UpperCAmelCase__							:			int = 1,					**UpperCAmelCase__							:			Any,					):
    return self.pipea(
        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__,					**UpperCAmelCase__,					)


 @torch.no_grad()
 def 					_lowercase (			self							:			Union[str, Any],					UpperCAmelCase__							:			Union[str, List[str]],					UpperCAmelCase__							:			int = 5_1_2,					UpperCAmelCase__							:			int = 5_1_2,					UpperCAmelCase__							:			int = 5_0,					UpperCAmelCase__							:			float = 7.5,					UpperCAmelCase__							:			Optional[Union[str, List[str]]] = None,					UpperCAmelCase__							:			Optional[int] = 1,					UpperCAmelCase__							:			float = 0.0,					UpperCAmelCase__							:			Optional[torch.Generator] = None,					UpperCAmelCase__							:			Optional[torch.FloatTensor] = None,					UpperCAmelCase__							:			Optional[str] = "pil",					UpperCAmelCase__							:			bool = True,					UpperCAmelCase__							:			Optional[Callable[[int, int, torch.FloatTensor], None]] = None,					UpperCAmelCase__							:			int = 1,					**UpperCAmelCase__							:			Optional[int],					):
    return self.pipea(
        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__,					**UpperCAmelCase__,					)



 @torch.no_grad()
 def 					_lowercase (			self							:			Optional[Any],					UpperCAmelCase__							:			Union[str, List[str]],					UpperCAmelCase__							:			int = 5_1_2,					UpperCAmelCase__							:			int = 5_1_2,					UpperCAmelCase__							:			int = 5_0,					UpperCAmelCase__							:			float = 7.5,					UpperCAmelCase__							:			Optional[Union[str, List[str]]] = None,					UpperCAmelCase__							:			Optional[int] = 1,					UpperCAmelCase__							:			float = 0.0,					UpperCAmelCase__							:			Optional[torch.Generator] = None,					UpperCAmelCase__							:			Optional[torch.FloatTensor] = None,					UpperCAmelCase__							:			Optional[str] = "pil",					UpperCAmelCase__							:			bool = True,					UpperCAmelCase__							:			Optional[Callable[[int, int, torch.FloatTensor], None]] = None,					UpperCAmelCase__							:			int = 1,					**UpperCAmelCase__							:			str,					):
    __lowercase								=						"cuda" if torch.cuda.is_available() else "cpu"
    self.to(UpperCAmelCase__	)

    # Checks if the height and width are divisible by 8 or not
    if height % 8 != 0 or width % 8 != 0:
       raise ValueError(F"""`height` and `width` must be divisible by 8 but are {height} and {width}."""	)

    # Get first result from Stable Diffusion Checkpoint v1.1
    __lowercase								=						self.textaimg_sda_a(
        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__,					**UpperCAmelCase__,					)

    # Get first result from Stable Diffusion Checkpoint v1.2
    __lowercase								=						self.textaimg_sda_a(
        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__,					**UpperCAmelCase__,					)

    # Get first result from Stable Diffusion Checkpoint v1.3
    __lowercase								=						self.textaimg_sda_a(
        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__,					**UpperCAmelCase__,					)

    # Get first result from Stable Diffusion Checkpoint v1.4
    __lowercase								=						self.textaimg_sda_a(
        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__,					**UpperCAmelCase__,					)

    # Get all result images into a single list and pass it via StableDiffusionPipelineOutput for final result
    return StableDiffusionPipelineOutput([resa[0], resa[0], resa[0], resa[0]]	)




