From 94ada4b8a001664b9904195313dce93f7863d77b Mon Sep 17 00:00:00 2001 From: Alexander McKinney Date: Wed, 23 Nov 2022 08:41:31 +0000 Subject: [PATCH 1/2] updates img2img_inpainting README --- examples/community/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/community/README.md b/examples/community/README.md index 108f6f95f1b4..bfb4fc93df7a 100644 --- a/examples/community/README.md +++ b/examples/community/README.md @@ -602,7 +602,7 @@ For example, this could be used to place a logo on a shirt and make it blend sea import PIL import torch -from diffusers import StableDiffusionInpaintPipeline +from diffusers import DiffusionPipeline image_path = "./path-to-image.png" inner_image_path = "./path-to-inner-image.png" @@ -612,10 +612,11 @@ init_image = PIL.Image.open(image_path).convert("RGB").resize((512, 512)) inner_image = PIL.Image.open(inner_image_path).convert("RGBA").resize((512, 512)) mask_image = PIL.Image.open(mask_path).convert("RGB").resize((512, 512)) -pipe = StableDiffusionInpaintPipeline.from_pretrained( +pipe = DiffusionPipeline.from_pretrained( "runwayml/stable-diffusion-inpainting", + custom_pipeline="img2img_inpainting", revision="fp16", - torch_dtype=torch.float16, + torch_dtype=torch.float16 ) pipe = pipe.to("cuda") From 4f785c3965ca16619b9cacb48bdab45bf15f2852 Mon Sep 17 00:00:00 2001 From: Alex McKinney <44398246+vvvm23@users.noreply.github.com> Date: Wed, 23 Nov 2022 09:01:44 +0000 Subject: [PATCH 2/2] Adds example image to community pipeline README --- examples/community/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/community/README.md b/examples/community/README.md index bfb4fc93df7a..660f64098b52 100644 --- a/examples/community/README.md +++ b/examples/community/README.md @@ -624,6 +624,8 @@ prompt = "Your prompt here!" image = pipe(prompt=prompt, image=init_image, inner_image=inner_image, mask_image=mask_image).images[0] ``` +![2 by 2 grid demonstrating image to image inpainting.](https://user-images.githubusercontent.com/44398246/203506577-ec303be4-887e-4ebd-a773-c83fcb3dd01a.png) + ### Text Based Inpainting Stable Diffusion Use a text prompt to generate the mask for the area to be inpainted.