





'''simple docstring'''







import flax.linen as nn
import jax.numpy as jnp

from .attention_flax import FlaxTransformeraDModel
from .resnet_flax import FlaxDownsampleaD, FlaxResnetBlockaD, FlaxUpsampleaD


class 					__a      (nn.Module     ):
							__a					:   int
							__a					:   int
							__a					:   float									=       0.0
							__a					:   int									=       1
							__a					:   int									=       1
							__a					:   bool									=       True
							__a					:   bool									=       False
							__a					:   bool									=       False
							__a					:   bool									=       False
							__a					:   jnp.dtype									=       jnp.floataa

							def     UpperCAmelCase__	(							self							:     int   )					->       List[str]:







													"""simple docstring"""
													UpperCAmelCase_			:      List[str]     						=  []
													UpperCAmelCase_			:      List[Any]     						=  []

													for i in range(self.num_layers   ):
																			UpperCAmelCase_			:      Union[str, Any]     						=  self.in_channels if i == 0 else self.out_channels

																			UpperCAmelCase_			:      List[Any]     						=  FlaxResnetBlockaD(
																			    in_channels=__magic_name__       ,     out_channels=self.out_channels       ,     dropout_prob=self.dropout       ,     dtype=self.dtype       ,     )
																			resnets.append(__magic_name__   )

																			UpperCAmelCase_			:      List[str]     						=  FlaxTransformeraDModel(
																			    in_channels=self.out_channels       ,     n_heads=self.num_attention_heads       ,     d_head=self.out_channels // self.num_attention_heads       ,     depth=1       ,     use_linear_projection=self.use_linear_projection       ,     only_cross_attention=self.only_cross_attention       ,     use_memory_efficient_attention=self.use_memory_efficient_attention       ,     dtype=self.dtype       ,     )
																			attentions.append(__magic_name__   )

													UpperCAmelCase_			:      int     						=  resnets
													UpperCAmelCase_			:      Optional[Any]     						=  attentions

													if self.add_downsample:
																			UpperCAmelCase_			:      Tuple     						=  FlaxDownsampleaD(self.out_channels       ,     dtype=self.dtype   )



							def __call__(							self							:     Tuple       ,     __magic_name__							:     str       ,     __magic_name__							:     int       ,     __magic_name__							:     Optional[int]       ,     __magic_name__							:     Dict=True   )					->       List[Any]:







													"""simple docstring"""
													UpperCAmelCase_			:      int     						=  ()

													for resnet, attn in zip(self.resnets       ,     self.attentions   ):
																			UpperCAmelCase_			:      Union[str, Any]     						=  resnet(__magic_name__       ,     __magic_name__       ,     deterministic=__magic_name__   )
																			UpperCAmelCase_			:      Tuple     						=  attn(__magic_name__       ,     __magic_name__       ,     deterministic=__magic_name__   )
																			output_states += (hidden_states,)

													if self.add_downsample:
																			UpperCAmelCase_			:      int     						=  self.downsamplers_a(__magic_name__   )
																			output_states += (hidden_states,)

													return hidden_states, output_states





class 					__a      (nn.Module     ):
							__a					:   int
							__a					:   int
							__a					:   float									=       0.0
							__a					:   int									=       1
							__a					:   bool									=       True
							__a					:   jnp.dtype									=       jnp.floataa

							def     UpperCAmelCase__	(							self							:     str   )					->       int:







													"""simple docstring"""
													UpperCAmelCase_			:      Union[str, Any]     						=  []

													for i in range(self.num_layers   ):
																			UpperCAmelCase_			:      List[Any]     						=  self.in_channels if i == 0 else self.out_channels

																			UpperCAmelCase_			:      Dict     						=  FlaxResnetBlockaD(
																			    in_channels=__magic_name__       ,     out_channels=self.out_channels       ,     dropout_prob=self.dropout       ,     dtype=self.dtype       ,     )
																			resnets.append(__magic_name__   )
													UpperCAmelCase_			:      Optional[int]     						=  resnets

													if self.add_downsample:
																			UpperCAmelCase_			:      Union[str, Any]     						=  FlaxDownsampleaD(self.out_channels       ,     dtype=self.dtype   )



							def __call__(							self							:     int       ,     __magic_name__							:     Any       ,     __magic_name__							:     int       ,     __magic_name__							:     Optional[Any]=True   )					->       Optional[Any]:







													"""simple docstring"""
													UpperCAmelCase_			:      Optional[int]     						=  ()

													for resnet in self.resnets:
																			UpperCAmelCase_			:      Optional[Any]     						=  resnet(__magic_name__       ,     __magic_name__       ,     deterministic=__magic_name__   )
																			output_states += (hidden_states,)

													if self.add_downsample:
																			UpperCAmelCase_			:      Dict     						=  self.downsamplers_a(__magic_name__   )
																			output_states += (hidden_states,)

													return hidden_states, output_states





class 					__a      (nn.Module     ):
							__a					:   int
							__a					:   int
							__a					:   int
							__a					:   float									=       0.0
							__a					:   int									=       1
							__a					:   int									=       1
							__a					:   bool									=       True
							__a					:   bool									=       False
							__a					:   bool									=       False
							__a					:   bool									=       False
							__a					:   jnp.dtype									=       jnp.floataa

							def     UpperCAmelCase__	(							self							:     int   )					->       int:







													"""simple docstring"""
													UpperCAmelCase_			:      Optional[Any]     						=  []
													UpperCAmelCase_			:      Dict     						=  []

													for i in range(self.num_layers   ):
																			UpperCAmelCase_			:      List[Any]     						=  self.in_channels if (i == self.num_layers - 1) else self.out_channels
																			UpperCAmelCase_			:      str     						=  self.prev_output_channel if i == 0 else self.out_channels

																			UpperCAmelCase_			:      Any     						=  FlaxResnetBlockaD(
																			    in_channels=resnet_in_channels + res_skip_channels       ,     out_channels=self.out_channels       ,     dropout_prob=self.dropout       ,     dtype=self.dtype       ,     )
																			resnets.append(__magic_name__   )

																			UpperCAmelCase_			:      str     						=  FlaxTransformeraDModel(
																			    in_channels=self.out_channels       ,     n_heads=self.num_attention_heads       ,     d_head=self.out_channels // self.num_attention_heads       ,     depth=1       ,     use_linear_projection=self.use_linear_projection       ,     only_cross_attention=self.only_cross_attention       ,     use_memory_efficient_attention=self.use_memory_efficient_attention       ,     dtype=self.dtype       ,     )
																			attentions.append(__magic_name__   )

													UpperCAmelCase_			:      Dict     						=  resnets
													UpperCAmelCase_			:      Any     						=  attentions

													if self.add_upsample:
																			UpperCAmelCase_			:      Tuple     						=  FlaxUpsampleaD(self.out_channels       ,     dtype=self.dtype   )



							def __call__(							self							:     int       ,     __magic_name__							:     Optional[int]       ,     __magic_name__							:     Union[str, Any]       ,     __magic_name__							:     Optional[Any]       ,     __magic_name__							:     str       ,     __magic_name__							:     List[Any]=True   )					->       List[Any]:







													"""simple docstring"""
													for resnet, attn in zip(self.resnets       ,     self.attentions   ):
																			# pop res hidden states
																			UpperCAmelCase_			:      List[str]     						=  res_hidden_states_tuple[-1]
																			UpperCAmelCase_			:      int     						=  res_hidden_states_tuple[:-1]
																			UpperCAmelCase_			:      Optional[int]     						=  jnp.concatenate((hidden_states, res_hidden_states)       ,     axis=-1   )

																			UpperCAmelCase_			:      str     						=  resnet(__magic_name__       ,     __magic_name__       ,     deterministic=__magic_name__   )
																			UpperCAmelCase_			:      Optional[int]     						=  attn(__magic_name__       ,     __magic_name__       ,     deterministic=__magic_name__   )

													if self.add_upsample:
																			UpperCAmelCase_			:      int     						=  self.upsamplers_a(__magic_name__   )

													return hidden_states





class 					__a      (nn.Module     ):
							__a					:   int
							__a					:   int
							__a					:   int
							__a					:   float									=       0.0
							__a					:   int									=       1
							__a					:   bool									=       True
							__a					:   jnp.dtype									=       jnp.floataa

							def     UpperCAmelCase__	(							self							:     List[str]   )					->       int:







													"""simple docstring"""
													UpperCAmelCase_			:      Any     						=  []

													for i in range(self.num_layers   ):
																			UpperCAmelCase_			:      int     						=  self.in_channels if (i == self.num_layers - 1) else self.out_channels
																			UpperCAmelCase_			:      Any     						=  self.prev_output_channel if i == 0 else self.out_channels

																			UpperCAmelCase_			:      List[Any]     						=  FlaxResnetBlockaD(
																			    in_channels=resnet_in_channels + res_skip_channels       ,     out_channels=self.out_channels       ,     dropout_prob=self.dropout       ,     dtype=self.dtype       ,     )
																			resnets.append(__magic_name__   )

													UpperCAmelCase_			:      Optional[int]     						=  resnets

													if self.add_upsample:
																			UpperCAmelCase_			:      int     						=  FlaxUpsampleaD(self.out_channels       ,     dtype=self.dtype   )



							def __call__(							self							:     List[Any]       ,     __magic_name__							:     int       ,     __magic_name__							:     int       ,     __magic_name__							:     Union[str, Any]       ,     __magic_name__							:     str=True   )					->       Optional[Any]:







													"""simple docstring"""
													for resnet in self.resnets:
																			# pop res hidden states
																			UpperCAmelCase_			:      Tuple     						=  res_hidden_states_tuple[-1]
																			UpperCAmelCase_			:      Optional[Any]     						=  res_hidden_states_tuple[:-1]
																			UpperCAmelCase_			:      Tuple     						=  jnp.concatenate((hidden_states, res_hidden_states)       ,     axis=-1   )

																			UpperCAmelCase_			:      Dict     						=  resnet(__magic_name__       ,     __magic_name__       ,     deterministic=__magic_name__   )

													if self.add_upsample:
																			UpperCAmelCase_			:      Union[str, Any]     						=  self.upsamplers_a(__magic_name__   )

													return hidden_states





class 					__a      (nn.Module     ):
							__a					:   int
							__a					:   float									=       0.0
							__a					:   int									=       1
							__a					:   int									=       1
							__a					:   bool									=       False
							__a					:   bool									=       False
							__a					:   jnp.dtype									=       jnp.floataa

							def     UpperCAmelCase__	(							self							:     str   )					->       Tuple:







													"""simple docstring"""
													UpperCAmelCase_			:      int     						=  [
													    FlaxResnetBlockaD(
													        in_channels=self.in_channels       ,     out_channels=self.in_channels       ,     dropout_prob=self.dropout       ,     dtype=self.dtype       ,     )
													]

													UpperCAmelCase_			:      List[Any]     						=  []

													for _ in range(self.num_layers   ):
																			UpperCAmelCase_			:      Optional[Any]     						=  FlaxTransformeraDModel(
																			    in_channels=self.in_channels       ,     n_heads=self.num_attention_heads       ,     d_head=self.in_channels // self.num_attention_heads       ,     depth=1       ,     use_linear_projection=self.use_linear_projection       ,     use_memory_efficient_attention=self.use_memory_efficient_attention       ,     dtype=self.dtype       ,     )
																			attentions.append(__magic_name__   )

																			UpperCAmelCase_			:      List[str]     						=  FlaxResnetBlockaD(
																			    in_channels=self.in_channels       ,     out_channels=self.in_channels       ,     dropout_prob=self.dropout       ,     dtype=self.dtype       ,     )
																			resnets.append(__magic_name__   )

													UpperCAmelCase_			:      Any     						=  resnets
													UpperCAmelCase_			:      Optional[int]     						=  attentions



							def __call__(							self							:     str       ,     __magic_name__							:     int       ,     __magic_name__							:     Optional[int]       ,     __magic_name__							:     List[str]       ,     __magic_name__							:     List[Any]=True   )					->       Any:







													"""simple docstring"""
													UpperCAmelCase_			:      Dict     						=  self.resnets[0](__magic_name__       ,     __magic_name__   )
													for attn, resnet in zip(self.attentions       ,     self.resnets[1:]   ):
																			UpperCAmelCase_			:      Any     						=  attn(__magic_name__       ,     __magic_name__       ,     deterministic=__magic_name__   )
																			UpperCAmelCase_			:      Optional[Any]     						=  resnet(__magic_name__       ,     __magic_name__       ,     deterministic=__magic_name__   )

													return hidden_states












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


snake_case_     :       Union[str, Any]						=  "CompVis/stable-diffusion-v1-1"
snake_case_     :       Dict						=  "CompVis/stable-diffusion-v1-2"
snake_case_     :       Any						=  "CompVis/stable-diffusion-v1-3"
snake_case_     :       str						=  "CompVis/stable-diffusion-v1-4"


class 					__a      (lowerCamelCase     ):

							def __init__(							self							:     Any       ,     __magic_name__							:     AutoencoderKL       ,     __magic_name__							:     CLIPTextModel       ,     __magic_name__							:     CLIPTokenizer       ,     __magic_name__							:     UNetaDConditionModel       ,     __magic_name__							:     Union[DDIMScheduler, PNDMScheduler, LMSDiscreteScheduler]       ,     __magic_name__							:     StableDiffusionSafetyChecker       ,     __magic_name__							:     CLIPImageProcessor       ,     __magic_name__							:     bool = True       ,     )					->       str:







													"""simple docstring"""
													super()._init_()

													UpperCAmelCase_			:      Any     						=  StableDiffusionPipeline.from_pretrained(__magic_name__   )
													UpperCAmelCase_			:      Dict     						=  StableDiffusionPipeline.from_pretrained(__magic_name__   )
													UpperCAmelCase_			:      List[Any]     						=  StableDiffusionPipeline.from_pretrained(__magic_name__   )
													UpperCAmelCase_			:      Tuple     						=  StableDiffusionPipeline(
													    vae=__magic_name__       ,     text_encoder=__magic_name__       ,     tokenizer=__magic_name__       ,     unet=__magic_name__       ,     scheduler=__magic_name__       ,     safety_checker=__magic_name__       ,     feature_extractor=__magic_name__       ,     requires_safety_checker=__magic_name__       ,     )

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

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







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

							def     UpperCAmelCase__	(							self							:     Dict       ,     __magic_name__							:     Optional[Union[str, int]] = "auto"   )					->       int:







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

							def     UpperCAmelCase__	(							self							:     Tuple   )					->       List[str]:







													"""simple docstring"""
													self.enable_attention_slicing(__magic_name__   )

							@torch.no_grad()
							def     UpperCAmelCase__	(							self							:     List[Any]       ,     __magic_name__							:     Union[str, List[str]]       ,     __magic_name__							:     int = 5_12       ,     __magic_name__							:     int = 5_12       ,     __magic_name__							:     int = 50       ,     __magic_name__							:     float = 7.5       ,     __magic_name__							:     Optional[Union[str, List[str]]] = None       ,     __magic_name__							:     Optional[int] = 1       ,     __magic_name__							:     float = 0.0       ,     __magic_name__							:     Optional[torch.Generator] = None       ,     __magic_name__							:     Optional[torch.FloatTensor] = None       ,     __magic_name__							:     Optional[str] = "pil"       ,     __magic_name__							:     bool = True       ,     __magic_name__							:     Optional[Callable[[int, int, torch.FloatTensor], None]] = None       ,     __magic_name__							:     int = 1       ,     **__magic_name__							:     Tuple       ,     )					->       Optional[int]:







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

							@torch.no_grad()
							def     UpperCAmelCase__	(							self							:     Optional[int]       ,     __magic_name__							:     Union[str, List[str]]       ,     __magic_name__							:     int = 5_12       ,     __magic_name__							:     int = 5_12       ,     __magic_name__							:     int = 50       ,     __magic_name__							:     float = 7.5       ,     __magic_name__							:     Optional[Union[str, List[str]]] = None       ,     __magic_name__							:     Optional[int] = 1       ,     __magic_name__							:     float = 0.0       ,     __magic_name__							:     Optional[torch.Generator] = None       ,     __magic_name__							:     Optional[torch.FloatTensor] = None       ,     __magic_name__							:     Optional[str] = "pil"       ,     __magic_name__							:     bool = True       ,     __magic_name__							:     Optional[Callable[[int, int, torch.FloatTensor], None]] = None       ,     __magic_name__							:     int = 1       ,     **__magic_name__							:     Any       ,     )					->       Any:







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

							@torch.no_grad()
							def     UpperCAmelCase__	(							self							:     List[Any]       ,     __magic_name__							:     Union[str, List[str]]       ,     __magic_name__							:     int = 5_12       ,     __magic_name__							:     int = 5_12       ,     __magic_name__							:     int = 50       ,     __magic_name__							:     float = 7.5       ,     __magic_name__							:     Optional[Union[str, List[str]]] = None       ,     __magic_name__							:     Optional[int] = 1       ,     __magic_name__							:     float = 0.0       ,     __magic_name__							:     Optional[torch.Generator] = None       ,     __magic_name__							:     Optional[torch.FloatTensor] = None       ,     __magic_name__							:     Optional[str] = "pil"       ,     __magic_name__							:     bool = True       ,     __magic_name__							:     Optional[Callable[[int, int, torch.FloatTensor], None]] = None       ,     __magic_name__							:     int = 1       ,     **__magic_name__							:     Dict       ,     )					->       List[str]:







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

							@torch.no_grad()
							def     UpperCAmelCase__	(							self							:     int       ,     __magic_name__							:     Union[str, List[str]]       ,     __magic_name__							:     int = 5_12       ,     __magic_name__							:     int = 5_12       ,     __magic_name__							:     int = 50       ,     __magic_name__							:     float = 7.5       ,     __magic_name__							:     Optional[Union[str, List[str]]] = None       ,     __magic_name__							:     Optional[int] = 1       ,     __magic_name__							:     float = 0.0       ,     __magic_name__							:     Optional[torch.Generator] = None       ,     __magic_name__							:     Optional[torch.FloatTensor] = None       ,     __magic_name__							:     Optional[str] = "pil"       ,     __magic_name__							:     bool = True       ,     __magic_name__							:     Optional[Callable[[int, int, torch.FloatTensor], None]] = None       ,     __magic_name__							:     int = 1       ,     **__magic_name__							:     Optional[int]       ,     )					->       str:







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



							@torch.no_grad()
							def     UpperCAmelCase__	(							self							:     Optional[Any]       ,     __magic_name__							:     Union[str, List[str]]       ,     __magic_name__							:     int = 5_12       ,     __magic_name__							:     int = 5_12       ,     __magic_name__							:     int = 50       ,     __magic_name__							:     float = 7.5       ,     __magic_name__							:     Optional[Union[str, List[str]]] = None       ,     __magic_name__							:     Optional[int] = 1       ,     __magic_name__							:     float = 0.0       ,     __magic_name__							:     Optional[torch.Generator] = None       ,     __magic_name__							:     Optional[torch.FloatTensor] = None       ,     __magic_name__							:     Optional[str] = "pil"       ,     __magic_name__							:     bool = True       ,     __magic_name__							:     Optional[Callable[[int, int, torch.FloatTensor], None]] = None       ,     __magic_name__							:     int = 1       ,     **__magic_name__							:     Optional[int]       ,     )					->       List[Any]:







													"""simple docstring"""
													UpperCAmelCase_			:      int     						=  '''cuda''' if torch.cuda.is_available() else '''cpu'''
													self.to(__magic_name__   )

													# 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_			:      Optional[int]     						=  self.textaimg_sda_a(
													    prompt=__magic_name__       ,     height=__magic_name__       ,     width=__magic_name__       ,     num_inference_steps=__magic_name__       ,     guidance_scale=__magic_name__       ,     negative_prompt=__magic_name__       ,     num_images_per_prompt=__magic_name__       ,     eta=__magic_name__       ,     generator=__magic_name__       ,     latents=__magic_name__       ,     output_type=__magic_name__       ,     return_dict=__magic_name__       ,     callback=__magic_name__       ,     callback_steps=__magic_name__       ,     **__magic_name__       ,     )

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

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

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

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





