Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from fastapi import FastAPI, File, UploadFile, Form
|
2 |
from fastapi.responses import StreamingResponse
|
3 |
from pydantic import BaseModel
|
|
|
4 |
from typing import Optional
|
5 |
import logging
|
6 |
import os
|
@@ -211,12 +212,12 @@ def upload_file_to_s3(file_path, bucket_name, object_name=None):
|
|
211 |
@app.post("/process_image/")
|
212 |
async def process_image(
|
213 |
file: UploadFile = File(...),
|
214 |
-
seed: int = Form(
|
215 |
-
enhance_image: bool = Form(
|
216 |
-
do_remove_background: bool = Form(
|
217 |
-
foreground_ratio: float = Form(
|
218 |
-
mc_resolution: int = Form(
|
219 |
-
auth: str = Form(
|
220 |
text_prompt: Optional[str] = Form(None)
|
221 |
):
|
222 |
|
|
|
1 |
from fastapi import FastAPI, File, UploadFile, Form
|
2 |
from fastapi.responses import StreamingResponse
|
3 |
from pydantic import BaseModel
|
4 |
+
from pydantic import Field
|
5 |
from typing import Optional
|
6 |
import logging
|
7 |
import os
|
|
|
212 |
@app.post("/process_image/")
|
213 |
async def process_image(
|
214 |
file: UploadFile = File(...),
|
215 |
+
seed: int = Form(0, ge=0, le=100), # Seed must be between 0 and 100
|
216 |
+
enhance_image: bool = Form(False), # Default enhance_image value
|
217 |
+
do_remove_background: bool = Form(True), # Default do_remove_background value
|
218 |
+
foreground_ratio: float = Form(0.85, gt=0.0, lt=1.0), # Ratio must be between 0.0 and 1.0 (exclusive)
|
219 |
+
mc_resolution: int = Form(285, ge=32, le=320), # Resolution must be between 256 and 4096
|
220 |
+
auth: str = Form("default_auth_token"), # Default auth token
|
221 |
text_prompt: Optional[str] = Form(None)
|
222 |
):
|
223 |
|