diff --git a/src/diffusers/utils/loading_utils.py b/src/diffusers/utils/loading_utils.py index e129d5f3e366..18f6ead64c4e 100644 --- a/src/diffusers/utils/loading_utils.py +++ b/src/diffusers/utils/loading_utils.py @@ -32,6 +32,8 @@ def load_image( raise ValueError( f"Incorrect path or URL. URLs must start with `http://` or `https://`, and {image} is not a valid path." ) + elif isinstance(image, PIL.Image.Image): + image = image else: raise ValueError( "Incorrect format used for the image. Should be a URL linking to an image, a local path, or a PIL image."