Skip to content

Feat/seed fl frames and sequence tools - #3

Open
santoshray02 wants to merge 2 commits into
kodelyx:mainfrom
santoshray02:feat/seed-fl-frames-and-sequence-tools
Open

Feat/seed fl frames and sequence tools#3
santoshray02 wants to merge 2 commits into
kodelyx:mainfrom
santoshray02:feat/seed-fl-frames-and-sequence-tools

Conversation

@santoshray02

Copy link
Copy Markdown

Summary

Exposes three Flow API fields the wrapper already sent but discarded, and adds
FFmpeg-backed tooling for multi-shot continuity.

Generation parameters

  • seed — was hardcoded to random.randint(1, 9999) in every generator and
    unreachable from the HTTP API, CLI or MCP. Now plumbed through t2v, i2v, fl,
    r2v, v2v and t2i, accepting the full uint32 range. Batches offset from the base
    seed so a pinned value still yields distinct takes.
  • end_media_id / end_image_base64generate_video_fl and the
    batchAsyncGenerateVideoStartAndEndImage endpoint already existed, but no
    caller could reach them. An end frame alongside a start frame now routes to
    first-last mode.
  • video_model — overrides videoModelKey, previously hardcoded to
    abra_t2v_<duration>s.

New MCP tools (9 → 12)

  • generate_flow_sequence — generates an ordered shot list, carrying each clip's
    final frame into the next shot as its start image.
  • extract_video_frame — first / last / indexed frame to PNG.
  • concat_flow_videos — ordered concat with optional single narration track.

FFmpeg is required only by these three tools; they fail with a clear message when
it is absent rather than breaking imports.

Fixes

  • uuid was used but never imported in flow_mcp_server.py (latent NameError).
  • Restores .gitignore, removed in 61014b8. Without it git add -A sweeps in
    generated media, __pycache__, build/ and egg-info.

Testing

Verified against a live Flow session:

  • Seed reaches the payload exactly (777777, 777778, 777779 for count=3).
  • Seed is accepted by the server but does not produce determinism — identical
    prompt+seed pairs differ (image SSIM 0.36, video SSIM 0.77). Plumbing is
    correct; the backend does not honour it.
  • First-last mode verified end-to-end: SSIM 0.875 first frame vs source keyframe,
    0.791 last frame vs end keyframe.
  • Chained sequence seam continuity: SSIM 0.967.

Backward compatible — omitting the new fields preserves prior behaviour exactly.

Commit 61014b8 removed the gitignore, but the README still documents that
outputs, logs, build artifacts and local credentials are ignored. Without
it, `git add -A` sweeps in generated media (16 files / ~15 MB in output/),
__pycache__, build/ and egg-info, and a populated SERVER_API_KEY in a
local config.env would be one command away from being committed.
The Flow API already accepts these fields, but the wrapper discarded them.

Generation parameters:
- seed: was hardcoded to random.randint(1, 9999) in every generator and
  unreachable from the HTTP API, CLI or MCP. Now plumbed through t2v, i2v,
  fl, r2v, v2v and t2i, accepting the full uint32 range. Multi-item batches
  offset from the base seed so a pinned value still yields distinct takes.
  Omitting it preserves the previous random behaviour exactly.
- end_media_id / end_image_base64: generate_video_fl and the
  batchAsyncGenerateVideoStartAndEndImage endpoint already existed, but no
  caller could reach them. Supplying an end frame alongside a start frame
  now routes to first-last mode.
- video_model: overrides the videoModelKey, which was hardcoded to
  abra_t2v_<duration>s.

Measured: an explicit seed is accepted by the server (including values well
above the old 9999 cap) but does NOT make generation deterministic --
identical prompt+seed pairs differ (image SSIM 0.36, video SSIM 0.77). The
parameter is plumbed correctly; the backend simply does not honour it.
Shot-to-shot continuity therefore comes from pinned frames, not seeds.

New MCP tools (9 -> 12), all requiring FFmpeg and failing with a clear
message when it is absent:
- generate_flow_sequence: generates an ordered shot list, carrying each
  clip's final frame into the next shot as its start image. Measured seam
  continuity SSIM 0.967. Stops at the first failure and reports the index
  rather than burning credits on a derailed run.
- extract_video_frame: first / last / indexed frame to PNG.
- concat_flow_videos: ordered concat with optional single narration track,
  re-encoding so clips with differing SAR or timebase join cleanly.

Also fixes a latent NameError: uuid was used but never imported in
flow_mcp_server.py.
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