
"""simple docstring"""



import os
from pathlib import Path
def 					lowerCamelCase   (     ):
    from torch.utils.cpp_extension import load

    UpperCAmelCase__	:      str     							=					Path(_snake_case ).resolve().parent.parent.parent / 'kernels' / 'deformable_detr'
    UpperCAmelCase__	:      List[Any]     							=					[
        root / filename
        for filename in [
            'vision.cpp',
            os.path.join('cpu'    ,'ms_deform_attn_cpu.cpp' ),
            os.path.join('cuda'    ,'ms_deform_attn_cuda.cu' ),
        ]
    ]

    load(
        'MultiScaleDeformableAttention'    ,_snake_case    ,with_cuda=_snake_case    ,extra_include_paths=[str(_snake_case )]    ,extra_cflags=['-DWITH_CUDA=1']    ,extra_cuda_cflags=[
            '-DCUDA_HAS_FP16=1',
            '-D__CUDA_NO_HALF_OPERATORS__',
            '-D__CUDA_NO_HALF_CONVERSIONS__',
            '-D__CUDA_NO_HALF2_OPERATORS__',
        ]    ,)

    import MultiScaleDeformableAttention as MSDA

    return MSDA



"""simple docstring"""



import torch

from diffusers import StableDiffusionPipeline


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

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

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

