code: 
  from typing import List, Optional, Tuple, Union
  
  import torch
  
  from ...utils import randn_tensor
  from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput
  
  
  class   a_  (UpperCamelCase_    ):
  
  
  
  
         def __init__(     self   ,   snake_case_   ,   snake_case_  ):
           super().__init__()
           self.register_modules(unet=__SCREAMING_SNAKE_CASE   ,   scheduler=__SCREAMING_SNAKE_CASE  )
  
  
  
  
  
  
  
         @torch.no_grad()
         def __call__(     self   ,   snake_case_ = 1   ,   snake_case_ = None   ,   snake_case_ = 1_0_0_0   ,   snake_case_ = "pil"   ,   snake_case_ = True   ,   ):
           # Sample gaussian noise to begin loop
           if isinstance(self.unet.config.sample_size   ,   __SCREAMING_SNAKE_CASE  ):
             _lowerCAmelCase       :  Dict   				=					(
                 batch_size,
                 self.unet.config.in_channels,
                 self.unet.config.sample_size,
                 self.unet.config.sample_size,
             )
           else:
             _lowerCAmelCase       :  List[Any]   				=					(batch_size, self.unet.config.in_channels, *self.unet.config.sample_size)
  
           if self.device.type == "mps":
             # randn does not work reproducibly on mps
             _lowerCAmelCase       :  Optional[Any]   				=					randn_tensor(__SCREAMING_SNAKE_CASE   ,   generator=__SCREAMING_SNAKE_CASE  )
             _lowerCAmelCase       :  int   				=					image.to(self.device  )
           else:
             _lowerCAmelCase       :  str   				=					randn_tensor(__SCREAMING_SNAKE_CASE   ,   generator=__SCREAMING_SNAKE_CASE   ,   device=self.device  )
  
           # set step values
           self.scheduler.set_timesteps(__SCREAMING_SNAKE_CASE  )
  
           for t in self.progress_bar(self.scheduler.timesteps  ):
             # 1. predict noise model_output
             _lowerCAmelCase       :  str   				=					self.unet(__SCREAMING_SNAKE_CASE   ,   __SCREAMING_SNAKE_CASE  ).sample
  
             # 2. compute previous image: x_t -> x_t-1
             _lowerCAmelCase       :  Dict   				=					self.scheduler.step(__SCREAMING_SNAKE_CASE   ,   __SCREAMING_SNAKE_CASE   ,   __SCREAMING_SNAKE_CASE   ,   generator=__SCREAMING_SNAKE_CASE  ).prev_sample
  
           _lowerCAmelCase       :  List[Any]   				=					(image / 2 + 0.5).clamp(0   ,   1  )
           _lowerCAmelCase       :  List[Any]   				=					image.cpu().permute(0   ,   2   ,   3   ,   1  ).numpy()
           if output_type == "pil":
             _lowerCAmelCase       :  List[Any]   				=					self.numpy_to_pil(__SCREAMING_SNAKE_CASE  )
  
           if not return_dict:
             return (image,)
  
           return ImagePipelineOutput(images=__SCREAMING_SNAKE_CASE  )
  
  
  
style_context: 
  '''simple docstring'''
  
  from ..utils import DummyObject, requires_backends
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				str    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				str    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				int    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[str]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Any    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				str    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Union[str, Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Union[str, Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Dict    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Tuple    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[int]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Union[str, Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Union[str, Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[int]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Dict    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[str]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Dict    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[str]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Any    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				str    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Union[str, Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Any    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				str    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Union[str, Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[str]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Dict    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Dict    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				int    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Union[str, Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[int]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				int    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Any    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				str    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				int    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[int]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				List[str]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Union[str, Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Any    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  
  class   a_  (metaclass=_a    ):
         __lowerCAmelCase    :				Optional[Any]    =      ["""tokenizers"""]
  
  
  
  
         def __init__(     self   ,   *snake_case_   ,   **snake_case_  ):
           requires_backends(self   ,   ["""tokenizers"""]  )
  
  
  