Spaces:
Sleeping
Sleeping
Bobby
commited on
Commit
·
01be129
1
Parent(s):
6aa594d
nice
Browse files
app.py
CHANGED
|
@@ -403,7 +403,6 @@ def process_image(
|
|
| 403 |
guidance_scale,
|
| 404 |
seed,
|
| 405 |
):
|
| 406 |
-
# torch.cuda.synchronize()
|
| 407 |
preprocess_start = time.time()
|
| 408 |
print("processing image")
|
| 409 |
|
|
@@ -434,11 +433,12 @@ def process_image(
|
|
| 434 |
image=control_image,
|
| 435 |
).images[0]
|
| 436 |
print(f"\n-------------------------Inference done in: {time.time() - start:.2f} seconds-------------------------")
|
| 437 |
-
# torch.cuda.synchronize()
|
| 438 |
torch.cuda.empty_cache()
|
|
|
|
|
|
|
| 439 |
timestamp = int(time.time())
|
| 440 |
img_path = f"{timestamp}.jpg"
|
| 441 |
-
results_path = f"{timestamp}
|
| 442 |
imageio.imsave(img_path, image)
|
| 443 |
imageio.imsave(results_path, results)
|
| 444 |
api.upload_file(
|
|
|
|
| 403 |
guidance_scale,
|
| 404 |
seed,
|
| 405 |
):
|
|
|
|
| 406 |
preprocess_start = time.time()
|
| 407 |
print("processing image")
|
| 408 |
|
|
|
|
| 433 |
image=control_image,
|
| 434 |
).images[0]
|
| 435 |
print(f"\n-------------------------Inference done in: {time.time() - start:.2f} seconds-------------------------")
|
|
|
|
| 436 |
torch.cuda.empty_cache()
|
| 437 |
+
|
| 438 |
+
# upload block
|
| 439 |
timestamp = int(time.time())
|
| 440 |
img_path = f"{timestamp}.jpg"
|
| 441 |
+
results_path = f"{timestamp}_out.jpg"
|
| 442 |
imageio.imsave(img_path, image)
|
| 443 |
imageio.imsave(results_path, results)
|
| 444 |
api.upload_file(
|