1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Make it easier to pass lists of tensors to models. (#8358)

This commit is contained in:
comfyanonymous
2025-05-31 17:00:20 -07:00
committed by GitHub
parent 97f23b81f3
commit 19e45e9b0e
2 changed files with 47 additions and 0 deletions

View File

@@ -168,6 +168,11 @@ class BaseModel(torch.nn.Module):
if hasattr(extra, "dtype"):
if extra.dtype != torch.int and extra.dtype != torch.long:
extra = extra.to(dtype)
if isinstance(extra, list):
ex = []
for ext in extra:
ex.append(ext.to(dtype))
extra = ex
extra_conds[o] = extra
t = self.process_timestep(t, x=x, **extra_conds)