Add PIL Image support to InferenceClient (#3199)
* Add PIL Image support to InferenceClient
- Add PIL Image to ContentT type hints for type checking
- Update _open_as_binary to handle PIL Images by converting to bytes
- Update _as_url to detect MIME type from PIL Image format
- Update docstrings to indicate PIL Image support for all image methods
- Fixes #3191: Make InferenceClient accept Pillow images
This enables iterative image editing workflows where PIL Images returned
by image_to_image can be directly passed back to image_to_image methods
without the 'Unsupported input type for image' error.
* Make style
* Address comments
* Apply suggestion from @Wauplin
* Apply suggestion from @Wauplin
* Apply style fixes
* Apply suggestions from code review
Co-authored-by: célina <hanouticelina@gmail.com>
* add tests
* style
---------
Co-authored-by: Lucain <lucainp@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: célina <hanouticelina@gmail.com>