fffiloni commited on
Commit
241d1e2
1 Parent(s): 2de1e49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -251,8 +251,10 @@ def infer_compo(style_description, ref_style_file, caption, ref_sub_file):
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
 
258
  conditions = core.get_conditions(batch, models_rbm, extras, is_eval=True, is_unconditional=False, eval_image_embeds=True, eval_subject_style=True, eval_csd=False)
 
251
  ## SAM Mask for sub
252
  use_sam_mask = False
253
  x0_preview = models_rbm.previewer(x0_forward)
254
+
255
+ x0_preview_pil = T.ToPILImage()(x0_preview[0].cpu())
256
+ sam_mask, boxes, phrases, logits = sam_model.predict(x0_preview_pil, sam_prompt)
257
+ # sam_mask, boxes, phrases, logits = sam_model.predict(transform(x0_preview[0]), sam_prompt)
258
  sam_mask = sam_mask.detach().unsqueeze(dim=0).to(device)
259
 
260
  conditions = core.get_conditions(batch, models_rbm, extras, is_eval=True, is_unconditional=False, eval_image_embeds=True, eval_subject_style=True, eval_csd=False)