






"""simple docstring"""



from typing import Any, Callable, Dict, List, Optional, Union

import PIL.Image
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMScheduler,
    DiffusionPipeline,
    LMSDiscreteScheduler,
    PNDMScheduler,
    StableDiffusionImgaImgPipeline,
    StableDiffusionInpaintPipelineLegacy,
    StableDiffusionPipeline,
    UNetaDConditionModel,
)
from diffusers.configuration_utils import FrozenDict
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
from diffusers.utils import deprecate, logging


_UpperCamelCase						:    List[Any]		=						logging.get_logger(__name__)  # pylint: disable=invalid-name

class 			a	(  SCREAMING_SNAKE_CASE__      ):
    UpperCAmelCase_					:	List[str]      	=["safety_checker", "feature_extractor"]







    def __init__(     self				,						_lowerCamelCase				,						_lowerCamelCase				,						_lowerCamelCase				,						_lowerCamelCase				,						_lowerCamelCase				,						_lowerCamelCase				,						_lowerCamelCase				,						_lowerCamelCase = True				,						):
      super().__init__()
      if hasattr(scheduler.config				,						'steps_offset'			) and scheduler.config.steps_offset != 1:
        lowercase				       =			(
            F'The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`'
            F' should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure '
            'to update the config accordingly as leaving `steps_offset` might led to incorrect results'
            ' in future versions. If you have downloaded this checkpoint from the Hugging Face Hub,'
            ' it would be very nice if you could open a Pull request for the `scheduler/scheduler_config.json`'
            ' file'
        )
        deprecate('steps_offset!=1'				,						'1.0.0'				,						_lowerCamelCase				,						standard_warn=_lowerCamelCase			)
        lowercase				       =			dict(scheduler.config			)
        lowercase				       =			1
        lowercase				       =			FrozenDict(_lowerCamelCase			)

      self.register_modules(
          vae=_lowerCamelCase				,						text_encoder=_lowerCamelCase				,						tokenizer=_lowerCamelCase				,						unet=_lowerCamelCase				,						scheduler=_lowerCamelCase				,						safety_checker=_lowerCamelCase				,						feature_extractor=_lowerCamelCase				,						)
      self.register_to_config(requires_safety_checker=_lowerCamelCase			)







    @property
    def      UpperCamelCase_ (     self			):
      return {k: getattr(self				,						_lowerCamelCase			) for k in self.config.keys() if not k.startswith('_'			)}







    def      UpperCamelCase_ (     self				,						_lowerCamelCase = "auto"			):
      if slice_size == "auto":
        # half the attention head size is usually a good trade-off between
        # speed and memory
        lowercase				       =			self.unet.config.attention_head_dim // 2
      self.unet.set_attention_slice(_lowerCamelCase			)







    def      UpperCamelCase_ (     self			):
      self.enable_attention_slicing(_lowerCamelCase			)







    @torch.no_grad()
    def      UpperCamelCase_ (     self				,						_lowerCamelCase				,						_lowerCamelCase				,						_lowerCamelCase				,						_lowerCamelCase = 0.8				,						_lowerCamelCase = 5_0				,						_lowerCamelCase = 7.5				,						_lowerCamelCase = None				,						_lowerCamelCase = 1				,						_lowerCamelCase = 0.0				,						_lowerCamelCase = None				,						_lowerCamelCase = "pil"				,						_lowerCamelCase = True				,						_lowerCamelCase = None				,						_lowerCamelCase = 1				,						):
      # For more information on how this function works, please see: https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion#diffusers.StableDiffusionImg2ImgPipeline
      return StableDiffusionInpaintPipelineLegacy(**self.components			)(
          prompt=_lowerCamelCase				,						image=_lowerCamelCase				,						mask_image=_lowerCamelCase				,						strength=_lowerCamelCase				,						num_inference_steps=_lowerCamelCase				,						guidance_scale=_lowerCamelCase				,						negative_prompt=_lowerCamelCase				,						num_images_per_prompt=_lowerCamelCase				,						eta=_lowerCamelCase				,						generator=_lowerCamelCase				,						output_type=_lowerCamelCase				,						return_dict=_lowerCamelCase				,						callback=_lowerCamelCase				,						)







    @torch.no_grad()
    def      UpperCamelCase_ (     self				,						_lowerCamelCase				,						_lowerCamelCase				,						_lowerCamelCase = 0.8				,						_lowerCamelCase = 5_0				,						_lowerCamelCase = 7.5				,						_lowerCamelCase = None				,						_lowerCamelCase = 1				,						_lowerCamelCase = 0.0				,						_lowerCamelCase = None				,						_lowerCamelCase = "pil"				,						_lowerCamelCase = True				,						_lowerCamelCase = None				,						_lowerCamelCase = 1				,						**_lowerCamelCase				,						):
      # For more information on how this function works, please see: https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion#diffusers.StableDiffusionImg2ImgPipeline
      return StableDiffusionImgaImgPipeline(**self.components			)(
          prompt=_lowerCamelCase				,						image=_lowerCamelCase				,						strength=_lowerCamelCase				,						num_inference_steps=_lowerCamelCase				,						guidance_scale=_lowerCamelCase				,						negative_prompt=_lowerCamelCase				,						num_images_per_prompt=_lowerCamelCase				,						eta=_lowerCamelCase				,						generator=_lowerCamelCase				,						output_type=_lowerCamelCase				,						return_dict=_lowerCamelCase				,						callback=_lowerCamelCase				,						callback_steps=_lowerCamelCase				,						)







    @torch.no_grad()
    def      UpperCamelCase_ (     self				,						_lowerCamelCase				,						_lowerCamelCase = 5_1_2				,						_lowerCamelCase = 5_1_2				,						_lowerCamelCase = 5_0				,						_lowerCamelCase = 7.5				,						_lowerCamelCase = None				,						_lowerCamelCase = 1				,						_lowerCamelCase = 0.0				,						_lowerCamelCase = None				,						_lowerCamelCase = None				,						_lowerCamelCase = "pil"				,						_lowerCamelCase = True				,						_lowerCamelCase = None				,						_lowerCamelCase = 1				,						):
      # For more information on how this function https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion#diffusers.StableDiffusionPipeline
      return StableDiffusionPipeline(**self.components			)(
          prompt=_lowerCamelCase				,						height=_lowerCamelCase				,						width=_lowerCamelCase				,						num_inference_steps=_lowerCamelCase				,						guidance_scale=_lowerCamelCase				,						negative_prompt=_lowerCamelCase				,						num_images_per_prompt=_lowerCamelCase				,						eta=_lowerCamelCase				,						generator=_lowerCamelCase				,						latents=_lowerCamelCase				,						output_type=_lowerCamelCase				,						return_dict=_lowerCamelCase				,						callback=_lowerCamelCase				,						callback_steps=_lowerCamelCase				,						)







"""simple docstring"""




def 	lowercase__  (      )  ->      Any:






      '''simple docstring'''


      lowercase	:   Dict											= 1

      while True:
            if (
                sorted(str(_UpperCAmelCase					)					)
                == sorted(str(2 * i					)					)
                == sorted(str(3 * i					)					)
                == sorted(str(4 * i					)					)
                == sorted(str(5 * i					)					)
                == sorted(str(6 * i					)					)
            ):
                  return i

            i += 1


if __name__ == "__main__":
     print(solution())
