[PR #8300] [MERGED] feat(media): add H3 Max and Seedance 2.5 video support and optional WebP saves #8263

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8300
Author: @SpicyMarinara
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/sweep-media-support-20261025


📝 Commits (8)

  • c7919ad feat(media): expose H3 Max and Seedance 2.5 video models
  • 88987a6 feat: constrain video models and add opt-in WebP generation storage
  • 45c43d7 fix: clear model-specific resolution when changing video models
  • f12c547 refactor: keep video discovery on the curated model registry
  • 9870a59 fix: retain model-compatible defaults when resetting video settings
  • 960c57d fix: restrict 768p to video models that explicitly support it
  • bcd0b3b fix(media): preserve WebP selection and normalize game video references
  • 0f9304f fix(video): clarify converted Seedance reference upload requirements

📊 Changes

24 files changed (+954 additions, -35 deletions)

View changed files

➕ e2e/media-output-settings.e2e.ts (+173 -0)
📝 packages/client/src/components/connections/ConnectionEditor.tsx (+32 -9)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+33 -0)
📝 packages/client/src/lib/omnibar-settings-toggle-bindings.ts (+4 -0)
📝 packages/client/src/lib/settings-registry.ts (+21 -0)
📝 packages/client/src/localization/locales/en.json (+4 -0)
📝 packages/client/src/stores/ui.store.ts (+13 -0)
📝 packages/server/src/routes/app-settings.routes.ts (+2 -0)
📝 packages/server/src/routes/game.routes.ts (+6 -14)
📝 packages/server/src/routes/sprites.routes.ts (+4 -0)
📝 packages/server/src/services/avatars/generation/generation-context.ts (+1 -0)
➕ packages/server/src/services/image/generated-image-format.ts (+50 -0)
📝 packages/server/src/services/image/image-generation.ts (+6 -2)
📝 packages/server/src/services/image/tracker-portrait.ts (+1 -0)
📝 packages/server/src/services/storage/app-settings.storage.ts (+3 -0)
📝 packages/server/src/services/video/game-video-runtime.ts (+11 -2)
📝 packages/server/src/services/video/video-generation.ts (+32 -3)
📝 packages/shared/src/constants/model-lists.ts (+7 -1)
📝 packages/shared/src/constants/video-generation-defaults.ts (+37 -1)
📝 packages/shared/src/types/generation-integration.ts (+3 -1)

...and 4 more files

📄 Description

Linked issue

Closes #8297
Closes #8298
Closes #8239

Why this change

H3 Max and Seedance 2.5 cannot be selected through the existing OpenRouter video connection. Users also need a way to reduce the disk space used by generated illustrations while keeping PNG as the default.

What changed

  • Add MiniMax H3 Max (minimax/hailuo-3-max) and ByteDance Seedance 2.5 (bytedance/seedance-2.5) through the existing OpenRouter integration. Both appear in the existing curated model selector and Fetch Models response.
  • Keep each requested model within its published duration and resolution options, including H3 Max's 768p, in the connection editor, stored defaults and generated requests. Switching away from H3 Max clears its model-specific 768p setting; other existing model options are preserved.
  • Add Generations > Overall Generations > Save generated images as WebP, disabled by default, with quality from 1–100 (default 95). The preference applies to new PNG/JPEG generations; file bytes, extension and MIME type agree before gallery/storage consumers receive the result.
  • Preserve transparency and supported embedded metadata during conversion. Keep animated PNGs and existing WebP outputs unchanged. Sprite sheets and portrait intermediates retain their original provider pixels/format. Encoding failures retain the paid original image without retrying generation.
  • Reuse the existing PNG/JPEG video-reference conversion for Game scene and storyboard animations, so opt-in WebP saves remain usable as reference images without changing the saved image.
  • For legacy direct Seedance connections, explain that converted frames require the existing Upload Seedance reference frames temporarily opt-in, even with a public Marinara origin. Preserve existing PNG/JPEG public URLs and consented upload behavior. OpenRouter H3 Max/Seedance 2.5 continue to use inline reference bytes.
  • Clarify that WebP storage savings depend on the image and quality while honoring the selected format. Add deterministic image-storage/provider-routing regressions and desktop/mobile browser coverage for persisted settings and model constraints.

Validation

