Spaces:
Running
on
Zero
Running
on
Zero
Update app_3.py
Browse files
app_3.py
CHANGED
@@ -52,6 +52,7 @@ WIDTH = 768
|
|
52 |
MAX_SEED = np.iinfo(np.int32).max
|
53 |
|
54 |
|
|
|
55 |
import supervision as sv
|
56 |
import torch
|
57 |
from PIL import Image
|
@@ -150,7 +151,7 @@ vae = AutoencoderKL.from_pretrained(sd15_name, subfolder="vae")
|
|
150 |
unet = UNet2DConditionModel.from_pretrained(sd15_name, subfolder="unet")
|
151 |
# Load model directly
|
152 |
from transformers import AutoModelForImageSegmentation
|
153 |
-
rmbg = AutoModelForImageSegmentation.from_pretrained("briaai/BRIA-RMBG-2.0", trust_remote_code=True)
|
154 |
rmbg = rmbg.to(device=device, dtype=torch.float32) # Keep this as float32
|
155 |
|
156 |
# remove bg
|
|
|
52 |
MAX_SEED = np.iinfo(np.int32).max
|
53 |
|
54 |
|
55 |
+
|
56 |
import supervision as sv
|
57 |
import torch
|
58 |
from PIL import Image
|
|
|
151 |
unet = UNet2DConditionModel.from_pretrained(sd15_name, subfolder="unet")
|
152 |
# Load model directly
|
153 |
from transformers import AutoModelForImageSegmentation
|
154 |
+
rmbg = AutoModelForImageSegmentation.from_pretrained("briaai/BRIA-RMBG-2.0", trust_remote_code=True, token=os.getenv('token'))
|
155 |
rmbg = rmbg.to(device=device, dtype=torch.float32) # Keep this as float32
|
156 |
|
157 |
# remove bg
|