sdwebuiapi icon indicating copy to clipboard operation
sdwebuiapi copied to clipboard

How to make input_image the right format?

Open derekcbr opened this issue 1 year ago • 1 comments

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?

derekcbr avatar Oct 23 '23 14:10 derekcbr

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]')

davidmartinrius avatar Nov 30 '23 16:11 davidmartinrius