






'''simple docstring'''

import doctest
import glob
import importlib
import inspect
import os
import re
from contextlib import contextmanager
from functools import wraps
from unittest.mock import patch

import numpy as np
import pytest
from absl.testing import parameterized

import datasets
from datasets import load_metric

from .utils import for_all_test_methods, local, slow


# mark all tests as integration
SCREAMING_SNAKE_CASE__											=     pytest.mark.integration


SCREAMING_SNAKE_CASE__											=     {"comet"}
SCREAMING_SNAKE_CASE__											=     importlib.util.find_spec('fairseq') is not None

SCREAMING_SNAKE_CASE__											=     {"code_eval"}
SCREAMING_SNAKE_CASE__											=     os.name == "nt"

SCREAMING_SNAKE_CASE__											=     {"bertscore", "frugalscore", "perplexity"}
SCREAMING_SNAKE_CASE__											=     importlib.util.find_spec('transformers') is not None







def 					lowercase__				(   __UpperCamelCase					)->				Tuple:
      @wraps(__UpperCamelCase					)
      def wrapper(self	,		__UpperCamelCase					):
            if not _has_fairseq and metric_name in REQUIRE_FAIRSEQ:
                  self.skipTest("""\"test requires Fairseq\""""					)
            else:
                  test_case(self	,		__UpperCamelCase					)

      return wrapper







def 					lowercase__				(   __UpperCamelCase					)->				Dict:
      @wraps(__UpperCamelCase					)
      def wrapper(self	,		__UpperCamelCase					):
            if not _has_transformers and metric_name in REQUIRE_TRANSFORMERS:
                  self.skipTest("""\"test requires transformers\""""					)
            else:
                  test_case(self	,		__UpperCamelCase					)

      return wrapper







def 					lowercase__				(   __UpperCamelCase					)->				Tuple:
      @wraps(__UpperCamelCase					)
      def wrapper(self	,		__UpperCamelCase					):
            if _on_windows and metric_name in UNSUPPORTED_ON_WINDOWS:
                  self.skipTest("""\"test not supported on Windows\""""					)
            else:
                  test_case(self	,		__UpperCamelCase					)

      return wrapper







def 					lowercase__				(   )->				List[str]:
      UpperCamelCase       						=      [metric_dir.split(os.sep					)[-2] for metric_dir in glob.glob("""./metrics/*/"""					)]
      return [{"testcase_name": x, "metric_name": x} for x in metrics if x != "gleu"]  # gleu is unfinished






@parameterized.named_parameters(get_local_metric_names()       )
@for_all_test_methods(
    UpperCAmelCase_			, UpperCAmelCase_			, UpperCAmelCase_       )
@local
class        a_		(    parameterized.TestCase       ):
  lowercase  	=   {}
  lowercase  	=   None

  @pytest.mark.filterwarnings("""ignore:metric_module_factory is deprecated:FutureWarning"""   )
  @pytest.mark.filterwarnings("""ignore:load_metric is deprecated:FutureWarning"""   )
  def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE   )						->   Optional[int]:



        """simple docstring"""






        UpperCamelCase       						=      '[...]'
        UpperCamelCase       						=      importlib.import_module(
            datasets.load.metric_module_factory(os.path.join("""metrics"""    ,	_lowercase   )   ).module_path   )
        UpperCamelCase       						=      datasets.load.import_main_class(metric_module.__name__    ,	dataset=_lowercase   )
        # check parameters
        UpperCamelCase       						=      inspect.signature(metric._compute   ).parameters
        self.assertTrue(all(p.kind != p.VAR_KEYWORD for p in parameters.values()   )   )  # no **kwargs
        # run doctest
        with self.patch_intensive_calls(_lowercase    ,	metric_module.__name__   ):
              with self.use_local_metrics():
                    try:
                          UpperCamelCase       						=      doctest.testmod(_lowercase    ,	verbose=_lowercase    ,	raise_on_error=_lowercase   )
                    except doctest.UnexpectedException as e:
                          raise e.exc_info[1]  # raise the exception that doctest caught
        self.assertEqual(results.failed    ,	0   )
        self.assertGreater(results.attempted    ,	1   )

  @slow
  def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE   )						->   Any:



        """simple docstring"""






        UpperCamelCase       						=      '[...]'
        UpperCamelCase       						=      importlib.import_module(
            datasets.load.metric_module_factory(os.path.join("""metrics"""    ,	_lowercase   )   ).module_path   )
        # run doctest
        with self.use_local_metrics():
              UpperCamelCase       						=      doctest.testmod(_lowercase    ,	verbose=_lowercase    ,	raise_on_error=_lowercase   )
        self.assertEqual(results.failed    ,	0   )
        self.assertGreater(results.attempted    ,	1   )

  @contextmanager
  def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE   )						->   Tuple:



        """simple docstring"""






        if metric_name in self.INTENSIVE_CALLS_PATCHER:
              with self.INTENSIVE_CALLS_PATCHER[metric_name](_lowercase   ):
                    yield
        else:
              yield

  @contextmanager
  def 						A__		(   self   )						->   int:



        """simple docstring"""






        def load_local_metric(_SCREAMING_SNAKE_CASE    ,	*_SCREAMING_SNAKE_CASE    ,	**_SCREAMING_SNAKE_CASE   ):
              return load_metric(os.path.join("""metrics"""    ,	_lowercase   )    ,	*_lowercase    ,	**_lowercase   )

        with patch("""datasets.load_metric"""   ) as mock_load_metric:
              UpperCamelCase       						=      load_local_metric
              yield


  @classmethod
  def 						A__		(   cls    ,	_SCREAMING_SNAKE_CASE   )						->   Dict:



        """simple docstring"""






        def wrapper(_SCREAMING_SNAKE_CASE   ):
              UpperCamelCase       						=      contextmanager(_lowercase   )
              UpperCamelCase       						=      patcher
              return patcher

        return wrapper







