import gradio as gr import spaces import torch from PIL import Image from simple_lama_inpainting import SimpleLama lama: SimpleLama = SimpleLama() zero = torch.Tensor([0]).cuda() print(zero.device) # <-- 'cpu' 🤔 @spaces.GPU def lama_inpainting(image: Image, mask: Image) -> Image: return lama(image, mask) inpaint = gr.Interface(fn=lama_inpainting, inputs=[gr.Image(), gr.ImageMask()], outputs=gr.Image()) inpaint.launch()