


"""simple docstring"""







import json
import os
from collections import Counter

import torch
import torchvision
import torchvision.transforms as transforms
from PIL import Image
from torch import nn
from torch.utils.data import Dataset


lowerCAmelCase__      				=   {1: (1, 1), 2: (2, 1), 3: (3, 1), 4: (2, 2), 5: (5, 1), 6: (3, 2), 7: (7, 1), 8: (4, 2), 9: (3, 3)}


class       SCREAMING_SNAKE_CASE__				(		nn.Module				):
       """simple docstring"""


       def __init__(						self		,     snake_case__						):






         """simple docstring"""





         super().__init__()
         lowerCAmelCase     :     List[str]								=							torchvision.models.resnetaaa(pretrained=__SCREAMING_SNAKE_CASE						)
         lowerCAmelCase     :     List[str]								=							list(model.children()						)[:-2]
         lowerCAmelCase     :     List[str]								=							nn.Sequential(*__SCREAMING_SNAKE_CASE						)
         lowerCAmelCase     :     Optional[int]								=							nn.AdaptiveAvgPoolad(POOLING_BREAKDOWN[args.num_image_embeds]						)







       def        lowercase__							(						self		,     snake_case__						):






         """simple docstring"""





         lowerCAmelCase     :     Union[str, Any]								=							self.pool(self.model(__SCREAMING_SNAKE_CASE						)						)
         lowerCAmelCase     :     Dict								=							torch.flatten(__SCREAMING_SNAKE_CASE		,     start_dim=2						)
         lowerCAmelCase     :     Union[str, Any]								=							out.transpose(1		,     2						).contiguous()
         return out  # BxNx2048


class       SCREAMING_SNAKE_CASE__				(		__snake_case				):
       """simple docstring"""


       def __init__(						self		,     snake_case__		,     snake_case__		,     snake_case__		,     snake_case__		,     snake_case__						):






         """simple docstring"""





         lowerCAmelCase     :     Dict								=							[json.loads(__SCREAMING_SNAKE_CASE						) for l in open(__SCREAMING_SNAKE_CASE						)]
         lowerCAmelCase     :     int								=							os.path.dirname(__SCREAMING_SNAKE_CASE						)
         lowerCAmelCase     :     Dict								=							tokenizer
         lowerCAmelCase     :     List[Any]								=							labels
         lowerCAmelCase     :     Optional[int]								=							len(__SCREAMING_SNAKE_CASE						)
         lowerCAmelCase     :     List[Any]								=							max_seq_length

         lowerCAmelCase     :     Union[str, Any]								=							transforms

       def __len__(						self						):






         """simple docstring"""





         return len(self.data						)

       def __getitem__(						self		,     snake_case__						):






         """simple docstring"""





         lowerCAmelCase     :     int								=							torch.LongTensor(self.tokenizer.encode(self.data[index]["text"]		,     add_special_tokens=__SCREAMING_SNAKE_CASE						)						)
         lowerCAmelCase						,  lowerCAmelCase						,  lowerCAmelCase     :     Dict								=							sentence[0], sentence[1:-1], sentence[-1]
         lowerCAmelCase     :     List[str]								=							sentence[: self.max_seq_length]

         lowerCAmelCase     :     List[Any]								=							torch.zeros(self.n_classes						)
         lowerCAmelCase     :     Tuple								=							1

         lowerCAmelCase     :     Tuple								=							Image.open(os.path.join(self.data_dir		,     self.data[index]["img"]						)						).convert("RGB"						)
         lowerCAmelCase     :     List[Any]								=							self.transforms(__SCREAMING_SNAKE_CASE						)

         return {
             "image_start_token": start_token,
             "image_end_token": end_token,
             "sentence": sentence,
             "image": image,
             "label": label,
         }







       def        lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase     :     Tuple								=							Counter()
         for row in self.data:
           label_freqs.update(row["label"]						)
         return label_freqs

def 					a__			(				SCREAMING_SNAKE_CASE    :    Union[str, Any]				):


  '''simple docstring'''







  lowerCAmelCase     :     str								=							[len(row["sentence"]				) for row in batch]
  lowerCAmelCase						,  lowerCAmelCase     :     Union[str, Any]								=							len(_lowerCamelCase				), max(_lowerCamelCase				)

  lowerCAmelCase     :     int								=							torch.zeros(_lowerCamelCase				,      _lowerCamelCase				,      dtype=torch.long				)
  lowerCAmelCase     :     List[Any]								=							torch.zeros(_lowerCamelCase				,      _lowerCamelCase				,      dtype=torch.long				)

  for i_batch, (input_row, length) in enumerate(zip(_lowerCamelCase				,      _lowerCamelCase				)				):
    lowerCAmelCase     :     Optional[Any]								=							input_row["sentence"]
    lowerCAmelCase     :     List[str]								=							1

  lowerCAmelCase     :     str								=							torch.stack([row["image"] for row in batch]				)
  lowerCAmelCase     :     str								=							torch.stack([row["label"] for row in batch]				)
  lowerCAmelCase     :     str								=							torch.stack([row["image_start_token"] for row in batch]				)
  lowerCAmelCase     :     str								=							torch.stack([row["image_end_token"] for row in batch]				)

  return text_tensor, mask_tensor, img_tensor, img_start_token, img_end_token, tgt_tensor
def 					a__			(				):


  '''simple docstring'''







  return [
      "Crime",
      "Drama",
      "Thriller",
      "Action",
      "Comedy",
      "Romance",
      "Documentary",
      "Short",
      "Mystery",
      "History",
      "Family",
      "Adventure",
      "Fantasy",
      "Sci-Fi",
      "Western",
      "Horror",
      "Sport",
      "War",
      "Music",
      "Musical",
      "Animation",
      "Biography",
      "Film-Noir",
  ]





def 					a__			(				):


  '''simple docstring'''







  return transforms.Compose(
      [
          transforms.Resize(2_5_6				),
          transforms.CenterCrop(2_2_4				),
          transforms.ToTensor(),
          transforms.Normalize(
              mean=[0.46_777_044, 0.44_531_429, 0.40_661_017]				,      std=[0.12_221_994, 0.12_145_835, 0.14_380_469]				,      ),
      ]				)













"""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					:				Union[str, Any]					    =						'''CompVis/stable-diffusion-v1-1'''
_SCREAMING_SNAKE_CASE					:				Optional[Any]					    =						'''CompVis/stable-diffusion-v1-2'''
_SCREAMING_SNAKE_CASE					:				int					    =						'''CompVis/stable-diffusion-v1-3'''
_SCREAMING_SNAKE_CASE					:				str					    =						'''CompVis/stable-diffusion-v1-4'''






class      a						(					__snake_case		):






    def __init__(       self     :							int       ,						__SCREAMING_SNAKE_CASE     :							AutoencoderKL       ,						__SCREAMING_SNAKE_CASE     :							CLIPTextModel       ,						__SCREAMING_SNAKE_CASE     :							CLIPTokenizer       ,						__SCREAMING_SNAKE_CASE     :							UNetaDConditionModel       ,						__SCREAMING_SNAKE_CASE     :							Union[DDIMScheduler, PNDMScheduler, LMSDiscreteScheduler]       ,						__SCREAMING_SNAKE_CASE     :							StableDiffusionSafetyChecker       ,						__SCREAMING_SNAKE_CASE     :							CLIPImageProcessor       ,						__SCREAMING_SNAKE_CASE     :							bool = True       ,						)     ->		List[str]:
      super()._init_()

      lowerCamelCase_         =						StableDiffusionPipeline.from_pretrained(__SCREAMING_SNAKE_CASE					)
      lowerCamelCase_         =						StableDiffusionPipeline.from_pretrained(__SCREAMING_SNAKE_CASE					)
      lowerCamelCase_         =						StableDiffusionPipeline.from_pretrained(__SCREAMING_SNAKE_CASE					)
      lowerCamelCase_         =						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    UpperCamelCase       (       self     :							List[str]					)     ->		Dict[str, Any]:
      return {k: getattr(self       ,						__SCREAMING_SNAKE_CASE					) for k in self.config.keys() if not k.startswith('_'					)}






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






    def    UpperCamelCase       (       self     :							Any					)     ->		List[Any]:
      self.enable_attention_slicing(__SCREAMING_SNAKE_CASE					)






    @torch.no_grad()
    def    UpperCamelCase       (       self     :							Any       ,						__SCREAMING_SNAKE_CASE     :							Union[str, List[str]]       ,						__SCREAMING_SNAKE_CASE     :							int = 512       ,						__SCREAMING_SNAKE_CASE     :							int = 512       ,						__SCREAMING_SNAKE_CASE     :							int = 50       ,						__SCREAMING_SNAKE_CASE     :							float = 7.5       ,						__SCREAMING_SNAKE_CASE     :							Optional[Union[str, List[str]]] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[int] = 1       ,						__SCREAMING_SNAKE_CASE     :							float = 0.0       ,						__SCREAMING_SNAKE_CASE     :							Optional[torch.Generator] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[torch.FloatTensor] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[str] = "pil"       ,						__SCREAMING_SNAKE_CASE     :							bool = True       ,						__SCREAMING_SNAKE_CASE     :							Optional[Callable[[int, int, torch.FloatTensor], None]] = None       ,						__SCREAMING_SNAKE_CASE     :							int = 1       ,						**__SCREAMING_SNAKE_CASE     :							int       ,						)     ->		Tuple:
      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    UpperCamelCase       (       self     :							List[str]       ,						__SCREAMING_SNAKE_CASE     :							Union[str, List[str]]       ,						__SCREAMING_SNAKE_CASE     :							int = 512       ,						__SCREAMING_SNAKE_CASE     :							int = 512       ,						__SCREAMING_SNAKE_CASE     :							int = 50       ,						__SCREAMING_SNAKE_CASE     :							float = 7.5       ,						__SCREAMING_SNAKE_CASE     :							Optional[Union[str, List[str]]] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[int] = 1       ,						__SCREAMING_SNAKE_CASE     :							float = 0.0       ,						__SCREAMING_SNAKE_CASE     :							Optional[torch.Generator] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[torch.FloatTensor] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[str] = "pil"       ,						__SCREAMING_SNAKE_CASE     :							bool = True       ,						__SCREAMING_SNAKE_CASE     :							Optional[Callable[[int, int, torch.FloatTensor], None]] = None       ,						__SCREAMING_SNAKE_CASE     :							int = 1       ,						**__SCREAMING_SNAKE_CASE     :							List[str]       ,						)     ->		Optional[int]:
      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    UpperCamelCase       (       self     :							Optional[Any]       ,						__SCREAMING_SNAKE_CASE     :							Union[str, List[str]]       ,						__SCREAMING_SNAKE_CASE     :							int = 512       ,						__SCREAMING_SNAKE_CASE     :							int = 512       ,						__SCREAMING_SNAKE_CASE     :							int = 50       ,						__SCREAMING_SNAKE_CASE     :							float = 7.5       ,						__SCREAMING_SNAKE_CASE     :							Optional[Union[str, List[str]]] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[int] = 1       ,						__SCREAMING_SNAKE_CASE     :							float = 0.0       ,						__SCREAMING_SNAKE_CASE     :							Optional[torch.Generator] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[torch.FloatTensor] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[str] = "pil"       ,						__SCREAMING_SNAKE_CASE     :							bool = True       ,						__SCREAMING_SNAKE_CASE     :							Optional[Callable[[int, int, torch.FloatTensor], None]] = None       ,						__SCREAMING_SNAKE_CASE     :							int = 1       ,						**__SCREAMING_SNAKE_CASE     :							Optional[int]       ,						)     ->		Tuple:
      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    UpperCamelCase       (       self     :							Tuple       ,						__SCREAMING_SNAKE_CASE     :							Union[str, List[str]]       ,						__SCREAMING_SNAKE_CASE     :							int = 512       ,						__SCREAMING_SNAKE_CASE     :							int = 512       ,						__SCREAMING_SNAKE_CASE     :							int = 50       ,						__SCREAMING_SNAKE_CASE     :							float = 7.5       ,						__SCREAMING_SNAKE_CASE     :							Optional[Union[str, List[str]]] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[int] = 1       ,						__SCREAMING_SNAKE_CASE     :							float = 0.0       ,						__SCREAMING_SNAKE_CASE     :							Optional[torch.Generator] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[torch.FloatTensor] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[str] = "pil"       ,						__SCREAMING_SNAKE_CASE     :							bool = True       ,						__SCREAMING_SNAKE_CASE     :							Optional[Callable[[int, int, torch.FloatTensor], None]] = None       ,						__SCREAMING_SNAKE_CASE     :							int = 1       ,						**__SCREAMING_SNAKE_CASE     :							Tuple       ,						)     ->		Tuple:
      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    UpperCamelCase       (       self     :							Dict       ,						__SCREAMING_SNAKE_CASE     :							Union[str, List[str]]       ,						__SCREAMING_SNAKE_CASE     :							int = 512       ,						__SCREAMING_SNAKE_CASE     :							int = 512       ,						__SCREAMING_SNAKE_CASE     :							int = 50       ,						__SCREAMING_SNAKE_CASE     :							float = 7.5       ,						__SCREAMING_SNAKE_CASE     :							Optional[Union[str, List[str]]] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[int] = 1       ,						__SCREAMING_SNAKE_CASE     :							float = 0.0       ,						__SCREAMING_SNAKE_CASE     :							Optional[torch.Generator] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[torch.FloatTensor] = None       ,						__SCREAMING_SNAKE_CASE     :							Optional[str] = "pil"       ,						__SCREAMING_SNAKE_CASE     :							bool = True       ,						__SCREAMING_SNAKE_CASE     :							Optional[Callable[[int, int, torch.FloatTensor], None]] = None       ,						__SCREAMING_SNAKE_CASE     :							int = 1       ,						**__SCREAMING_SNAKE_CASE     :							int       ,						)     ->		str:
      lowerCamelCase_         =						'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
      lowerCamelCase_         =						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
      lowerCamelCase_         =						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
      lowerCamelCase_         =						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
      lowerCamelCase_         =						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]]					)