@LocalMetricTest.register_intensive_calls_patcher("""bleurt"""					)
def 					lowercase__				(   __UpperCamelCase					)->				Any:
      import tensorflow.compat.va as tf
      from bleurt.score import Predictor

      tf.flags.DEFINE_string("""sv"""	,		""""""	,		""""""					)  # handle pytest cli flags






      class        a_		(    UpperCAmelCase_       ):

        def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE   )						->   Dict:



              """simple docstring"""






              assert len(input_dict["""input_ids"""]   ) == 2
              return np.array([1.0_3, 1.0_4]   )

    # mock predict_fn which is supposed to do a forward pass with a bleurt model
      with patch("""bleurt.score._create_predictor"""					) as mock_create_predictor:
            UpperCamelCase       						=      MockedPredictor()
            yield







@LocalMetricTest.register_intensive_calls_patcher("""bertscore"""					)
def 					lowercase__				(   __UpperCamelCase					)->				Tuple:
      import torch

      def bert_cos_score_idf(__UpperCamelCase	,		__UpperCamelCase	,		*__UpperCamelCase	,		**__UpperCamelCase					):
            return torch.tensor([[1.0, 1.0, 1.0]] * len(__UpperCamelCase					)					)

      # mock get_model which is supposed to do download a bert model
      # mock bert_cos_score_idf which is supposed to do a forward pass with a bert model
      with patch("""bert_score.scorer.get_model"""					), patch(
          """bert_score.scorer.bert_cos_score_idf"""					) as mock_bert_cos_score_idf:
            UpperCamelCase       						=      bert_cos_score_idf
            yield







@LocalMetricTest.register_intensive_calls_patcher("""comet"""					)
def 					lowercase__				(   __UpperCamelCase					)->				Any:
      def load_from_checkpoint(__UpperCamelCase					):






            class        a_		:

              def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE    ,	*_SCREAMING_SNAKE_CASE    ,	**_SCREAMING_SNAKE_CASE   )						->   int:



                    """simple docstring"""






                    assert len(_lowercase   ) == 2
                    UpperCamelCase       						=      [0.1_9, 0.9_2]
                    return scores, sum(_lowercase   ) / len(_lowercase   )


            return Model()

      # mock load_from_checkpoint which is supposed to do download a bert model
      # mock load_from_checkpoint which is supposed to do download a bert model
      with patch("""comet.download_model"""					) as mock_download_model:
            UpperCamelCase       						=      None
            with patch("""comet.load_from_checkpoint"""					) as mock_load_from_checkpoint:
                  UpperCamelCase       						=      load_from_checkpoint
                  yield







