Pusheen commited on
Commit
087de1a
·
verified ·
1 Parent(s): 5060186

Update gligen/ldm/models/diffusion/plms.py

Browse files
gligen/ldm/models/diffusion/plms.py CHANGED
@@ -152,7 +152,7 @@ class PLMSSampler(object):
152
 
153
  bboxes = input['boxes_att']
154
  object_positions = input['object_position']
155
- loss2 = caculate_loss_LoCo_V2(att_second,att_first,att_third, bboxes=bboxes,
156
  object_positions=object_positions, t = index1)*loss_scale
157
  # loss = loss2
158
  # loss.requires_grad_(True)
@@ -165,7 +165,7 @@ class PLMSSampler(object):
165
  x = x - grad_cond
166
  x = x.detach()
167
  iteration += 1
168
- # torch.cuda.empty_cache()
169
  return x
170
 
171
  def update_loss_self_cross(self, input,index1, index, ts,type_loss='self_accross' ):
 
152
 
153
  bboxes = input['boxes_att']
154
  object_positions = input['object_position']
155
+ loss2 = caculate_loss_LoCo(att_second,att_first,att_third, bboxes=bboxes,
156
  object_positions=object_positions, t = index1)*loss_scale
157
  # loss = loss2
158
  # loss.requires_grad_(True)
 
165
  x = x - grad_cond
166
  x = x.detach()
167
  iteration += 1
168
+ torch.cuda.empty_cache()
169
  return x
170
 
171
  def update_loss_self_cross(self, input,index1, index, ts,type_loss='self_accross' ):