Skip to content

Commit c9edd2d

Browse files
committed
LTX2 context windows - Add handling for downscaled IC-Lora guide frames
1 parent f1acd5b commit c9edd2d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

comfy/context_windows.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,15 @@ def inject_guide_frames_into_window(video_slice: torch.Tensor, window: ContextWi
198198
window.guide_frames_indices = suffix_idx
199199
window.guide_overlap_info = overlap_info
200200
window.guide_kf_local_positions = kf_local_pos
201+
# Derive per-overlap-entry latent_downscale_factor from guide entry latent_shape vs guide frame spatial dims.
202+
# guide_frames has full (post-dilation) spatial dims; entry["latent_shape"] has pre-dilation dims.
203+
guide_downscale_factors = []
204+
if guide_frame_count > 0:
205+
full_H = guide_frames.shape[3]
206+
for entry_idx, _ in overlap_info:
207+
entry_H = guide_entries[entry_idx]["latent_shape"][1]
208+
guide_downscale_factors.append(full_H // entry_H)
209+
window.guide_downscale_factors = guide_downscale_factors
201210
if guide_frame_count > 0:
202211
idx = tuple([slice(None)] * dim + [suffix_idx])
203212
sliced_guide = guide_frames[idx]

0 commit comments

Comments
 (0)