


import unittest

import numpy as np

from transformers import is_flax_available
from transformers.testing_utils import require_flax

from ..test_modeling_flax_common import ids_tensor


if is_flax_available():
  import jax
  import jax.numpy as jnp

  from transformers.generation import (
      FlaxForcedBOSTokenLogitsProcessor,
      FlaxForcedEOSTokenLogitsProcessor,
      FlaxLogitsProcessorList,
      FlaxMinLengthLogitsProcessor,
      FlaxTemperatureLogitsWarper,
      FlaxTopKLogitsWarper,
      FlaxTopPLogitsWarper,
  )







@require_flax
class   __lowerCAmelCase			(					unittest.TestCase  ):





   def 	_snake_case ( self					,			snake_case					,			snake_case      )				->  Optional[Any]:
      """simple docstring"""





      a__	:						str      		=  jnp.ones((batch_size, length)      ) / length
      return scores





   def 	_snake_case ( self      )				->  Any:
      """simple docstring"""





      a__	:						Union[str, Any]      		=  None
      a__	:						List[Any]      		=  20

      a__	:						str      		=  self._get_uniform_logits(batch_size=2					,			length=_A      )

      # tweak scores to not be uniform anymore
      a__	:						int      		=  scores.at[1, 5].set((1 / length) + 0.1      )  # peak, 1st batch
      a__	:						int      		=  scores.at[1, 10].set((1 / length) - 0.4      )  # valley, 1st batch

      # compute softmax
      a__	:						List[str]      		=  jax.nn.softmax(_A					,			axis=-1      )

      a__	:						Union[str, Any]      		=  FlaxTemperatureLogitsWarper(temperature=0.5      )
      a__	:						Optional[Any]      		=  FlaxTemperatureLogitsWarper(temperature=1.3      )

      a__	:						Tuple      		=  jax.nn.softmax(temp_dist_warper_sharper(_A					,			scores.copy()					,			cur_len=_A      )					,			axis=-1      )
      a__	:						str      		=  jax.nn.softmax(temp_dist_warper_smoother(_A					,			scores.copy()					,			cur_len=_A      )					,			axis=-1      )

      # uniform distribution stays uniform
      self.assertTrue(jnp.allclose(probs[0, :]					,			warped_prob_sharp[0, :]					,			atol=1E-3      )      )
      self.assertTrue(jnp.allclose(probs[0, :]					,			warped_prob_smooth[0, :]					,			atol=1E-3      )      )

      # sharp peaks get higher, valleys get lower
      self.assertLess(probs[1, :].max()					,			warped_prob_sharp[1, :].max()      )
      self.assertGreater(probs[1, :].min()					,			warped_prob_sharp[1, :].min()      )

      # smooth peaks get lower, valleys get higher
      self.assertGreater(probs[1, :].max()					,			warped_prob_smooth[1, :].max()      )
      self.assertLess(probs[1, :].min()					,			warped_prob_smooth[1, :].min()      )





   def 	_snake_case ( self      )				->  List[str]:
      """simple docstring"""





      a__	:						List[str]      		=  None
      a__	:						Dict      		=  10
      a__	:						Optional[Any]      		=  2

      # create ramp distribution
      a__	:						Union[str, Any]      		=  np.broadcast_to(np.arange(_A      )[None, :]					,			(batch_size, vocab_size)      ).copy()
      a__	:						Any      		=  ramp_logits[1:, : vocab_size // 2] + vocab_size

      a__	:						List[Any]      		=  FlaxTopKLogitsWarper(3      )

      a__	:						List[Any]      		=  top_k_warp(_A					,			_A					,			cur_len=_A      )

      # check that correct tokens are filtered
      self.assertListEqual(jnp.isinf(scores[0]      ).tolist()					,			7 * [True] + 3 * [False]      )
      self.assertListEqual(jnp.isinf(scores[1]      ).tolist()					,			2 * [True] + 3 * [False] + 5 * [True]      )

      # check special case
      a__	:						List[str]      		=  5
      a__	:						int      		=  FlaxTopKLogitsWarper(top_k=1					,			filter_value=0.0					,			min_tokens_to_keep=3      )

      a__	:						List[str]      		=  np.broadcast_to(np.arange(_A      )[None, :]					,			(batch_size, length)      ).copy()
      a__	:						Optional[int]      		=  top_k_warp_safety_check(_A					,			_A					,			cur_len=_A      )

      # min_tokens overwrites k: 3 tokens are kept => 2 tokens are nullified
      self.assertListEqual((scores == 0.0).sum(axis=-1      ).tolist()					,			[2, 2]      )





   def 	_snake_case ( self      )				->  Union[str, Any]:
      """simple docstring"""





      a__	:						Tuple      		=  None
      a__	:						Optional[Any]      		=  10
      a__	:						Optional[int]      		=  2

      # create distribution and take log (inverse to Softmax as taken in TopPLogitsWarper)
      a__	:						List[Any]      		=  np.log(np.array([[0.3, 0.1, 0.1, 0.5], [0.15, 0.3, 0.3, 0.25]]      )      )

      a__	:						Any      		=  FlaxTopPLogitsWarper(0.8      )
      a__	:						Any      		=  np.exp(top_p_warp(_A					,			_A					,			cur_len=_A      )      )

      # dist should be filtered to keep min num values so that sum is >= top_p
      # exp (-inf) => 0
      a__	:						Optional[int]      		=  np.array([[0.3, 0.0, 0.0, 0.5], [0.0, 0.3, 0.3, 0.25]]      )
      self.assertTrue(np.allclose(_A					,			_A					,			atol=1E-3      )      )

      # check edge cases with negative and extreme logits
      a__	:						str      		=  np.broadcast_to(np.arange(_A      )[None, :]					,			(batch_size, vocab_size)      ).copy() - (
          vocab_size // 2
      )

      # make ramp_logits more extreme
      a__	:						Any      		=  ramp_logits[1] * 100.0

      # make sure at least 2 tokens are kept
      a__	:						Optional[Any]      		=  FlaxTopPLogitsWarper(0.9					,			min_tokens_to_keep=2					,			filter_value=0.0      )
      a__	:						int      		=  top_p_warp(_A					,			_A					,			cur_len=_A      )

      # first batch should keep three tokens, second batch would keep only 1, but due to `min_tokens_to_keep=2` keeps 2.
      self.assertListEqual((filtered_dist != 0.0).sum(axis=-1      ).tolist()					,			[3, 2]      )





   def 	_snake_case ( self      )				->  Tuple:
      """simple docstring"""





      a__	:						List[Any]      		=  20
      a__	:						List[Any]      		=  4
      a__	:						Dict      		=  0

      a__	:						Union[str, Any]      		=  FlaxMinLengthLogitsProcessor(min_length=10					,			eos_token_id=_A      )

      # check that min length is applied at length 5
      a__	:						Optional[int]      		=  ids_tensor((batch_size, 20)					,			vocab_size=20      )
      a__	:						str      		=  5
      a__	:						Union[str, Any]      		=  self._get_uniform_logits(_A					,			_A      )
      a__	:						str      		=  min_dist_processor(_A					,			_A					,			cur_len=_A      )
      self.assertListEqual(scores_before_min_length[:, eos_token_id].tolist()					,			4 * [-float("inf"      )]      )

      # check that min length is not applied anymore at length 15
      a__	:						Tuple      		=  self._get_uniform_logits(_A					,			_A      )
      a__	:						Any      		=  15
      a__	:						Dict      		=  min_dist_processor(_A					,			_A					,			cur_len=_A      )
      self.assertFalse(jnp.isinf(_A      ).any()      )





   def 	_snake_case ( self      )				->  Tuple:
      """simple docstring"""





      a__	:						Optional[Any]      		=  20
      a__	:						int      		=  4
      a__	:						int      		=  0

      a__	:						List[str]      		=  FlaxForcedBOSTokenLogitsProcessor(bos_token_id=_A      )

      # check that all scores are -inf except the bos_token_id score
      a__	:						Optional[int]      		=  ids_tensor((batch_size, 1)					,			vocab_size=20      )
      a__	:						Tuple      		=  1
      a__	:						Tuple      		=  self._get_uniform_logits(_A					,			_A      )
      a__	:						Optional[int]      		=  logits_processor(_A					,			_A					,			cur_len=_A      )
      self.assertTrue(jnp.isneginf(scores[:, bos_token_id + 1 :]      ).all()      )
      self.assertListEqual(scores[:, bos_token_id].tolist()					,			4 * [0]      )  # score for bos_token_id shold be zero

      # check that bos_token_id is not forced if current length is greater than 1
      a__	:						str      		=  3
      a__	:						Optional[int]      		=  self._get_uniform_logits(_A					,			_A      )
      a__	:						Tuple      		=  logits_processor(_A					,			_A					,			cur_len=_A      )
      self.assertFalse(jnp.isinf(_A      ).any()      )





   def 	_snake_case ( self      )				->  int:
      """simple docstring"""





      a__	:						List[Any]      		=  20
      a__	:						Optional[Any]      		=  4
      a__	:						Dict      		=  0
      a__	:						Optional[Any]      		=  5

      a__	:						str      		=  FlaxForcedEOSTokenLogitsProcessor(max_length=_A					,			eos_token_id=_A      )

      # check that all scores are -inf except the eos_token_id when max_length is reached
      a__	:						int      		=  ids_tensor((batch_size, 4)					,			vocab_size=20      )
      a__	:						int      		=  4
      a__	:						Union[str, Any]      		=  self._get_uniform_logits(_A					,			_A      )
      a__	:						List[str]      		=  logits_processor(_A					,			_A					,			cur_len=_A      )
      self.assertTrue(jnp.isneginf(scores[:, eos_token_id + 1 :]      ).all()      )
      self.assertListEqual(scores[:, eos_token_id].tolist()					,			4 * [0]      )  # score for eos_token_id should be zero

      # check that eos_token_id is not forced if max_length is not reached
      a__	:						Any      		=  3
      a__	:						Union[str, Any]      		=  self._get_uniform_logits(_A					,			_A      )
      a__	:						Optional[Any]      		=  logits_processor(_A					,			_A					,			cur_len=_A      )
      self.assertFalse(jnp.isinf(_A      ).any()      )





   def 	_snake_case ( self      )				->  Tuple:
      """simple docstring"""





      a__	:						int      		=  4
      a__	:						List[str]      		=  10
      a__	:						int      		=  15
      a__	:						Any      		=  2
      a__	:						Dict      		=  1
      a__	:						Optional[int]      		=  15

      # dummy input_ids and scores
      a__	:						Union[str, Any]      		=  ids_tensor((batch_size, sequence_length)					,			_A      )
      a__	:						str      		=  input_ids.copy()

      a__	:						Union[str, Any]      		=  self._get_uniform_logits(_A					,			_A      )
      a__	:						int      		=  scores.copy()

      # instantiate all dist processors
      a__	:						List[str]      		=  FlaxTemperatureLogitsWarper(temperature=0.5      )
      a__	:						Optional[int]      		=  FlaxTopKLogitsWarper(3      )
      a__	:						Union[str, Any]      		=  FlaxTopPLogitsWarper(0.8      )

      # instantiate all logits processors
      a__	:						List[Any]      		=  FlaxMinLengthLogitsProcessor(min_length=10					,			eos_token_id=_A      )
      a__	:						Tuple      		=  FlaxForcedBOSTokenLogitsProcessor(bos_token_id=_A      )
      a__	:						Any      		=  FlaxForcedEOSTokenLogitsProcessor(max_length=_A					,			eos_token_id=_A      )

      a__	:						List[str]      		=  10

      # no processor list
      a__	:						Dict      		=  temp_dist_warp(_A					,			_A					,			cur_len=_A      )
      a__	:						Optional[int]      		=  top_k_warp(_A					,			_A					,			cur_len=_A      )
      a__	:						Dict      		=  top_p_warp(_A					,			_A					,			cur_len=_A      )
      a__	:						int      		=  min_dist_proc(_A					,			_A					,			cur_len=_A      )
      a__	:						List[Any]      		=  bos_dist_proc(_A					,			_A					,			cur_len=_A      )
      a__	:						Optional[int]      		=  eos_dist_proc(_A					,			_A					,			cur_len=_A      )

      # with processor list
      a__	:						Dict      		=  FlaxLogitsProcessorList(
          [temp_dist_warp, top_k_warp, top_p_warp, min_dist_proc, bos_dist_proc, eos_dist_proc]      )
      a__	:						List[str]      		=  processor(_A					,			_A					,			cur_len=_A      )

      # scores should be equal
      self.assertTrue(jnp.allclose(_A					,			_A					,			atol=1E-3      )      )

      # input_ids should never be changed
      self.assertListEqual(input_ids.tolist()					,			input_ids_comp.tolist()      )





   def 	_snake_case ( self      )				->  int:
      """simple docstring"""





      a__	:						int      		=  4
      a__	:						List[Any]      		=  10
      a__	:						Tuple      		=  15
      a__	:						Union[str, Any]      		=  2
      a__	:						Optional[int]      		=  1
      a__	:						List[str]      		=  15

      # dummy input_ids and scores
      a__	:						int      		=  ids_tensor((batch_size, sequence_length)					,			_A      )
      a__	:						Optional[int]      		=  input_ids.copy()

      a__	:						Optional[Any]      		=  self._get_uniform_logits(_A					,			_A      )
      a__	:						List[Any]      		=  scores.copy()

      # instantiate all dist processors
      a__	:						Optional[int]      		=  FlaxTemperatureLogitsWarper(temperature=0.5      )
      a__	:						Optional[int]      		=  FlaxTopKLogitsWarper(3      )
      a__	:						Tuple      		=  FlaxTopPLogitsWarper(0.8      )

      # instantiate all logits processors
      a__	:						Optional[int]      		=  FlaxMinLengthLogitsProcessor(min_length=10					,			eos_token_id=_A      )
      a__	:						Optional[int]      		=  FlaxForcedBOSTokenLogitsProcessor(bos_token_id=_A      )
      a__	:						Any      		=  FlaxForcedEOSTokenLogitsProcessor(max_length=_A					,			eos_token_id=_A      )

      a__	:						List[str]      		=  10

      # no processor list
      def run_no_processor_list(snake_case					,			snake_case					,			snake_case      ):
         a__	:						Optional[Any]      		=  temp_dist_warp(_A					,			_A					,			cur_len=_A      )
         a__	:						Optional[Any]      		=  top_k_warp(_A					,			_A					,			cur_len=_A      )
         a__	:						List[Any]      		=  top_p_warp(_A					,			_A					,			cur_len=_A      )
         a__	:						Optional[Any]      		=  min_dist_proc(_A					,			_A					,			cur_len=_A      )
         a__	:						Tuple      		=  bos_dist_proc(_A					,			_A					,			cur_len=_A      )
         a__	:						Dict      		=  eos_dist_proc(_A					,			_A					,			cur_len=_A      )
         return scores

      # with processor list
      def run_processor_list(snake_case					,			snake_case					,			snake_case      ):
         a__	:						Optional[Any]      		=  FlaxLogitsProcessorList(
             [temp_dist_warp, top_k_warp, top_p_warp, min_dist_proc, bos_dist_proc, eos_dist_proc]      )
         a__	:						List[Any]      		=  processor(_A					,			_A					,			cur_len=_A      )
         return scores

      a__	:						Dict      		=  jax.jit(_A      )
      a__	:						Optional[Any]      		=  jax.jit(_A      )

      a__	:						List[str]      		=  jitted_run_no_processor_list(_A					,			_A					,			_A      )
      a__	:						List[Any]      		=  jitted_run_processor_list(_A					,			_A					,			_A      )

      # scores should be equal
      self.assertTrue(jnp.allclose(_A					,			_A					,			atol=1E-3      )      )

      # input_ids should never be changed
      self.assertListEqual(input_ids.tolist()					,			input_ids_comp.tolist()      )








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


SCREAMING_SNAKE_CASE__       :			Dict			      =						"""CompVis/stable-diffusion-v1-1"""
SCREAMING_SNAKE_CASE__       :			Dict			      =						"""CompVis/stable-diffusion-v1-2"""
SCREAMING_SNAKE_CASE__       :			Tuple			      =						"""CompVis/stable-diffusion-v1-3"""
SCREAMING_SNAKE_CASE__       :			str			      =						"""CompVis/stable-diffusion-v1-4"""







class   __lowerCAmelCase			(					_UpperCamelCase  ):





   def __init__( self					,			snake_case					,			snake_case					,			snake_case					,			snake_case					,			snake_case					,			snake_case					,			snake_case					,			snake_case = True					,			)				->  Any:
      """simple docstring"""





      super()._init_()

      a__	:						Union[str, Any]      		=  StableDiffusionPipeline.from_pretrained(snake_case      )
      a__	:						Optional[Any]      		=  StableDiffusionPipeline.from_pretrained(snake_case      )
      a__	:						Optional[Any]      		=  StableDiffusionPipeline.from_pretrained(snake_case      )
      a__	:						int      		=  StableDiffusionPipeline(
          vae=snake_case					,			text_encoder=snake_case					,			tokenizer=snake_case					,			unet=snake_case					,			scheduler=snake_case					,			safety_checker=snake_case					,			feature_extractor=snake_case					,			requires_safety_checker=snake_case					,			)

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





   @property
   def 	_snake_case ( self      )				->  Dict[str, Any]:
      """simple docstring"""





      return {k: getattr(self					,			snake_case      ) for k in self.config.keys() if not k.startswith("_"      )}





   def 	_snake_case ( self					,			snake_case = "auto"      )				->  Optional[Any]:
      """simple docstring"""





      if slice_size == "auto":
         # half the attention head size is usually a good trade-off between
         # speed and memory
         a__	:						List[Any]      		=  self.unet.config.attention_head_dim // 2
      self.unet.set_attention_slice(snake_case      )





   def 	_snake_case ( self      )				->  Tuple:
      """simple docstring"""





      self.enable_attention_slicing(snake_case      )





   @torch.no_grad()
   def 	_snake_case ( self					,			snake_case					,			snake_case = 512					,			snake_case = 512					,			snake_case = 50					,			snake_case = 7.5					,			snake_case = None					,			snake_case = 1					,			snake_case = 0.0					,			snake_case = None					,			snake_case = None					,			snake_case = "pil"					,			snake_case = True					,			snake_case = None					,			snake_case = 1					,			**snake_case					,			)				->  Optional[int]:
      """simple docstring"""





      return self.pipea(
          prompt=snake_case					,			height=snake_case					,			width=snake_case					,			num_inference_steps=snake_case					,			guidance_scale=snake_case					,			negative_prompt=snake_case					,			num_images_per_prompt=snake_case					,			eta=snake_case					,			generator=snake_case					,			latents=snake_case					,			output_type=snake_case					,			return_dict=snake_case					,			callback=snake_case					,			callback_steps=snake_case					,			**snake_case					,			)





   @torch.no_grad()
   def 	_snake_case ( self					,			snake_case					,			snake_case = 512					,			snake_case = 512					,			snake_case = 50					,			snake_case = 7.5					,			snake_case = None					,			snake_case = 1					,			snake_case = 0.0					,			snake_case = None					,			snake_case = None					,			snake_case = "pil"					,			snake_case = True					,			snake_case = None					,			snake_case = 1					,			**snake_case					,			)				->  Dict:
      """simple docstring"""





      return self.pipea(
          prompt=snake_case					,			height=snake_case					,			width=snake_case					,			num_inference_steps=snake_case					,			guidance_scale=snake_case					,			negative_prompt=snake_case					,			num_images_per_prompt=snake_case					,			eta=snake_case					,			generator=snake_case					,			latents=snake_case					,			output_type=snake_case					,			return_dict=snake_case					,			callback=snake_case					,			callback_steps=snake_case					,			**snake_case					,			)





   @torch.no_grad()
   def 	_snake_case ( self					,			snake_case					,			snake_case = 512					,			snake_case = 512					,			snake_case = 50					,			snake_case = 7.5					,			snake_case = None					,			snake_case = 1					,			snake_case = 0.0					,			snake_case = None					,			snake_case = None					,			snake_case = "pil"					,			snake_case = True					,			snake_case = None					,			snake_case = 1					,			**snake_case					,			)				->  Union[str, Any]:
      """simple docstring"""





      return self.pipea(
          prompt=snake_case					,			height=snake_case					,			width=snake_case					,			num_inference_steps=snake_case					,			guidance_scale=snake_case					,			negative_prompt=snake_case					,			num_images_per_prompt=snake_case					,			eta=snake_case					,			generator=snake_case					,			latents=snake_case					,			output_type=snake_case					,			return_dict=snake_case					,			callback=snake_case					,			callback_steps=snake_case					,			**snake_case					,			)





   @torch.no_grad()
   def 	_snake_case ( self					,			snake_case					,			snake_case = 512					,			snake_case = 512					,			snake_case = 50					,			snake_case = 7.5					,			snake_case = None					,			snake_case = 1					,			snake_case = 0.0					,			snake_case = None					,			snake_case = None					,			snake_case = "pil"					,			snake_case = True					,			snake_case = None					,			snake_case = 1					,			**snake_case					,			)				->  Dict:
      """simple docstring"""





      return self.pipea(
          prompt=snake_case					,			height=snake_case					,			width=snake_case					,			num_inference_steps=snake_case					,			guidance_scale=snake_case					,			negative_prompt=snake_case					,			num_images_per_prompt=snake_case					,			eta=snake_case					,			generator=snake_case					,			latents=snake_case					,			output_type=snake_case					,			return_dict=snake_case					,			callback=snake_case					,			callback_steps=snake_case					,			**snake_case					,			)





   @torch.no_grad()
   def 	_snake_case ( self					,			snake_case					,			snake_case = 512					,			snake_case = 512					,			snake_case = 50					,			snake_case = 7.5					,			snake_case = None					,			snake_case = 1					,			snake_case = 0.0					,			snake_case = None					,			snake_case = None					,			snake_case = "pil"					,			snake_case = True					,			snake_case = None					,			snake_case = 1					,			**snake_case					,			)				->  Dict:
      """simple docstring"""





      a__	:						Any      		=  "cuda" if torch.cuda.is_available() else "cpu"
      self.to(snake_case      )

      # 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
      a__	:						Any      		=  self.textaimg_sda_a(
          prompt=snake_case					,			height=snake_case					,			width=snake_case					,			num_inference_steps=snake_case					,			guidance_scale=snake_case					,			negative_prompt=snake_case					,			num_images_per_prompt=snake_case					,			eta=snake_case					,			generator=snake_case					,			latents=snake_case					,			output_type=snake_case					,			return_dict=snake_case					,			callback=snake_case					,			callback_steps=snake_case					,			**snake_case					,			)

      # Get first result from Stable Diffusion Checkpoint v1.2
      a__	:						List[Any]      		=  self.textaimg_sda_a(
          prompt=snake_case					,			height=snake_case					,			width=snake_case					,			num_inference_steps=snake_case					,			guidance_scale=snake_case					,			negative_prompt=snake_case					,			num_images_per_prompt=snake_case					,			eta=snake_case					,			generator=snake_case					,			latents=snake_case					,			output_type=snake_case					,			return_dict=snake_case					,			callback=snake_case					,			callback_steps=snake_case					,			**snake_case					,			)

      # Get first result from Stable Diffusion Checkpoint v1.3
      a__	:						Optional[Any]      		=  self.textaimg_sda_a(
          prompt=snake_case					,			height=snake_case					,			width=snake_case					,			num_inference_steps=snake_case					,			guidance_scale=snake_case					,			negative_prompt=snake_case					,			num_images_per_prompt=snake_case					,			eta=snake_case					,			generator=snake_case					,			latents=snake_case					,			output_type=snake_case					,			return_dict=snake_case					,			callback=snake_case					,			callback_steps=snake_case					,			**snake_case					,			)

      # Get first result from Stable Diffusion Checkpoint v1.4
      a__	:						Dict      		=  self.textaimg_sda_a(
          prompt=snake_case					,			height=snake_case					,			width=snake_case					,			num_inference_steps=snake_case					,			guidance_scale=snake_case					,			negative_prompt=snake_case					,			num_images_per_prompt=snake_case					,			eta=snake_case					,			generator=snake_case					,			latents=snake_case					,			output_type=snake_case					,			return_dict=snake_case					,			callback=snake_case					,			callback_steps=snake_case					,			**snake_case					,			)

      # 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]]      )

