INNER CODE UNIT · Python

img

kiri-art/docker-diffusers-api · api/app.py:542

        img = patch_match.inpaint(img, mask=255 - mask, patch_size=3)
        model_inputs["init_image"] = PIL.Image.fromarray(img)
        mask = 255 - mask
        mask = skimage.measure.block_reduce(mask, (8, 8), np.max)
        mask = mask.repeat(8, axis=0).repeat(8, axis=1)
        model_inputs["mask_image"] = PIL.Image.fromarray(mask)

    # Turning on takes 3ms and turning off 1ms... don't worry, I've got your back :)
    # x_m_e_a = call_inputs.get("xformers_memory_efficient_attention", True)
    # last_x_m_e_a = last_xformers_memory_efficient_attention.get(pipeline, None)
    # if x_m_e_a != last_x_m_e_a:
    #     if x_m_e_a == True:
    #         print("pipeline.enable_xformers_memory_efficient_attention()")
    #         pipeline.enable_xformers_memory_efficient_attention()  # default on
    #     elif x_m_e_a == False:
    #         print("pipeline.disable_xformers_memory_efficient_attention()")
    #         pipeline.disable_xformers_memory_efficient_attention()
    #     else:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…