Local results:

  • pnpm check passed again on the final repair head 0f9304f16 (format/localization, workspace lint/types, E2E types and production builds).
  • Ten focused Node regressions passed, including save bytes/MIME/extension agreement, exact alpha-byte preservation, paid-result fallback safety, provider request limits and existing image/video paths. After hosted feedback, the generated-image-format and inline-chat-videos regressions passed again with explicit WebP selection for larger JPEG/tiny PNG inputs and actual Game route/provider-reference coverage for gallery/current illustrations; existing PNG/JPEG reference bytes and stored files remain unchanged.
  • pnpm smoke:ui: 7/7 passed with one worker.
  • Focused media UI: 12/12 passed on desktop Chromium, mobile Chromium and mobile WebKit in dark/light. After review fixes, the six model cases passed again with Reset and H3→Veo transition assertions.
  • Local CodeRabbit: full 22-file curated review completed; Reset and final guard follow-ups each completed with zero findings on their two-file deltas. The five-file compatibility/copy repair review and the final two-file Seedance upload-guidance follow-up each completed with zero findings. Final locally reviewed head: 0f9304f16. Earlier findings were fixed, removed or dispositioned as described below.
  • Final reference-flow regression: real Game routes preserve PNG/JPEG public URLs, make no upload or paid submission for converted frames with upload disabled, and succeed with the opted-in upload. Mocked first/last uploads preserve decoded pixels and reach the direct Seedance request as HTTPS URLs. Nine PNG/JPEG/converted-reference requests confirm OpenRouter/xAI/Veo inline bytes and MIME types agree. Existing generated-image-format, capability-gallery-animation and ToAPIs media regressions also passed again. All provider HTTP, DNS and uploads are fixtures.
  • Local Docker daemon was unavailable (missing OrbStack socket); container build/runtime remains a separate hosted gate and maintainer verification item.

The local CodeRabbit review found stale model-specific defaults and proposed expanding discovery to dynamic video capabilities. The stale-default defect and Reset path are fixed, and 768p is offered only for a model whose verified limits support it. The new live-catalogue fetch was removed, eliminating its transport/deadline concerns and unknown-model capability exposure. A duplicate suggestion to preserve 768p on unspecified/NanoGPT models was rejected: before this change, readResolution normalized that value to 720p and NanoGPT controls offered 480p/720p/1080p. Supporting additional NanoGPT resolutions is outside these issues.

The hosted review suggested retaining PNG/JPEG whenever a WebP is larger. That fallback was not adopted because the requested toggle explicitly selects .webp. Real Sharp fixtures confirmed that larger outputs can occur; the help text now accurately describes size-dependent savings, and retained regressions prove codec/MIME/extension agreement even for those inputs. The encoder remains unchanged.

A separate compatibility trace reproduced a genuine Game scene-video failure: the same PNG preview succeeded while its WebP counterpart returned 400 before generation. The repair reuses the existing video-reference helper across all three Game callers, with actual route regressions proving PNG conversion for WebP references and unchanged saved images.

  • 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
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify legacy direct Seedance clips with converted reference images and the existing temporary reference-upload option enabled. A public Marinara origin alone cannot serve the converted PNG; OpenRouter H3 Max/Seedance 2.5 use inline references.
  • Manually verify paid H3 Max/Seedance 2.5 generation and playback with real provider credentials.
  • Manually verify WebP gallery display and provider-specific embedded metadata round trips using real generated assets. Synthetic alpha-byte preservation is covered locally; NovelAI invisible-metadata compatibility is not claimed.
  • Manually verify settings and controls on a physical mobile device. Local browser proof uses desktop Chromium, mobile Chromium and mobile WebKit emulation.

Docs and release impact

No user-facing documentation, version or changelog changes. Existing gallery files are unchanged.

  • No docs changes needed
  • Updated docs as needed
  • Translated docs updated or follow-up issue opened
  • Version/release files updated

UI evidence

Desktop/mobile, dark/light browser screenshots are attached in the PR comments; no proof images are committed.


