• Stefy Lanza (nextime / spora )'s avatar
    longcat: i2v, continuation, long video — against the real pipeline API (v0.2.33) · 457414da
    Stefy Lanza (nextime / spora ) authored
    Step 4. It also CORRECTS step 2, whose generate() was written against an assumed
    interface. The real one, read from upstream's demo scripts, differs in four ways that all
    mattered:
    
    - there is no single callable: generate_t2v(height, width, …), generate_i2v(image,
      resolution, …), generate_vc(video, num_cond_frames, use_kv_cache, offload_kv_cache, …)
      and generate_refine(stage1_video, spatial_refine_only, …) are separate methods, and
      t2v takes height/width where i2v and vc take a resolution NAME;
    - each returns [0]-indexed frames normalised to [0,1], not an object with .frames —
      upstream converts with (tensor * 255).clamp(0,255).to(uint8);
    - the distilled stage is a use_distill=True FLAG on the same method, not a LoRA to fuse
      by hand, so _apply_stage_lora is gone;
    - the 50-step passes take a negative_prompt and the distilled one does not (its guidance
      is 1.0, so it would do nothing).
    
    On top of that:
    - The segment loop is upstream's: a call emits num_frames but its first num_cond_frames
      re-render the previous tail, so only the remainder is new and the fresh frames become
      the next call's conditioning. torch_gc() between segments, as upstream does.
    - Modes map onto the tasks: t2v, i2v/ti2v -> i2v, extend/vc/v2v -> vc. Continuation
      reuses the EXISTING cond_frames field, so a client that already chains clips through
      the VACE path needs no new vocabulary — and gets native pretrained continuation
      instead, which is what stops the colour drift chained conditioning suffers.
    - Long video: num_segments or duration_seconds, and the SERVER owns the loop. The
      response carries the tail a caller needs to continue by hand if it prefers to.
    - The segment boundary is now a real handover point. POST /yield asks a generation to
      stop at the next boundary; the releaser calls it before waiting, so an eviction
      arriving mid-request costs one segment instead of the whole generation, and the request
      still returns — shorter, with a warning that reaches the caller — rather than failing.
    
    Unsupported modes (the audio-driven avatar tasks) are still refused with a 400 rather
    than downgraded to t2v, which would read as a quality bug rather than a gap.
    
    23 new tests pinning the upstream call contract so it cannot drift back, plus the segment
    arithmetic and the yield behaviour. Still no real generation: that needs the venv, the
    repo checkout and the ~83 GB checkpoint.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_0182DhR1eFNPQyGmDrpHbedY
    457414da
test_longcat_tasks.py 10 KB