Skip to content

Videos with sound start from a picture and can end on a second one - #316

Merged
iamwavecut merged 2 commits into
mainfrom
feat/video-reference-frames
Dec 3, 2026
Merged

iamwavecut merged 2 commits into
mainfrom
feat/video-reference-frames

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

A VIP video with sound can now start from a chat picture and end on a second one: one picture is the first frame, two are the first and the last frame. The farm side is aifarm-draw #53 (image_b64 and last_image_b64 on h3video_generate, release WaveCut/pi-H3-OrbitQuant-W4A8@4a4b503e).

Changes

Picking the pictures. make_video and make_movie take file_ids (as draw_image does). Without them the pictures of the current message, its media group and its quote are used. More than two pictures are refused with make_*_frames_invalid. The scheduler keeps the pictures only for a video with sound; FastFrames renders from text alone, so a GIF or a user without VIP gets the clip from the text. The job meta stores them as frames: [{file_id, file_unique_id}].

Rendering. The video worker downloads each picture at up to 1280 px (TelegramClientVisionDataUrlProvider) and describes it with the dialog's media describer. A picture that cannot be loaded or described drops the pictures and makes the video from text instead of failing. draw-api gets image_b64 and last_image_b64. A picture sets the frame unless the user asked for one: only an explicit orientation is sent; the optimizer's guess is not.

Prompt. The MiniMax-H3 optimizer gets Picture 1, the first frame: … and Picture 2, the last frame: … lines in the user message and a new "Pictures" section with an I2VA example, following MiniMax's VIDEO_PROMPT_WRITING_GUIDE_base_en.md (sections 2.1 and 3.1–3.3). One picture: the shot starts from <Picture 1> and first establishes what it shows. Two pictures: one continuous shot from Picture 1 to Picture 2. The optimizer does not write the alignment line; draw-api adds it. The dialog system prompt sends requests to animate a picture to make_movie, and /start help explains it.

Prompt contract

video/movie_optimizer.prompt keeps its role markers; its template data gains pictures (a list of lines), rendered only in the user message, so the system part stays the same for every request. aifarm/system.prompt gains one sentence.

Verification

  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test for dialog, media, taskman, llm, prompts and app: all pass.
  • New tests: pictures from the message, from file_ids in their order, and more than two refused; pictures kept only for a video with sound; first and last frame and the descriptions down to the draw-api body; a picture sets the frame; an unloadable picture leaves a video from text; silent clips ignore pictures; picture lines in the optimizer's user message.
  • Not yet checked live; production checks follow the deploy.

draw-api h3video_generate takes image_b64 and last_image_b64 (aifarm-draw #53). Both video tools take
file_ids; without them the pictures of the current message and its quote are used. One picture is the
first frame, two are the first and the last. Only a video with sound keeps them: FastFrames renders
from text alone.

The video worker downloads each picture at up to 1280 px and describes it with the vision model. The
MiniMax-H3 optimizer gets the descriptions as "Picture 1, the first frame: ..." lines and writes the
I2VA or FL2VA body that starts from <Picture 1> (draw-api adds the alignment line). A picture sets the
frame unless the user asked for one. A picture that cannot be loaded or described leaves a video from
text instead of a failure.
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Warnings
⚠️ Prompt files are cache-sensitive contracts; confirm prompt shape and role markers were preserved intentionally.
Messages
📖 Danger checked 13 changed file(s).

Generated by 🚫 dangerJS against 91622b4

@iamwavecut

Copy link
Copy Markdown
Owner Author

Danger warning: video/movie_optimizer.prompt keeps its {{role "system"}} / {{role "user"}} markers; the new pictures lines render only in the user message, so the system part stays identical across requests (covered by the_pictures_of_a_video_with_sound_follow_the_request_as_first_and_last_frame). aifarm/system.prompt gains one sentence about animating a picture with make_movie.

PR-Agent failed on HTTP 429 from the GLM Coding Plan endpoint before publishing anything (run 47156313723), as on #315.

Three pictures in a message or an album should not block the video, least of all a GIF that ignores
them; only file_ids that name more than two are refused.
@iamwavecut

Copy link
Copy Markdown
Owner Author

PR-Agent failed on HTTP 429 from the GLM Coding Plan endpoint on both heads (runs 47156313723 attempts 1–2 and the 91622b4 run) and published nothing. The owner approved merging without it. My own review of the diff found one issue, fixed in 91622b4: a third picture in a message or an album no longer refuses the video; only file_ids that name more than two are refused. Rust lint, workspace, dependencies, Semgrep and Danger are green on 91622b4.

@iamwavecut
iamwavecut merged commit 176bc0d into main Dec 3, 2026
10 of 12 checks passed
@iamwavecut
iamwavecut deleted the feat/video-reference-frames branch December 3, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant