Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,9 @@ python api_server.py --host 0.0.0.0 --port 8080
A demo post request for image to 3D without texture.

```bash
img_b64_str=$(base64 -i assets/demo.png)
curl -X POST "http://localhost:8080/generate" \
-H "Content-Type: application/json" \
-d '{
"image": "'"$img_b64_str"'",
}' \
-d '{ "image_file": "assets/demo.png" }' \
-o test2.glb
```

Expand Down
3 changes: 3 additions & 0 deletions api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ def generate(self, uid, params):
if 'image' in params:
image = params["image"]
image = load_image_from_base64(image)
elif 'image_file' in params:
image_file = params["image_file"]
image = Image.open(image_file)
else:
if 'text' in params:
text = params["text"]
Expand Down