



def      lowerCAmelCase__  (							_SCREAMING_SNAKE_CASE				:	str ,   _SCREAMING_SNAKE_CASE				:	Dict			):
				"""simple docstring"""







				__a        =						[1]
				for i in range(2 ,   lowerCamelCase__			):
								factorials.append(factorials[-1] * i			)
				assert 0 <= k < factorials[-1] * n, "k out of bounds"

				__a        =						[]
				__a        =						list(range(lowerCamelCase__			)			)

				# Find permutation
				while factorials:
								__a        =						factorials.pop()
								__a        =						divmod(lowerCamelCase__ ,   lowerCamelCase__			)
								permutation.append(elements[number]			)
								elements.remove(elements[number]			)
				permutation.append(elements[0]			)

				return permutation


if __name__ == "__main__":
						import doctest

						doctest.testmod()





'''simple docstring'''




import torch

from diffusers import StableDiffusionPipeline


lowerCamelCase							:Tuple				    =					'''path-to-your-trained-model'''
lowerCamelCase							:Optional[int]				    =					StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.floataa).to('''cuda''')

lowerCamelCase							:Optional[int]				    =					'''A photo of sks dog in a bucket'''
lowerCamelCase							:List[Any]				    =					pipe(prompt, num_inference_steps=5_0, guidance_scale=7.5).images[0]

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