longlian commited on
Commit
89ec139
1 Parent(s): d0a6163

Update lvd_pipeline.py

Browse files
Files changed (1) hide show
  1. lvd_pipeline.py +2 -1
lvd_pipeline.py CHANGED
@@ -758,7 +758,8 @@ class GroundedTextToVideoSDPipeline(DiffusionPipeline, TextualInversionLoaderMix
758
  # we represent the location information as (xmin,ymin,xmax,ymax)
759
  boxes = torch.zeros(max_objs, 4, device=device,
760
  dtype=self.text_encoder.dtype)
761
- boxes[:n_objs] = torch.tensor(lvd_gligen_boxes_frame)
 
762
  text_embeddings = torch.zeros(
763
  max_objs, self.unet.cross_attention_dim, device=device, dtype=self.text_encoder.dtype
764
  )
 
758
  # we represent the location information as (xmin,ymin,xmax,ymax)
759
  boxes = torch.zeros(max_objs, 4, device=device,
760
  dtype=self.text_encoder.dtype)
761
+ if n_objs:
762
+ boxes[:n_objs] = torch.tensor(lvd_gligen_boxes_frame)
763
  text_embeddings = torch.zeros(
764
  max_objs, self.unet.cross_attention_dim, device=device, dtype=self.text_encoder.dtype
765
  )