Spaces:
Sleeping
Sleeping
chips
commited on
Commit
·
2bc1f58
1
Parent(s):
11de45a
added sleep to emulate status updates
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from fastapi import FastAPI, File, UploadFile, Form
|
| 2 |
import httpx
|
| 3 |
from fastapi.responses import JSONResponse
|
| 4 |
from io import BytesIO
|
|
@@ -42,16 +42,22 @@ async def virtual_try_on(talent_trigger_word: str = Form(...),
|
|
| 42 |
|
| 43 |
request_id = str(uuid.uuid4())
|
| 44 |
r.set(request_id, "pending")
|
|
|
|
| 45 |
# step 1, make the base image
|
| 46 |
r.set(request_id, "Creating Base Images")
|
|
|
|
| 47 |
# step 2, combine the garment images
|
| 48 |
r.set(request_id, "Combining Garment Images")
|
|
|
|
| 49 |
# step 3, style the talent
|
| 50 |
r.set(request_id, "Styling Talent")
|
|
|
|
| 51 |
# step 4, create variations
|
| 52 |
r.set(request_id, "Creating Variations")
|
|
|
|
| 53 |
#step 5. Upscale the images
|
| 54 |
r.set(request_id, "Upscaling Images")
|
|
|
|
| 55 |
# step 6, return the result
|
| 56 |
r.set(request_id, "Completed")
|
| 57 |
return(request_id)
|
|
|
|
| 1 |
+
from fastapi import FastAPI, File, UploadFile, Form, BackgroundTasks
|
| 2 |
import httpx
|
| 3 |
from fastapi.responses import JSONResponse
|
| 4 |
from io import BytesIO
|
|
|
|
| 42 |
|
| 43 |
request_id = str(uuid.uuid4())
|
| 44 |
r.set(request_id, "pending")
|
| 45 |
+
sleep(5)
|
| 46 |
# step 1, make the base image
|
| 47 |
r.set(request_id, "Creating Base Images")
|
| 48 |
+
sleep(5)
|
| 49 |
# step 2, combine the garment images
|
| 50 |
r.set(request_id, "Combining Garment Images")
|
| 51 |
+
sleep(5)
|
| 52 |
# step 3, style the talent
|
| 53 |
r.set(request_id, "Styling Talent")
|
| 54 |
+
sleep(5)
|
| 55 |
# step 4, create variations
|
| 56 |
r.set(request_id, "Creating Variations")
|
| 57 |
+
sleep(5)
|
| 58 |
#step 5. Upscale the images
|
| 59 |
r.set(request_id, "Upscaling Images")
|
| 60 |
+
sleep(5)
|
| 61 |
# step 6, return the result
|
| 62 |
r.set(request_id, "Completed")
|
| 63 |
return(request_id)
|