Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make input_image the right format? #131

Open
derekcbr opened this issue Oct 23, 2023 · 1 comment
Open

How to make input_image the right format? #131

derekcbr opened this issue Oct 23, 2023 · 1 comment

Comments

@derekcbr
Copy link

image0 = Image.open("C:\city.pang")
unit1 = webuiapi.ControlNetUnit(input_image=image0, module='canny', model='control_canny-fp16 [e3fe7712]')
But it shows an error TypeError: Object of type PngImageFile is not JSON serializable
How to get the right input image format?

@davidmartinrius
Copy link
Contributor

You need to do like this. The input file must be a PIL object:

from PIL import Image

image0 = Image.open("C:\city.pang")
unit1 = webuiapi.ControlNetUnit(input_image=image0, module='canny', model='control_canny-fp16 [e3fe7712]')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants