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