1
Some checks failed
CI / lint (push) Failing after 11s

This commit is contained in:
zcr
2026-03-18 11:09:01 +08:00
parent 1c33f35aed
commit b3eda2f7c7
49 changed files with 105 additions and 36 deletions

17
app/litserve/client.py Executable file
View File

@@ -0,0 +1,17 @@
import requests
import base64
# 将你的图片转为 base64
with open("/mnt/data/workspace/Code/flux2/20260123_152354_2steps.png", "rb") as f:
img_base64 = base64.b64encode(f.read()).decode("utf-8")
response = requests.post("http://localhost:8451/predict", json={
# "image": img_base64,
"prompt": "紫色实木窗帘",
"aspect_ratio": "1:1",
"steps": 4
})
# 保存结果
with open("result.png", "wb") as f:
f.write(base64.b64decode(response.json()["image"]))