Download image_ops.py from Kingoteam/fastsdcpu: direct link, hf CLI and curl.
- Browser
- Download file 262 Bytes
-
https://huggingface.co/spaces/Kingoteam/fastsdcpu/resolve/main/image_ops.py
- Command line
-
hf download hf://spaces/Kingoteam/fastsdcpu/image_ops.py
-
curl -L -o image_ops.py https://huggingface.co/spaces/Kingoteam/fastsdcpu/resolve/main/image_ops.py
262 Bytes
| from PIL import Image | |
| def resize_pil_image( | |
| pil_image: Image, | |
| image_width, | |
| image_height, | |
| ): | |
| return pil_image.convert("RGB").resize( | |
| ( | |
| image_width, | |
| image_height, | |
| ), | |
| Image.Resampling.LANCZOS, | |
| ) | |