🔄 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/8300 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/sweep-media-support-20261025` --- ### 📝 Commits (8) - [`c7919ad`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c7919ad8a2394584843a56fa6b6701c4a6afeca3) feat(media): expose H3 Max and Seedance 2.5 video models - [`88987a6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/88987a6a0f83d384a865cd929cde26ce5b072e78) feat: constrain video models and add opt-in WebP generation storage - [`45c43d7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/45c43d7c0754573199d5dea3f3f33e0d653fcc3d) fix: clear model-specific resolution when changing video models - [`f12c547`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f12c5479c256756643f81aaf485800fea1601aa6) refactor: keep video discovery on the curated model registry - [`9870a59`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9870a5943ecbfa2d6787b5224bb4e91fc04ad8e1) fix: retain model-compatible defaults when resetting video settings - [`960c57d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/960c57d19f583a41b3c2ff6172b43b177d0f4f0a) fix: restrict 768p to video models that explicitly support it - [`bcd0b3b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bcd0b3bfa23e6a4f2561d2a649efea639a7b34d9) fix(media): preserve WebP selection and normalize game video references - [`0f9304f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0f9304f169dfe1b6056609cceb9bf18f9b30f7a6) fix(video): clarify converted Seedance reference upload requirements ### 📊 Changes **24 files changed** (+954 additions, -35 deletions) <details> <summary>View changed files</summary> ➕ `e2e/media-output-settings.e2e.ts` (+173 -0) 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+32 -9) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+33 -0) 📝 `packages/client/src/lib/omnibar-settings-toggle-bindings.ts` (+4 -0) 📝 `packages/client/src/lib/settings-registry.ts` (+21 -0) 📝 `packages/client/src/localization/locales/en.json` (+4 -0) 📝 `packages/client/src/stores/ui.store.ts` (+13 -0) 📝 `packages/server/src/routes/app-settings.routes.ts` (+2 -0) 📝 `packages/server/src/routes/game.routes.ts` (+6 -14) 📝 `packages/server/src/routes/sprites.routes.ts` (+4 -0) 📝 `packages/server/src/services/avatars/generation/generation-context.ts` (+1 -0) ➕ `packages/server/src/services/image/generated-image-format.ts` (+50 -0) 📝 `packages/server/src/services/image/image-generation.ts` (+6 -2) 📝 `packages/server/src/services/image/tracker-portrait.ts` (+1 -0) 📝 `packages/server/src/services/storage/app-settings.storage.ts` (+3 -0) 📝 `packages/server/src/services/video/game-video-runtime.ts` (+11 -2) 📝 `packages/server/src/services/video/video-generation.ts` (+32 -3) 📝 `packages/shared/src/constants/model-lists.ts` (+7 -1) 📝 `packages/shared/src/constants/video-generation-defaults.ts` (+37 -1) 📝 `packages/shared/src/types/generation-integration.ts` (+3 -1) _...and 4 more files_ </details> ### 📄 Description ## Linked issue Closes #8297 Closes #8298 Closes #8239 ## Why this change H3 Max and Seedance 2.5 cannot be selected through the existing OpenRouter video connection. Users also need a way to reduce the disk space used by generated illustrations while keeping PNG as the default. ## What changed - Add MiniMax H3 Max (`minimax/hailuo-3-max`) and ByteDance Seedance 2.5 (`bytedance/seedance-2.5`) through the existing OpenRouter integration. Both appear in the existing curated model selector and Fetch Models response. - Keep each requested model within its published duration and resolution options, including H3 Max's 768p, in the connection editor, stored defaults and generated requests. Switching away from H3 Max clears its model-specific 768p setting; other existing model options are preserved. - Add **Generations > Overall Generations > Save generated images as WebP**, disabled by default, with quality from 1–100 (default 95). The preference applies to new PNG/JPEG generations; file bytes, extension and MIME type agree before gallery/storage consumers receive the result. - Preserve transparency and supported embedded metadata during conversion. Keep animated PNGs and existing WebP outputs unchanged. Sprite sheets and portrait intermediates retain their original provider pixels/format. Encoding failures retain the paid original image without retrying generation. - Reuse the existing PNG/JPEG video-reference conversion for Game scene and storyboard animations, so opt-in WebP saves remain usable as reference images without changing the saved image. - For legacy direct Seedance connections, explain that converted frames require the existing **Upload Seedance reference frames temporarily** opt-in, even with a public Marinara origin. Preserve existing PNG/JPEG public URLs and consented upload behavior. OpenRouter H3 Max/Seedance 2.5 continue to use inline reference bytes. - Clarify that WebP storage savings depend on the image and quality while honoring the selected format. Add deterministic image-storage/provider-routing regressions and desktop/mobile browser coverage for persisted settings and model constraints. ## Validation Local results: - `pnpm check` passed again on the final repair head `0f9304f16` (format/localization, workspace lint/types, E2E types and production builds). - Ten focused Node regressions passed, including save bytes/MIME/extension agreement, exact alpha-byte preservation, paid-result fallback safety, provider request limits and existing image/video paths. After hosted feedback, the generated-image-format and inline-chat-videos regressions passed again with explicit WebP selection for larger JPEG/tiny PNG inputs and actual Game route/provider-reference coverage for gallery/current illustrations; existing PNG/JPEG reference bytes and stored files remain unchanged. - `pnpm smoke:ui`: 7/7 passed with one worker. - Focused media UI: 12/12 passed on desktop Chromium, mobile Chromium and mobile WebKit in dark/light. After review fixes, the six model cases passed again with Reset and H3→Veo transition assertions. - Local CodeRabbit: full 22-file curated review completed; Reset and final guard follow-ups each completed with zero findings on their two-file deltas. The five-file compatibility/copy repair review and the final two-file Seedance upload-guidance follow-up each completed with zero findings. Final locally reviewed head: `0f9304f16`. Earlier findings were fixed, removed or dispositioned as described below. - Final reference-flow regression: real Game routes preserve PNG/JPEG public URLs, make no upload or paid submission for converted frames with upload disabled, and succeed with the opted-in upload. Mocked first/last uploads preserve decoded pixels and reach the direct Seedance request as HTTPS URLs. Nine PNG/JPEG/converted-reference requests confirm OpenRouter/xAI/Veo inline bytes and MIME types agree. Existing generated-image-format, capability-gallery-animation and ToAPIs media regressions also passed again. All provider HTTP, DNS and uploads are fixtures. - Local Docker daemon was unavailable (missing OrbStack socket); container build/runtime remains a separate hosted gate and maintainer verification item. The local CodeRabbit review found stale model-specific defaults and proposed expanding discovery to dynamic video capabilities. The stale-default defect and Reset path are fixed, and 768p is offered only for a model whose verified limits support it. The new live-catalogue fetch was removed, eliminating its transport/deadline concerns and unknown-model capability exposure. A duplicate suggestion to preserve 768p on unspecified/NanoGPT models was rejected: before this change, readResolution normalized that value to 720p and NanoGPT controls offered 480p/720p/1080p. Supporting additional NanoGPT resolutions is outside these issues. The hosted review suggested retaining PNG/JPEG whenever a WebP is larger. That fallback was not adopted because [the requested toggle explicitly selects `.webp`](https://github.com/Pasta-Devs/Marinara-Engine/issues/8239#issuecomment-6395475223). Real Sharp fixtures confirmed that larger outputs can occur; the help text now accurately describes size-dependent savings, and retained regressions prove codec/MIME/extension agreement even for those inputs. The encoder remains unchanged. A separate compatibility trace reproduced a genuine Game scene-video failure: the same PNG preview succeeded while its WebP counterpart returned 400 before generation. The repair reuses the existing video-reference helper across all three Game callers, with actual route regressions proving PNG conversion for WebP references and unchanged saved images. - [ ] `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 - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify legacy direct Seedance clips with converted reference images and the existing temporary reference-upload option enabled. A public Marinara origin alone cannot serve the converted PNG; OpenRouter H3 Max/Seedance 2.5 use inline references. - Manually verify paid H3 Max/Seedance 2.5 generation and playback with real provider credentials. - Manually verify WebP gallery display and provider-specific embedded metadata round trips using real generated assets. Synthetic alpha-byte preservation is covered locally; NovelAI invisible-metadata compatibility is not claimed. - Manually verify settings and controls on a physical mobile device. Local browser proof uses desktop Chromium, mobile Chromium and mobile WebKit emulation. ## Docs and release impact No user-facing documentation, version or changelog changes. Existing gallery files are unchanged. - [ ] No docs changes needed - [ ] Updated docs as needed - [ ] Translated docs updated or follow-up issue opened - [ ] Version/release files updated ## UI evidence Desktop/mobile, dark/light browser screenshots are attached in the PR comments; no proof images are committed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 04:04:11 +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#8263
No description provided.