From df476d9f63891406db2d531aa5faf195193e3354 Mon Sep 17 00:00:00 2001 From: raven Date: Wed, 20 Dec 2023 06:14:37 +0900 Subject: [PATCH] [Docs] Fix a code example in the ControlNet Inpainting documentation (#6236) fix document on masked image in inpainting controlnet --- docs/source/en/using-diffusers/controlnet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/en/using-diffusers/controlnet.md b/docs/source/en/using-diffusers/controlnet.md index c50d2e96e8..e7f6eb2756 100644 --- a/docs/source/en/using-diffusers/controlnet.md +++ b/docs/source/en/using-diffusers/controlnet.md @@ -203,7 +203,7 @@ def make_inpaint_condition(image, image_mask): image_mask = np.array(image_mask.convert("L")).astype(np.float32) / 255.0 assert image.shape[0:1] == image_mask.shape[0:1] - image[image_mask > 0.5] = 1.0 # set as masked pixel + image[image_mask > 0.5] = -1.0 # set as masked pixel image = np.expand_dims(image, 0).transpose(0, 3, 1, 2) image = torch.from_numpy(image) return image