Update app.py
Browse files937 unmodified lines938939940941942943944137 unmodified lines1082108310841085108610871088937 unmodified lineschunk_duration = float(chunk_stop) - float(chunk_start)if chunk_duration <= 0:raise gr.Error("Chunk stop must be after chunk start.")num_frames = snap_frames(chunk_duration)skip_recondition = advance and stage_state is not None and not reconditionif skip_recondition:137 unmodified lines# The momentum-imposed opening is a *regeneration* of the previous chunk's own tail, not new content —# trimmed here so concatenation doesn't duplicate it. Only continuation chunks that actually had momentum# applied carry anything to trim; chunk one, and any chunk that fell back to a plain keyframe carry, don't.chunk_output = _trim_head(path, float(momentum)) if (chunk_advance and given_video is not None) else pathchunk_paths = prior_paths + [chunk_output]path = _concat_chunks(chunk_paths) if len(chunk_paths) > 1 else chunk_outputnew_chunk_state = {"paths": chunk_paths}937 unmodified lines938939940941942943944945946947948949950951137 unmodified lines1089109010911092109310941095937 unmodified lineschunk_duration = float(chunk_stop) - float(chunk_start)if chunk_duration <= 0:raise gr.Error("Chunk stop must be after chunk start.")# A momentum-carrying chunk regenerates its own opening `momentum_seconds` from the previous chunk's# tail, which `_trim_head` removes again before appending — so the chunk's own generation has to run# `momentum_seconds` longer than requested, or trimming that regenerated span back off leaves less new# content than the chunk stop/start actually asked for. `snap_frames(momentum)/FPS`, not the raw slider# value, since that's the real, frame-aligned duration `_trailing_frames` actually extracted and# `MiniMaxH3MomentumConditionStep` actually imposed.momentum_seconds = snap_frames(float(momentum)) / FPS if given_video is not None else 0.0num_frames = snap_frames(chunk_duration + momentum_seconds)skip_recondition = advance and stage_state is not None and not reconditionif skip_recondition:137 unmodified lines# The momentum-imposed opening is a *regeneration* of the previous chunk's own tail, not new content —# trimmed here so concatenation doesn't duplicate it. Only continuation chunks that actually had momentum# applied carry anything to trim; chunk one, and any chunk that fell back to a plain keyframe carry, don't.chunk_output = _trim_head(path, momentum_seconds) if (chunk_advance and given_video is not None) else pathchunk_paths = prior_paths + [chunk_output]path = _concat_chunks(chunk_paths) if len(chunk_paths) > 1 else chunk_outputnew_chunk_state = {"paths": chunk_paths}
app.py+9-2