Skip to content

Commit 1824d00

Browse files
Laiskysayakpaul
andauthored
fix: load_image should support PIL Image (#6904)
Co-authored-by: Sayak Paul <[email protected]>
1 parent 30e5e81 commit 1824d00

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/diffusers/utils/loading_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def load_image(
3232
raise ValueError(
3333
f"Incorrect path or URL. URLs must start with `http://` or `https://`, and {image} is not a valid path."
3434
)
35+
elif isinstance(image, PIL.Image.Image):
36+
image = image
3537
else:
3638
raise ValueError(
3739
"Incorrect format used for the image. Should be a URL linking to an image, a local path, or a PIL image."

0 commit comments

Comments
 (0)