Skip to content

Commit 55a23b2

Browse files
authored
Merge pull request #1 from drozbay/kjcomfyui_pr_20251126
Add handling for audio_embed
2 parents 7c5d3f2 + b621f48 commit 55a23b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

comfy/context_windows.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ def get_resized_cond(self, cond_in: list[dict], x_in: torch.Tensor, window: Inde
170170
if (self.dim < cond_value.ndim and cond_value(self.dim) == x_in.size(self.dim)) or \
171171
(cond_value.ndim < self.dim and cond_value.size(0) == x_in.size(self.dim)):
172172
new_cond_item[cond_key] = window.get_tensor(cond_value, device)
173+
# Handle audio_embed (temporal dim is 1)
174+
elif cond_key == "audio_embed" and hasattr(cond_value, "cond") and isinstance(cond_value.cond, torch.Tensor):
175+
audio_cond = cond_value.cond
176+
if audio_cond.ndim > 1 and audio_cond.size(1) == x_in.size(self.dim):
177+
new_cond_item[cond_key] = cond_value._copy_with(window.get_tensor(audio_cond, device, dim=1))
173178
# if has cond that is a Tensor, check if needs to be subset
174179
elif hasattr(cond_value, "cond") and isinstance(cond_value.cond, torch.Tensor):
175180
if (self.dim < cond_value.cond.ndim and cond_value.cond.size(self.dim) == x_in.size(self.dim)) or \

0 commit comments

Comments
 (0)