Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -124,6 +124,8 @@ models_rbm = core.Models(
|
|
124 |
)
|
125 |
models_rbm.generator.eval().requires_grad_(False)
|
126 |
|
|
|
|
|
127 |
def infer(ref_style_file, style_description, caption):
|
128 |
global models_rbm, models_b, device
|
129 |
if low_vram:
|
@@ -249,7 +251,7 @@ def infer_compo(style_description, ref_style_file, caption, ref_sub_file):
|
|
249 |
## SAM Mask for sub
|
250 |
use_sam_mask = False
|
251 |
x0_preview = models_rbm.previewer(x0_forward)
|
252 |
-
|
253 |
sam_mask, boxes, phrases, logits = sam_model.predict(transform(x0_preview[0]), sam_prompt)
|
254 |
sam_mask = sam_mask.detach().unsqueeze(dim=0).to(device)
|
255 |
|
|
|
124 |
)
|
125 |
models_rbm.generator.eval().requires_grad_(False)
|
126 |
|
127 |
+
sam_model = LangSAM()
|
128 |
+
|
129 |
def infer(ref_style_file, style_description, caption):
|
130 |
global models_rbm, models_b, device
|
131 |
if low_vram:
|
|
|
251 |
## SAM Mask for sub
|
252 |
use_sam_mask = False
|
253 |
x0_preview = models_rbm.previewer(x0_forward)
|
254 |
+
|
255 |
sam_mask, boxes, phrases, logits = sam_model.predict(transform(x0_preview[0]), sam_prompt)
|
256 |
sam_mask = sam_mask.detach().unsqueeze(dim=0).to(device)
|
257 |
|