Spaces:
Sleeping
Sleeping
compress jpg more
Browse files- server/requirements.txt +1 -0
- server/util.py +1 -1
server/requirements.txt
CHANGED
@@ -11,6 +11,7 @@ controlnet-aux==0.0.7
|
|
11 |
peft==0.6.0
|
12 |
xformers; sys_platform != 'darwin' or platform_machine != 'arm64'
|
13 |
markdown2
|
|
|
14 |
stable_fast @ https://github.com/chengzeyi/stable-fast/releases/download/v1.0.2/stable_fast-1.0.2+torch211cu121-cp310-cp310-manylinux2014_x86_64.whl; sys_platform != 'darwin' or platform_machine != 'arm64'
|
15 |
oneflow @ https://github.com/siliconflow/oneflow_releases/releases/download/community_cu121/oneflow-0.9.1.dev20240123+cu121-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; sys_platform != 'darwin' or platform_machine != 'arm64'
|
16 |
git+https://github.com/siliconflow/onediff.git@main#egg=onediff; sys_platform != 'darwin' or platform_machine != 'arm64'
|
|
|
11 |
peft==0.6.0
|
12 |
xformers; sys_platform != 'darwin' or platform_machine != 'arm64'
|
13 |
markdown2
|
14 |
+
safetensors
|
15 |
stable_fast @ https://github.com/chengzeyi/stable-fast/releases/download/v1.0.2/stable_fast-1.0.2+torch211cu121-cp310-cp310-manylinux2014_x86_64.whl; sys_platform != 'darwin' or platform_machine != 'arm64'
|
16 |
oneflow @ https://github.com/siliconflow/oneflow_releases/releases/download/community_cu121/oneflow-0.9.1.dev20240123+cu121-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; sys_platform != 'darwin' or platform_machine != 'arm64'
|
17 |
git+https://github.com/siliconflow/onediff.git@main#egg=onediff; sys_platform != 'darwin' or platform_machine != 'arm64'
|
server/util.py
CHANGED
@@ -25,7 +25,7 @@ def bytes_to_pil(image_bytes: bytes) -> Image.Image:
|
|
25 |
|
26 |
def pil_to_frame(image: Image.Image) -> bytes:
|
27 |
frame_data = io.BytesIO()
|
28 |
-
image.save(frame_data, format="JPEG")
|
29 |
frame_data = frame_data.getvalue()
|
30 |
return (
|
31 |
b"--frame\r\n"
|
|
|
25 |
|
26 |
def pil_to_frame(image: Image.Image) -> bytes:
|
27 |
frame_data = io.BytesIO()
|
28 |
+
image.save(frame_data, format="JPEG", quality=80, optimize=True, progressive=True)
|
29 |
frame_data = frame_data.getvalue()
|
30 |
return (
|
31 |
b"--frame\r\n"
|