


from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
 import accelerate




def        snake_case_					(  snake_case					)  ->    Any:
       if not is_accelerate_available():
              return method
       lowercase__:       Optional[int]        =       version.parse(accelerate.__version__					).base_version
       if version.parse(snake_case					) < version.parse('0.17.0'					):
              return method

       def wrapper(self      ,							*snake_case      ,							**snake_case					):
              if hasattr(self      ,							'_hf_hook'					) and hasattr(self._hf_hook      ,							'pre_forward'					):
                     self._hf_hook.pre_forward(self					)
              return method(self      ,							*snake_case      ,							**snake_case					)

       return wrapper






import torch

from diffusers import StableDiffusionPipeline


__lowerCAmelCase			=							'''path-to-your-trained-model'''
__lowerCAmelCase			=							StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.floataa).to('''cuda''')

__lowerCAmelCase			=							'''A photo of sks dog in a bucket'''
__lowerCAmelCase			=							pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]

image.save('''dog-bucket.png''')