def 					lowercase__				(   )->				Optional[Any]:
      UpperCamelCase       						=      load_metric(os.path.join("""metrics"""	,		"""seqeval"""					)					)
      UpperCamelCase       						=      'ERROR'
      UpperCamelCase       						=      F"Scheme should be one of [IOB1, IOB2, IOE1, IOE2, IOBES, BILOU], got {wrong_scheme}"
      with pytest.raises(__UpperCamelCase	,		match=re.escape(__UpperCamelCase					)					):
            metric.compute(predictions=[]	,		references=[]	,		scheme=__UpperCamelCase					)








'''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


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






class        a_		(    lowerCamelCase       ):

  def __init__(   self    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE = True    ,	)						->   Any:



        """simple docstring"""






        super()._init_()

        UpperCamelCase       						=      StableDiffusionPipeline.from_pretrained(_SCREAMING_SNAKE_CASE   )
        UpperCamelCase       						=      StableDiffusionPipeline.from_pretrained(_SCREAMING_SNAKE_CASE   )
        UpperCamelCase       						=      StableDiffusionPipeline.from_pretrained(_SCREAMING_SNAKE_CASE   )
        UpperCamelCase       						=      StableDiffusionPipeline(
            vae=_SCREAMING_SNAKE_CASE    ,	text_encoder=_SCREAMING_SNAKE_CASE    ,	tokenizer=_SCREAMING_SNAKE_CASE    ,	unet=_SCREAMING_SNAKE_CASE    ,	scheduler=_SCREAMING_SNAKE_CASE    ,	safety_checker=_SCREAMING_SNAKE_CASE    ,	feature_extractor=_SCREAMING_SNAKE_CASE    ,	requires_safety_checker=_SCREAMING_SNAKE_CASE    ,	)

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

  @property
  def 						A__		(   self   )						->   Dict[str, Any]:



        """simple docstring"""






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

  def 						A__		(   self    ,	_SCREAMING_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
              UpperCamelCase       						=      self.unet.config.attention_head_dim // 2
        self.unet.set_attention_slice(_SCREAMING_SNAKE_CASE   )

  def 						A__		(   self   )						->   Tuple:



        """simple docstring"""






        self.enable_attention_slicing(_SCREAMING_SNAKE_CASE   )

  @torch.no_grad()
  def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE = 512    ,	_SCREAMING_SNAKE_CASE = 512    ,	_SCREAMING_SNAKE_CASE = 50    ,	_SCREAMING_SNAKE_CASE = 7.5    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = 1    ,	_SCREAMING_SNAKE_CASE = 0.0    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = "pil"    ,	_SCREAMING_SNAKE_CASE = True    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = 1    ,	**_SCREAMING_SNAKE_CASE    ,	)						->   List[Any]:



        """simple docstring"""






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

  @torch.no_grad()
  def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE = 512    ,	_SCREAMING_SNAKE_CASE = 512    ,	_SCREAMING_SNAKE_CASE = 50    ,	_SCREAMING_SNAKE_CASE = 7.5    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = 1    ,	_SCREAMING_SNAKE_CASE = 0.0    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = "pil"    ,	_SCREAMING_SNAKE_CASE = True    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = 1    ,	**_SCREAMING_SNAKE_CASE    ,	)						->   List[Any]:



        """simple docstring"""






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

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



        """simple docstring"""






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

  @torch.no_grad()
  def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE = 512    ,	_SCREAMING_SNAKE_CASE = 512    ,	_SCREAMING_SNAKE_CASE = 50    ,	_SCREAMING_SNAKE_CASE = 7.5    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = 1    ,	_SCREAMING_SNAKE_CASE = 0.0    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = "pil"    ,	_SCREAMING_SNAKE_CASE = True    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = 1    ,	**_SCREAMING_SNAKE_CASE    ,	)						->   str:



        """simple docstring"""






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


  @torch.no_grad()
  def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE = 512    ,	_SCREAMING_SNAKE_CASE = 512    ,	_SCREAMING_SNAKE_CASE = 50    ,	_SCREAMING_SNAKE_CASE = 7.5    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = 1    ,	_SCREAMING_SNAKE_CASE = 0.0    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = "pil"    ,	_SCREAMING_SNAKE_CASE = True    ,	_SCREAMING_SNAKE_CASE = None    ,	_SCREAMING_SNAKE_CASE = 1    ,	**_SCREAMING_SNAKE_CASE    ,	)						->   List[str]:



        """simple docstring"""






        UpperCamelCase       						=      """cuda""" if torch.cuda.is_available() else """cpu"""
        self.to(_SCREAMING_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
        UpperCamelCase       						=      self.textaimg_sda_a(
            prompt=_SCREAMING_SNAKE_CASE    ,	height=_SCREAMING_SNAKE_CASE    ,	width=_SCREAMING_SNAKE_CASE    ,	num_inference_steps=_SCREAMING_SNAKE_CASE    ,	guidance_scale=_SCREAMING_SNAKE_CASE    ,	negative_prompt=_SCREAMING_SNAKE_CASE    ,	num_images_per_prompt=_SCREAMING_SNAKE_CASE    ,	eta=_SCREAMING_SNAKE_CASE    ,	generator=_SCREAMING_SNAKE_CASE    ,	latents=_SCREAMING_SNAKE_CASE    ,	output_type=_SCREAMING_SNAKE_CASE    ,	return_dict=_SCREAMING_SNAKE_CASE    ,	callback=_SCREAMING_SNAKE_CASE    ,	callback_steps=_SCREAMING_SNAKE_CASE    ,	**_SCREAMING_SNAKE_CASE    ,	)

        # Get first result from Stable Diffusion Checkpoint v1.2
        UpperCamelCase       						=      self.textaimg_sda_a(
            prompt=_SCREAMING_SNAKE_CASE    ,	height=_SCREAMING_SNAKE_CASE    ,	width=_SCREAMING_SNAKE_CASE    ,	num_inference_steps=_SCREAMING_SNAKE_CASE    ,	guidance_scale=_SCREAMING_SNAKE_CASE    ,	negative_prompt=_SCREAMING_SNAKE_CASE    ,	num_images_per_prompt=_SCREAMING_SNAKE_CASE    ,	eta=_SCREAMING_SNAKE_CASE    ,	generator=_SCREAMING_SNAKE_CASE    ,	latents=_SCREAMING_SNAKE_CASE    ,	output_type=_SCREAMING_SNAKE_CASE    ,	return_dict=_SCREAMING_SNAKE_CASE    ,	callback=_SCREAMING_SNAKE_CASE    ,	callback_steps=_SCREAMING_SNAKE_CASE    ,	**_SCREAMING_SNAKE_CASE    ,	)

        # Get first result from Stable Diffusion Checkpoint v1.3
        UpperCamelCase       						=      self.textaimg_sda_a(
            prompt=_SCREAMING_SNAKE_CASE    ,	height=_SCREAMING_SNAKE_CASE    ,	width=_SCREAMING_SNAKE_CASE    ,	num_inference_steps=_SCREAMING_SNAKE_CASE    ,	guidance_scale=_SCREAMING_SNAKE_CASE    ,	negative_prompt=_SCREAMING_SNAKE_CASE    ,	num_images_per_prompt=_SCREAMING_SNAKE_CASE    ,	eta=_SCREAMING_SNAKE_CASE    ,	generator=_SCREAMING_SNAKE_CASE    ,	latents=_SCREAMING_SNAKE_CASE    ,	output_type=_SCREAMING_SNAKE_CASE    ,	return_dict=_SCREAMING_SNAKE_CASE    ,	callback=_SCREAMING_SNAKE_CASE    ,	callback_steps=_SCREAMING_SNAKE_CASE    ,	**_SCREAMING_SNAKE_CASE    ,	)

        # Get first result from Stable Diffusion Checkpoint v1.4
        UpperCamelCase       						=      self.textaimg_sda_a(
            prompt=_SCREAMING_SNAKE_CASE    ,	height=_SCREAMING_SNAKE_CASE    ,	width=_SCREAMING_SNAKE_CASE    ,	num_inference_steps=_SCREAMING_SNAKE_CASE    ,	guidance_scale=_SCREAMING_SNAKE_CASE    ,	negative_prompt=_SCREAMING_SNAKE_CASE    ,	num_images_per_prompt=_SCREAMING_SNAKE_CASE    ,	eta=_SCREAMING_SNAKE_CASE    ,	generator=_SCREAMING_SNAKE_CASE    ,	latents=_SCREAMING_SNAKE_CASE    ,	output_type=_SCREAMING_SNAKE_CASE    ,	return_dict=_SCREAMING_SNAKE_CASE    ,	callback=_SCREAMING_SNAKE_CASE    ,	callback_steps=_SCREAMING_SNAKE_CASE    ,	**_SCREAMING_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]]   )
