[PR #4840] [MERGED] Ground Storyboard animation plans in generated illustrations #6514

Closed
opened 2026-10-23 04:11:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4840
Author: @thetopham
Created: 8/10/2026
Status: ✅ Merged
Merged: 8/10/2026
Merged by: @thetopham

Base: staging ← Head: agent/4839-illustration-aware-animation


📝 Commits (8)

  • 323b5b1 Ground storyboard animation in generated frames
  • dc36705 Harden storyboard image log redaction
  • 7ea84d5 Respect storyboard planner generation settings
  • 0507b11 Reject truncated storyboard refinements
  • ec386d8 Honor storyboard animation presets during refinement
  • dcf934d Move storyboard shot planning into agent prompts
  • 1887559 Guide Storyboard prompt workflow
  • 430979a Strengthen Storyboard prompt scope regression

📊 Changes

13 files changed (+739 additions, -67 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 e2e/core-flows.e2e.ts (+31 -0)
📝 packages/client/src/components/agents/AgentEditor.tsx (+3 -0)
📝 packages/client/src/components/agents/StoryboardAgentSettingsPanel.tsx (+152 -23)
📝 packages/client/src/localization/locales/en.json (+21 -2)
📝 packages/server/src/db/schema/game-storyboards.ts (+1 -0)
📝 packages/server/src/routes/game.routes.ts (+163 -38)
📝 packages/server/src/services/game/storyboard-agent-settings.ts (+16 -0)
📝 packages/server/src/services/storage/game-storyboards.storage.ts (+2 -0)
➕ packages/server/src/services/video/storyboard-animation-refinement.ts (+164 -0)
📝 packages/shared/src/features/agents/storyboard-agent-settings.ts (+12 -0)
📝 packages/shared/src/types/game.ts (+3 -0)
📝 scripts/regressions/prompt.regression.ts (+170 -4)

📄 Description

Linked issue

Closes #4839

Paired Storyboard Agent package: Pasta-Devs/Marinara-Agents#297.

Why this change

Storyboard animation planning was based on an intended keyframe before image generation. When the generated illustration changed the pose, crop, visible subjects, or composition, the video prompt could contradict its actual first frame. The final shot-planning prompt also needs to remain editable with the rest of the downloadable Storyboard Agent.

What changed

  • Added one post-image multimodal shot-planning call shared by Game and Roleplay Storyboards. It receives the exact saved illustration before the video formatter runs, and that same illustration remains the video provider's first-frame reference.
  • Added an enabled-by-default Image-aware shot planning toggle and selectable/editable shot-planner prompt collection to the Storyboard Agent menu. Disabling it skips the additional vision call and uses the original motion intent.
  • Added a compact four-stage guide directly on the Storyboard Agent page and reordered its shared prompt editors into the real illustration, image-aware grounding, and video sequence.
  • Kept prompt bodies in the downloadable Storyboard Agent. Engine owns only template selection, variable rendering, multimodal delivery, validation, persistence, provider routing, and compatibility fallback.
  • Persisted the planner's suitable, simplify, subtle, or regenerate classification. regenerate is advisory and never spends another image generation automatically.
  • Rejects invalid/truncated JSON and changed or malformed | timing-segment structure, then safely falls back to the original planned motion.
  • Added execution-level regression coverage proving the refined motion reaches the formatter and video provider with the same generated image, plus failure and toggle-off fallback coverage.
  • Redacted attached image bytes from debug logs and added the user-facing Unreleased changelog entry.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated checks completed on 430979a84f42f1f8d1c689422f36bcd51ebc4a93:

  • pnpm regression:prompt
  • pnpm localization:check
  • pnpm lint
  • pnpm build
  • pnpm exec playwright test -c playwright.config.ts e2e/core-flows.e2e.ts --project=desktop-chromium --grep 'Storyboard Agent settings stay organized and contained at phone widths' (1 passed; verifies the four guide steps, editor stage order, toggle, and 320/360/390 px layouts)
  • Focused live Playwright proof against the exact preview (1 passed; clicked through the real Agents sidebar and verified the installed Storyboard 1.1.2 guide, stage order, selected recipe, and default-on toggle)
  • git diff --check

CodeRabbit's final actionable finding was accepted: the source regression now proves the production prompts are contained within the Shared scope, not merely positioned before Roleplay. The affected prompt regression and lint lanes pass after that follow-up.

pnpm check was attempted, but its first repository guard stopped at Impeccable context loader did not return valid JSON; the command did not reach localization, lint, or build. Those remaining lanes were run directly and passed as listed above.

GitHub pnpm-validate, container-build-test, branch policy, issue status, and PR template checks are green on the final head.

Manual verification notes

Automated browser verification is complete. Real image and video provider generation has not been performed because the isolated preview contains no configured provider credentials. Manually generate animated Game and Roleplay Storyboards with vision enabled and disabled, inspect the image-aware prompt log, and confirm the final video matches the generated first frame. Also verify a non-vision or failing prompt connection retains the still and uses the original motion intent.

Exact-head preview: http://100.93.53.36:7860 serves 2.4.2+430979a84f42 and /assets/index-yGPff6lz.js. It uses the existing data directory with all 32 packages preserved. Storyboard 1.1.2 from the paired Agents PR is active and ready; the normal marinara.service remains stopped.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] <paths> follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

The Unreleased changelog is updated. No user-facing files under docs/, translated documentation, or Engine version files are changed.

UI evidence (if applicable)

The exact paired Storyboard package was installed through the live Download Agents UI. The Storyboard Agent editor now starts with a short four-stage prompt guide, then presents the shared editors in stage 2 illustration, stage 3 image-aware grounding, and stage 4 video order. The selected recipe, default-on toggle, and full prompt text remain editable for both Game and Roleplay.

Summary by CodeRabbit

  • New Features
    • Added a guided, four-stage storyboard prompt editor with editable image, shot-planner, and video prompt settings.
    • Added optional image-aware shot planning and configurable animation refinement templates.
    • Storyboard keyframes now retain animation suitability classifications.
    • Video generation can refine motion using the rendered keyframe and automatically fall back to the planned motion when refinement is unavailable or invalid.
  • Documentation
    • Updated the unreleased changelog with storyboard planning and animation refinement details.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4840 **Author:** [@thetopham](https://github.com/thetopham) **Created:** 8/10/2026 **Status:** ✅ Merged **Merged:** 8/10/2026 **Merged by:** [@thetopham](https://github.com/thetopham) **Base:** `staging` ← **Head:** `agent/4839-illustration-aware-animation` --- ### 📝 Commits (8) - [`323b5b1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/323b5b1dc4378ebf65a2b77d65955e9a4700bf67) Ground storyboard animation in generated frames - [`dc36705`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dc367052bdbbc3384967bdde47c48b3487347005) Harden storyboard image log redaction - [`7ea84d5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7ea84d5108e2f4a8eaa9fedd8f95ceab72e6c6da) Respect storyboard planner generation settings - [`0507b11`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0507b114888d3851837a958d389150c3734c1d8a) Reject truncated storyboard refinements - [`ec386d8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ec386d83e70ff269d98074b009bb00fc0cb318ca) Honor storyboard animation presets during refinement - [`dcf934d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dcf934df6647a530ad0b3944325e36675aae8eed) Move storyboard shot planning into agent prompts - [`1887559`](https://github.com/Pasta-Devs/Marinara-Engine/commit/18875596c104172c31b93da394afdb626e39fde2) Guide Storyboard prompt workflow - [`430979a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/430979a84f42f1f8d1c689422f36bcd51ebc4a93) Strengthen Storyboard prompt scope regression ### 📊 Changes **13 files changed** (+739 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `e2e/core-flows.e2e.ts` (+31 -0) 📝 `packages/client/src/components/agents/AgentEditor.tsx` (+3 -0) 📝 `packages/client/src/components/agents/StoryboardAgentSettingsPanel.tsx` (+152 -23) 📝 `packages/client/src/localization/locales/en.json` (+21 -2) 📝 `packages/server/src/db/schema/game-storyboards.ts` (+1 -0) 📝 `packages/server/src/routes/game.routes.ts` (+163 -38) 📝 `packages/server/src/services/game/storyboard-agent-settings.ts` (+16 -0) 📝 `packages/server/src/services/storage/game-storyboards.storage.ts` (+2 -0) ➕ `packages/server/src/services/video/storyboard-animation-refinement.ts` (+164 -0) 📝 `packages/shared/src/features/agents/storyboard-agent-settings.ts` (+12 -0) 📝 `packages/shared/src/types/game.ts` (+3 -0) 📝 `scripts/regressions/prompt.regression.ts` (+170 -4) </details> ### 📄 Description ## Linked issue Closes #4839 Paired Storyboard Agent package: Pasta-Devs/Marinara-Agents#297. ## Why this change Storyboard animation planning was based on an intended keyframe before image generation. When the generated illustration changed the pose, crop, visible subjects, or composition, the video prompt could contradict its actual first frame. The final shot-planning prompt also needs to remain editable with the rest of the downloadable Storyboard Agent. ## What changed - Added one post-image multimodal shot-planning call shared by Game and Roleplay Storyboards. It receives the exact saved illustration before the video formatter runs, and that same illustration remains the video provider's first-frame reference. - Added an enabled-by-default `Image-aware shot planning` toggle and selectable/editable shot-planner prompt collection to the Storyboard Agent menu. Disabling it skips the additional vision call and uses the original motion intent. - Added a compact four-stage guide directly on the Storyboard Agent page and reordered its shared prompt editors into the real illustration, image-aware grounding, and video sequence. - Kept prompt bodies in the downloadable Storyboard Agent. Engine owns only template selection, variable rendering, multimodal delivery, validation, persistence, provider routing, and compatibility fallback. - Persisted the planner's `suitable`, `simplify`, `subtle`, or `regenerate` classification. `regenerate` is advisory and never spends another image generation automatically. - Rejects invalid/truncated JSON and changed or malformed `|` timing-segment structure, then safely falls back to the original planned motion. - Added execution-level regression coverage proving the refined motion reaches the formatter and video provider with the same generated image, plus failure and toggle-off fallback coverage. - Redacted attached image bytes from debug logs and added the user-facing Unreleased changelog entry. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Automated checks completed on `430979a84f42f1f8d1c689422f36bcd51ebc4a93`: - `pnpm regression:prompt` - `pnpm localization:check` - `pnpm lint` - `pnpm build` - `pnpm exec playwright test -c playwright.config.ts e2e/core-flows.e2e.ts --project=desktop-chromium --grep 'Storyboard Agent settings stay organized and contained at phone widths'` (1 passed; verifies the four guide steps, editor stage order, toggle, and 320/360/390 px layouts) - Focused live Playwright proof against the exact preview (1 passed; clicked through the real Agents sidebar and verified the installed Storyboard 1.1.2 guide, stage order, selected recipe, and default-on toggle) - `git diff --check` CodeRabbit's final actionable finding was accepted: the source regression now proves the production prompts are contained within the Shared scope, not merely positioned before Roleplay. The affected prompt regression and lint lanes pass after that follow-up. `pnpm check` was attempted, but its first repository guard stopped at `Impeccable context loader did not return valid JSON`; the command did not reach localization, lint, or build. Those remaining lanes were run directly and passed as listed above. GitHub `pnpm-validate`, `container-build-test`, branch policy, issue status, and PR template checks are green on the final head. ### Manual verification notes Automated browser verification is complete. Real image and video provider generation has not been performed because the isolated preview contains no configured provider credentials. Manually generate animated Game and Roleplay Storyboards with vision enabled and disabled, inspect the image-aware prompt log, and confirm the final video matches the generated first frame. Also verify a non-vision or failing prompt connection retains the still and uses the original motion intent. Exact-head preview: `http://100.93.53.36:7860` serves `2.4.2+430979a84f42` and `/assets/index-yGPff6lz.js`. It uses the existing data directory with all 32 packages preserved. Storyboard 1.1.2 from the paired Agents PR is `active` and `ready`; the normal `marinara.service` remains stopped. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n] <paths>` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) The Unreleased changelog is updated. No user-facing files under `docs/`, translated documentation, or Engine version files are changed. ## UI evidence (if applicable) The exact paired Storyboard package was installed through the live Download Agents UI. The Storyboard Agent editor now starts with a short four-stage prompt guide, then presents the shared editors in stage 2 illustration, stage 3 image-aware grounding, and stage 4 video order. The selected recipe, default-on toggle, and full prompt text remain editable for both Game and Roleplay. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a guided, four-stage storyboard prompt editor with editable image, shot-planner, and video prompt settings. * Added optional image-aware shot planning and configurable animation refinement templates. * Storyboard keyframes now retain animation suitability classifications. * Video generation can refine motion using the rendered keyframe and automatically fall back to the planned motion when refinement is unavailable or invalid. * **Documentation** * Updated the unreleased changelog with storyboard planning and animation refinement details. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:11:08 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6514
No description provided.