xxxxxxxxxx
from io import BytesIO
from PIL import Image
import requests
img_url='image_url'
# url -->content --> wrap it for BytesIO --> open as Image and then convert
img=Image.open(BytesIO(requests.get(img_url).content)).convert("RGB")
#img.show()
file = {'file' : ("name", img, 'image/jpg')} #convert # change the way you need to save it.