From 918c1589ef30595668899f4259ece6a4ad605c69 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Thu, 10 Nov 2022 20:16:47 +0000 Subject: [PATCH] fix #1402 --- ldm/generate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ldm/generate.py b/ldm/generate.py index e2d4a40de7..55cd5c5435 100644 --- a/ldm/generate.py +++ b/ldm/generate.py @@ -1033,7 +1033,9 @@ class Generate: return True return False - def _check_for_erasure(self, image): + def _check_for_erasure(self, image:Image.Image)->bool: + if image.mode not in ('RGBA','RGB'): + return False width, height = image.size pixdata = image.load() colored = 0