Upload data to model instead of file name

Hey all. I had a quick question regarding the upload part of roboflow modeling. It seems to me that I have to upload a file name to the model.predict() function but I was wondering if there was any way in which I could directly upload the data instead?

This is the code I am talking about

result_json = model.predict('scan_image.png', confidence=10, overlap=30).json()

Hi there! Can you explain what you mean by directly upload? Do you mean use a URL of an image hosted online?

I am running a website and there is a file uploader which takes in an image. This image is then stored using BytesIO and this is what I want to upload into the model instead of dumping it into an image.jpg file on my computer and pulling the file address from that