mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-27 06:00:05 +08:00
change to device_supports_non_blocking
This commit is contained in:
parent
d175cbd315
commit
87f4673af9
@ -1,7 +1,7 @@
|
|||||||
import torch
|
import torch
|
||||||
import math
|
import math
|
||||||
import comfy.utils
|
import comfy.utils
|
||||||
from comfy.model_management import device_should_use_non_blocking
|
from comfy.model_management import device_supports_non_blocking
|
||||||
|
|
||||||
|
|
||||||
class CONDRegular:
|
class CONDRegular:
|
||||||
@ -18,7 +18,7 @@ class CONDRegular:
|
|||||||
return cond
|
return cond
|
||||||
|
|
||||||
def process_cond(self, batch_size, device, **kwargs):
|
def process_cond(self, batch_size, device, **kwargs):
|
||||||
if device_should_use_non_blocking(device):
|
if device_supports_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))
|
return self._copy_with(comfy.utils.repeat_to_batch_size(self._pin_memory(self.cond), batch_size).to(device, non_blocking=True))
|
||||||
else:
|
else:
|
||||||
return self._copy_with(comfy.utils.repeat_to_batch_size(self.cond, batch_size).to(device))
|
return self._copy_with(comfy.utils.repeat_to_batch_size(self.cond, batch_size).to(device))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user