io.Boolean.Input("closed_loop",default=False,tooltip="Whether to close the context window loop; only applicable to looped schedules."),
io.Combo.Input("fuse_method",options=comfy.context_windows.ContextFuseMethods.LIST_STATIC,default=comfy.context_windows.ContextFuseMethods.PYRAMID,tooltip="The method to use to fuse the context windows."),
io.Int.Input("dim",min=0,max=5,default=0,tooltip="The dimension to apply the context windows to."),
io.String.Input("cond_retain_index_list",default="",tooltip="List of latent indices to retain in the conditioning tensors for each window. For concat-style I2V models (e.g. Wan I2V, HunyuanVideo I2V, Cosmos I2V, SVD) the encoded start image lives in the c_concat conditioning channels; setting this to '0' will retain that start image content at sub-pos 0 of every window."),
io.Boolean.Input("split_conds_to_windows",default=False,tooltip="Whether to split multiple conditionings (created by ConditionCombine) to each window based on region index."),
io.String.Input("latent_retain_index_list",default="",tooltip="List of latent indices to retain in the noise latent itself for each window. Use for workflows where reference content (e.g. a start image) lives directly in the noise latent rather than in separate conditioning channels (e.g. inplace-style I2V like LTXV, AnimateDiff). Independent of cond_retain_index_list."),
io.Int.Input("context_length",min=1,max=nodes.MAX_RESOLUTION,step=4,default=81,tooltip="The length of the context window in real frames. Must be 4*n + 1."),
io.Int.Input("context_overlap",min=0,default=30,tooltip="The overlap of the context window in real frames."),
io.Combo.Input("fuse_method",options=comfy.context_windows.ContextFuseMethods.LIST_STATIC,default=comfy.context_windows.ContextFuseMethods.PYRAMID,tooltip="The method to use to fuse the context windows."),
io.Boolean.Input("freenoise",default=True,tooltip="Whether to apply FreeNoise noise shuffling, improves window blending.",advanced=True),
io.Boolean.Input("retain_first_frame",default=False,tooltip="Retain the first I2V frame in every context window (may help retain initial reference)."),
io.Boolean.Input("split_conds_to_windows",default=False,tooltip="Whether to split multiple conditionings (created by ConditionCombine) to each window based on region index.",advanced=True),
schema.description="Set context windows for LTXV-like models."
schema.inputs=[
io.Model.Input("model",tooltip="The model to apply context windows to during sampling."),
io.Int.Input("context_length",min=1,max=nodes.MAX_RESOLUTION,step=8,default=145,tooltip="The length of the context window in real frames. Must be 8*n + 1."),
io.Int.Input("context_overlap",min=0,step=8,default=40,tooltip="The overlap of the context window in real frames."),
],default=comfy.context_windows.ContextSchedules.UNIFORM_STANDARD,tooltip="Step-dependent scheduling algorithm for context windows."),
io.Int.Input("context_stride",min=1,default=1,tooltip="The stride of the context window; only applicable to uniform schedules.",advanced=True),
io.Boolean.Input("closed_loop",default=False,tooltip="Whether to close the context window loop; only applicable to looped schedules.",advanced=True),
io.Combo.Input("fuse_method",options=comfy.context_windows.ContextFuseMethods.LIST_STATIC,default=comfy.context_windows.ContextFuseMethods.PYRAMID,tooltip="The method to use to fuse the context windows."),
io.Boolean.Input("freenoise",default=True,tooltip="Whether to apply FreeNoise noise shuffling, improves window blending.",advanced=True),
io.Boolean.Input("retain_first_frame",default=False,tooltip="Retain the first latent frame in every context window (may help retain initial reference)."),
io.Boolean.Input("split_conds_to_windows",default=False,tooltip="Whether to split multiple conditionings (created by ConditionCombine) to each window based on region index.",advanced=True),