sdwebuiapi
sdwebuiapi copied to clipboard
How to make input_image the right format?
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?
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]')