

import torch

from diffusers import DiffusionPipeline



class   __lowercase    (			UpperCAmelCase_     ):




			"""simple docstring"""







			def __init__(			self  :					Optional[int]       ,						lowerCAmelCase__  :					Union[str, Any]       ,						lowerCAmelCase__  :					str):
									super().__init__()

									self.register_modules(unet=lowerCAmelCase__       ,						scheduler=lowerCAmelCase__)




			def __call__(			self  :					Union[str, Any]):
									SCREAMING_SNAKE_CASE_:			Any  		=	torch.randn(
									    (1, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size)       ,						)
									SCREAMING_SNAKE_CASE_:			Dict  		=	1

									SCREAMING_SNAKE_CASE_:			Union[str, Any]  		=	self.unet(lowerCAmelCase__       ,						lowerCAmelCase__).sample
									SCREAMING_SNAKE_CASE_:			int  		=	self.scheduler.step(lowerCAmelCase__       ,						lowerCAmelCase__       ,						lowerCAmelCase__).prev_sample

									SCREAMING_SNAKE_CASE_:			Optional[Any]  		=	scheduler_output - scheduler_output + torch.ones_like(lowerCAmelCase__)

									return result









import torch

from diffusers import StableDiffusionPipeline


lowerCAmelCase							:  Any            =						"""path-to-your-trained-model"""
lowerCAmelCase							:  int            =						StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.floataa).to("""cuda""")

lowerCAmelCase							:  Union[str, Any]            =						"""A photo of sks dog in a bucket"""
lowerCAmelCase							:  Any            =						pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]

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






