Skip to content

Show the subjects of up to three pictures in a new scene - #319

Merged
iamwavecut merged 1 commit into
mainfrom
feat/video-picture-references
Dec 4, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
feat/video-picture-references

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Summary

A picture sent with a video request used to become the video's first frame. A square picture in a vertical video was therefore cropped (before aifarm-draw #55) or placed over blurred bands (after #55). MiniMax-H3 on the farm now accepts reference pictures (aifarm-draw #58, reference_b64, up to 3): it shows the pictured people, animals, objects or places whole, in a scene that the prompt describes.

Picture role

  • The scheduler picks the role from the user's message (asks_to_animate_picture). By default pictures become references. A request to animate or continue a picture keeps the current behaviour: first frame, plus last frame for two pictures. Trigger words: оживи…, оживля…, анимируй, анимировать, анімуй, продолжи, продолжить, продовжи…, превра…, animate, continue, morph, "first/last/start/end frame", "этот кадр", "to life", "turns into". "Анимированное видео", "продолжительность" and "оживлённая улица" do not trigger it.
  • make_video/make_movie now accept up to three pictures (file_ids or attachments). The job meta gets references next to frames, and only one of the two is ever set.

Pipeline

  • video_jobs loads up to three references. It drops a reference that fails to load or whose sides are more than 4:1 apart, because draw-api rejects those with 400. The remaining references go to draw-api as reference_b64 together with size: 480p and seconds: 10.
  • Orientation in reference mode works as for a text-only video: the request, or else the optimizer's inference. The shape of the pictures does not set it.

Prompt

  • New prompts/video/movie_reference_optimizer.prompt. It produces MiniMax-H3's six-section reference format (subject_definitions, summary with [reference generation], retention_analysis, detailed_description, overall_soundscape, non_diegetic_music), with one <Subject N> per pictured item and speech in <d>[Language] …</d>.

  • The format follows the MiniMax-H3 reference guide and aifarm-draw integrate_to_discovery.md. Picture descriptions come from the existing vision describer and are passed as Picture N: ….

  • Checked by hand on the farm's dialog Gemma, with real request text, picture descriptions and schema:

    Request Result
    Gopak, vertical portrait, 293 words, 548 tokens
    Grandmother feeds the cat landscape, 321 words, 535 tokens

    Both outputs have all six sections, keep the features to preserve, and put the speech in <d>[Russian]…</d>.

  • The make_movie description, the dialog system prompt and /help now describe both modes.

Checks

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • Tests passed for openplotva-taskman (70), openplotva-media (68), openplotva-dialog (115), openplotva-llm (236), openplotva-prompts (10), openplotva-app (1503) and openplotva-telegram (246).
  • New tests:
    • picture role routing and keyword cases;
    • three-picture selection;
    • references meta round trip;
    • reference prompt rendering and schema;
    • pipeline: references sent whole, the 4:1 limit, the cap of three references, a failed load dropping only that reference, orientation coming from the optimizer.

A picture sent with a video request used to become the first frame, so a
picture of another shape was cropped or framed by blurred bands. MiniMax-H3
on the farm now takes up to three reference pictures (aifarm-draw #58):
people, animals, objects or places it shows whole in a scene the prompt
describes.

Pictures become references unless the user asks to animate or continue a
picture (оживи, анимируй, first/last frame); then they stay the first and
last frame as before. References are sent as reference_b64, a picture
longer than 4:1 is left out, and the frame comes from the request, not
from the pictures. A separate optimizer prompt writes MiniMax-H3's
six-section reference format with one subject per pictured person, animal,
object or place.
@github-actions

github-actions Bot commented Dec 4, 2026

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

Generated by 🚫 dangerJS against bddcf86

@iamwavecut

Copy link
Copy Markdown
Owner Author

This is intentional. movie_optimizer.prompt and optimizer.prompt are unchanged. prompts/aifarm/system.prompt changes only in the one sentence about video pictures; its role markers and template tags are untouched. The new prompts/video/movie_reference_optimizer.prompt follows the same shape as movie_optimizer.prompt: a constant {{role "system"}} part, then a {{role "user"}} part that receives the same data (request, brief, frame, pictures). Only reference-mode requests use it, so the cached system prompt of other video requests stays the same.

@iamwavecut
iamwavecut merged commit 79048e2 into main Dec 4, 2026
10 of 12 checks passed
@iamwavecut
iamwavecut deleted the feat/video-picture-references branch December 4, 2026 00:10
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