runwayml / stable-diffusion

Latent Text-to-Image Diffusion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demo for Stable Diffusion Inpainting takes about 2 minutes per image

dqj5182 opened this issue · comments

After running this code

from diffusers import StableDiffusionInpaintPipeline

pipe = StableDiffusionInpaintPipeline.from_pretrained(
    "runwayml/stable-diffusion-inpainting",
    revision="fp16",
    torch_dtype=torch.float16,
)
prompt = "Face of a yellow cat, high resolution, sitting on a park bench"
#image and mask_image should be PIL images.
#The mask structure is white for inpainting and black for keeping as is
image = pipe(prompt=prompt, image=image, mask_image=mask_image).images[0]
image.save("./yellow_cat_on_park_bench.png")

it takes about 2 minutes for me to process one image.
May I ask any ways to process image in-painting with Stable Diffusion much faster (at least less than 30 seconds)?