better way of gating non blocking use

This commit is contained in:
drhead 2025-03-09 19:45:29 -04:00 committed by GitHub
parent c7b8e7250d
commit 8e5f33cc9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,7 +18,10 @@ class CONDRegular:
return cond
def process_cond(self, batch_size, device, **kwargs):
return self._copy_with(comfy.utils.repeat_to_batch_size(self._pin_memory(self.cond), batch_size).to(device, non_blocking=device_should_use_non_blocking(device))
if device_should_use_non_blocking(device):
return self._copy_with(comfy.utils.repeat_to_batch_size(self._pin_memory(self.cond), batch_size).to(device, non_blocking=True)
else:
return self._copy_with(comfy.utils.repeat_to_batch_size(self.cond, batch_size).to(device)
def can_concat(self, other):
if self.cond.shape != other.cond.shape: