Archived
video: endpoint keyframe completion (I2VA / L2VA / FL2VA)
One keyframe path serves three DaSiWa modes: first_frame pins output frame 0,
last_frame pins the last frame, and the gap is diffused. A keyframe is pure
attention conditioning -- its VAE latent rides as a pinned (update=0) cond row
at its frame's time position, faithful to comfy/ldm/minimax/model.py where
keyframe latents are img_update==False rows. The sampler is untouched; the step
merely widens to carry the extra cond rows.
- server (videos.cpp/iface.h/adapters.h): first_frame/last_frame form parts ->
VideoRefMedia::FIRST_FRAME/LAST_FRAME; kf_task validation (i2va/fl2va need
first, l2va/fl2va need last); keyframes are mutually exclusive with refs;
encoder_image_canvas(cover=LAST) sizes the anchor.
- driver (video_driver.cpp): keyframe pass issues a RAD_ENC_IMAGE Vencode per
anchor (slot = ++ref_tab[1], ordered), appends ref_tab key triples
{frame(0|frames-1), video_t=1, audio_t=0}.
- arch (minimaxh3.cpp): ref_parts emits keyframe cond parts FIRST; the step
scatter admits kR2VCond/kR2VCondAudio rows.
- tests: video_gen_test keyframe-completes-widens-the-step-and-pins-the-ends
(2x Vencode at slot 1,2; widened step; seg_cu/lat_cu/ref_tab pinned); fake_pack_ref
lays keyframe rows (nk=0 byte-identical to before); videos_test keyframe API.
Device-verified (TP2, seed 9999): FL2VA completes a valid 73-frame MP4+AAC; pins
are consumed (fl2va != same-seed t2va) and force the endpoints (frame0 vs anchor
0.687 pinned vs 0.460 un-pinned; last 0.719 vs 0.521). Fidelity follow-up (not
function): anchors ride as pins only; the reference also feeds them through the
TE as vision tokens, so a prompt that contradicts the anchor lets text win --
full endpoint parity vs a golden needs TE-anchor tokens (#10/P6 bucket).
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
8ddcbbf01f
commit
60e920cd4d
11 files changed
+410
-37
No files matched your search
@@ -327,6 +327,17 @@ public:
|
||||
int encoder_image(const uint8_t* bytes, size_t n, int32_t ratio, int32_t max_side, Frame* out,
|
||||
std::string* why) const;
|
||||
|
||||
/* A keyframe anchor in the video VAE's own form: decoded under the same `max_source_pixels`
|
||||
* guard, then resized to the EXACT output canvas (`w` x `h`), unlike `encoder_image`'s
|
||||
* aspect-kept snap. A keyframe's pinned rows must cover the target's latent grid exactly -- it
|
||||
* is frame_rows wide, not the anchor's own grid -- so the anchor cannot keep its aspect: the
|
||||
* reference stretches the first frame to the canvas ("disabled") and cover-crops the last
|
||||
* ("center"). `cover` picks between them: false stretches both axes to fill the canvas (may
|
||||
* distort); true instead scales up to COVER the canvas keeping aspect, then centre-crops
|
||||
* the excess. `w`/`h` are the request's target size, already a multiple of the VAE ratio. */
|
||||
int encoder_image_canvas(const uint8_t* bytes, size_t n, int32_t w, int32_t h, bool cover,
|
||||
Frame* out, std::string* why) const;
|
||||
|
||||
/* A moving picture in the video VAE's own form: decoded under the same `max_source_pixels`
|
||||
* guard, then every frame resized to the one grid `encoder_image` picks. The frames are
|
||||
* SAMPLED first: uniformly across the stream, to the largest count no more than `max_frames`
|
||||
|
||||
Reference in new issue
Block a user