Spaces:
Sleeping
Sleeping
remove(image)
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ import random
|
|
| 6 |
from diffusers import DiffusionPipeline
|
| 7 |
import torch
|
| 8 |
from sympy.core.random import choice
|
|
|
|
| 9 |
|
| 10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 11 |
|
|
@@ -55,6 +56,10 @@ def infer(
|
|
| 55 |
generator=generator,
|
| 56 |
).images[0]
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
return image, seed
|
| 59 |
|
| 60 |
|
|
|
|
| 6 |
from diffusers import DiffusionPipeline
|
| 7 |
import torch
|
| 8 |
from sympy.core.random import choice
|
| 9 |
+
from rembg import remove
|
| 10 |
|
| 11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 12 |
|
|
|
|
| 56 |
generator=generator,
|
| 57 |
).images[0]
|
| 58 |
|
| 59 |
+
if del_back:
|
| 60 |
+
image = remove(image)
|
| 61 |
+
|
| 62 |
+
|
| 63 |
return image, seed
|
| 64 |
|
| 65 |
|