[PR #6410] [MERGED] Fit Atlas Cloud video requests to each model and expose its options #7166

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6410
Author: @stonebystone
Created: 9/20/2026
Status: ✅ Merged
Merged: 9/20/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/atlas-schema-driven-video-params


📝 Commits (10+)

  • c9b41bf fix(video): fit Atlas Cloud video requests to each model's published schema
  • 0e1db6c fix(connections): load the live Atlas Cloud catalog in Fetch Models
  • d2a62c6 feat(connections): expose each Atlas Cloud video model's own options
  • 68e6bcc Merge remote-tracking branch 'origin/staging' into feat/atlas-schema-driven-video-params
  • 2eb6dd3 fix(connections): make the Atlas Cloud text-to-video warning readable in every theme
  • d3ca982 fix(connections): bound the Atlas Cloud schema cache and harden model lookups
  • a474374 fix(connections): address CodeRabbit review on Atlas Cloud model options
  • 7696d20 fix(atlas): validate model options and isolate schema changes
  • 2eb0c4d Merge branch 'staging' into feat/atlas-schema-driven-video-params
  • 35bd7ca docs: keep video provider list together

📊 Changes

20 files changed (+1610 additions, -11 deletions)

View changed files

📝 CHANGELOG.md (+3 -0)
📝 docs/media/image-providers.md (+1 -1)
📝 docs/media/scene-video.md (+32 -1)
➕ e2e/atlas-cloud-options.e2e.ts (+105 -0)
➕ packages/client/src/components/connections/AtlasCloudModelOptions.tsx (+365 -0)
📝 packages/client/src/components/connections/ConnectionEditor.tsx (+20 -0)
➕ packages/client/src/hooks/use-atlas-cloud-model-schema.ts (+28 -0)
📝 packages/client/src/localization/locales/en.json (+22 -1)
📝 packages/server/src/routes/connections.routes.ts (+63 -2)
📝 packages/server/src/routes/gallery.routes.ts (+2 -0)
📝 packages/server/src/routes/game.routes.ts (+3 -0)
📝 packages/server/src/routes/sprites.routes.ts (+4 -0)
📝 packages/server/src/services/generation/media-connection-fallback.ts (+8 -3)
➕ packages/server/src/services/media/atlas-cloud-video-schema.ts (+416 -0)
📝 packages/server/src/services/media/atlas-cloud.ts (+60 -0)
📝 packages/server/src/services/video/game-video-runtime.ts (+5 -0)
📝 packages/server/src/services/video/video-generation.ts (+21 -2)
📝 packages/shared/src/constants/video-generation-defaults.ts (+55 -1)
📝 packages/shared/src/types/video-generation-defaults.ts (+38 -0)
➕ scripts/regressions/atlas-cloud-video-schema.regression.ts (+359 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6408

Why this change

  • Atlas Cloud models do not share one input shape, but Marinara sent the same six fields (model, prompt, duration, aspect_ratio, resolution, image) to all of them. Checked against the published Input schema of all 110 Atlas Cloud text-to-video and image-to-video models, 44 received a body that violates their schema even when undeclared extra fields are ignored: missing image_url / size / ratio / images, duration: 8 on models that only allow 5 or 10, or a string prompt where a list is required.
  • Users could not set any model-specific input (negative_prompt, seed, generate_audio, shot_type, enable_prompt_expansion, LoRA lists), so provider defaults always applied. On alibaba/wan-2.6/image-to-video-flash, for example, that means an LLM rewrites the prompt, the clip may cut between shots, and audio is generated unasked.
  • Test Video never sent an image, so image-to-video models that require one failed the connection test even though Gallery use would work. A text-to-video model passed the test and then silently dropped the user's illustration.
  • Fetch Models never contacted Atlas Cloud. It returned four hardcoded video models (three for images) while the public catalog lists 177 video and 128 image generation models.

What changed

  • Request fitting (packages/server/src/services/media/atlas-cloud-video-schema.ts): read the selected model's published schema from https://static.atlascloud.ai/model/schema/<id with "/" as "-">.json (that URL convention held for all 200 video models in the catalog), cache it for 6 hours, and fit the connection defaults to it: image field name (image, image_url, images[], reference_images[]), size from resolution + aspect ratio, ratio vs aspect_ratio, duration snapped to the model's list or range, resolution snapped to the model's own spelling, list-typed prompts, and no undeclared fields. Falls back to the previous body when no schema can be read. Every fitted value is logged; a dropped source illustration is logged as a warning.
  • Test Video sends a generated gradient first frame when the Atlas Cloud model's schema requires an image (skipped when sharp is unavailable).
  • Fetch Models reads Atlas Cloud's public catalog (no key needed) for image and video connections, lists image-to-video ahead of text-to-video, shows each video model's starting price per second, and keeps the starter list as the fallback.
  • Model options in the connection editor: a new GET /api/connections/atlas-cloud/video-model-schema?model= endpoint and a Model options section under Video Defaults list every input the model declares beyond the common controls, with Atlas Cloud's description and default. Options stay unsent until changed, are stored per model under videoGeneration.atlas.modelOptions in the connection's default parameters, are threaded through every generateVideo call site and the video fallback connection, and are checked against the schema before each request (managed, unknown, or out-of-range values are left out and named in the log). The section also lists the clip lengths / resolutions / sizes / aspect ratios the model accepts and warns when a text-to-video model cannot use the gallery image.
  • Regression: scripts/regressions/atlas-cloud-video-schema.regression.ts. Docs: docs/media/scene-video.md, docs/media/image-providers.md. CHANGELOG.md entries under [Unreleased].

Storage note: modelOptions is a new optional key inside the existing videoGeneration.atlas JSON on a connection's default parameters. Existing connections normalize to {}; no storage-format change.

Network note: Atlas Cloud connections now make two unauthenticated GETs to Atlas Cloud hosts (static.atlascloud.ai for a model schema, <base URL>/models for the catalog). No API key is sent on either.

Other: commits 2eb6dd36b and d3ca982c9 are small follow-ups from the screenshot pass and a code read.

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

Manual verification notes

Run by the AI agent that prepared this PR (Windows 11, Node 25.9, worktree off staging at 674330b6c). These are not a substitute for the boxes above:

  • pnpm localization:check, pnpm format:check, pnpm lint, pnpm check:e2e-types, pnpm check:token-estimation-types, and pnpm build all exit 0. The only lint warning is the existing react-hooks/exhaustive-deps one in GameNarration.tsx.
  • pnpm check itself was not green on this machine: it stops at impeccable:check because .agents/skills is a git symlink and this Windows checkout has core.symlinks=false. Every later step was run individually as listed above.
  • atlas-cloud-video-schema.regression.ts and open-issues.regression.ts pass when run directly with tsx.
  • Offline sweep of the adapter over the live schemas of all 110 Atlas Cloud text-to-video / image-to-video models (defaults 8 s, 16:9, 720p, with a reference image), counting real violations only: 66 valid bodies before, 108 after. The two remaining are lip-sync models that require audio_url. Bodies for the curated Veo 3.1 models are unchanged.
  • Isolated instance (separate port and DATA_DIR), Chromium, dark mode, desktop width: Model options rendered for alibaba/wan-2.6/image-to-video-flash from the live schema; setting shot_type, enable_prompt_expansion, and seed then Save stored them per model; Test Video with debug logging showed the outgoing body carrying the generated first frame and those three options, with no aspect_ratio. Atlas Cloud answered 401 because the key was a placeholder.
  • Fetch Models logic was exercised by calling fetchAtlasCloudModels against the live catalog (177 video, 128 image), not by clicking the button.

Still needs a human:

- Manually verify a real generation with a valid Atlas Cloud key: Gallery Animate illustration and Test Video on an image-to-video model, with and without changed model options. tested locally.
- Manually verify a model that takes image_url accepts the base64 data URL Marinara sends (some schemas describe that field as a URL). tested locally.
- Manually verify Fetch Models in the connection editor for an Atlas Cloud video connection and an Atlas Cloud image connection. tested locally.

  • Manually verify the Model options section in light mode and at a mobile viewport, including a text-to-video model (warning shown), a model with a JSON/LoRA input, a mistyped model ID, and an invalid JSON value.
  • Manually verify Game Mode scene video, Storyboard animation, animated expressions, and call clips still generate through an Atlas Cloud connection.

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] follow-up issue opened (see CONTRIBUTING.md § Translated documentation) Follow-up: #6415
  • Version/release files updated (only if this PR includes a version bump)

docs/media/scene-video.md and docs/media/image-providers.md changed. A [docs-i18n] docs/media/scene-video.md, docs/media/image-providers.md follow-up issue still needs to be opened. New English UI keys live under connections.mediaSources.atlas.modelOptions.*; connections.mediaSources.atlas.videoDefaultsNote changed wording.

UI evidence (if applicable)

screenshots attached in comment below.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Atlas Cloud model lists now load the current catalog, including starting video prices, with fallback models when unavailable.
    • Video settings show model-specific options, descriptions, defaults, supported durations, resolutions, and image requirements.
    • Options are saved per model and can be reset to defaults.
  • Improvements

    • Video requests automatically adapt to each model’s supported inputs.
    • Unsupported settings are omitted, adjustments are reported, and incompatible source images are flagged.
  • Documentation

    • Updated Atlas Cloud setup and scene-video guidance.

Maintainer sweep adjustments and verification

Preserve the valid prototype model option, reject unsafe inherited schema keys, validate object-valued inputs, and hide stale controls during a model change. The focused schema regression fails on the prior head and passes after these adjustments. pnpm check and pnpm localization:check pass; local CodeRabbit review reports zero findings.

The real connection editor passed six browser cases: desktop Chromium, Android Chromium emulation and iPhone WebKit emulation in light and dark themes. Each case saves options, verifies numeric/string enum identity, switches between two models, and resets one model without deleting the other's saved settings. Screenshots and regression evidence.

  • Manually verify generation against a live Atlas Cloud account and real provider model schemas.
  • Manually verify the editor on physical mobile devices.

No paid provider requests or physical-device checks were performed. The existing staging drag regression is being fixed in #6420 before the final merge gates are rerun.


🔄 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/6410 **Author:** [@stonebystone](https://github.com/stonebystone) **Created:** 9/20/2026 **Status:** ✅ Merged **Merged:** 9/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/atlas-schema-driven-video-params` --- ### 📝 Commits (10+) - [`c9b41bf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c9b41bf8907c45783c21c00ed87458f7e5698cb5) fix(video): fit Atlas Cloud video requests to each model's published schema - [`0e1db6c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0e1db6cd8624a35628e9f85186ff2501ea6e0bfd) fix(connections): load the live Atlas Cloud catalog in Fetch Models - [`d2a62c6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d2a62c6cf87988881d89e30616f22af34ce67915) feat(connections): expose each Atlas Cloud video model's own options - [`68e6bcc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/68e6bcc1cb377d673e8cf39dfc3aa06983decba0) Merge remote-tracking branch 'origin/staging' into feat/atlas-schema-driven-video-params - [`2eb6dd3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2eb6dd36b4ea36a84ef0f4d450ddca3839acffc1) fix(connections): make the Atlas Cloud text-to-video warning readable in every theme - [`d3ca982`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d3ca982c99d8d0e4c506a4be152a7b6e42fedb7b) fix(connections): bound the Atlas Cloud schema cache and harden model lookups - [`a474374`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a474374fc1d7e1a63b7d7379b07648b918734587) fix(connections): address CodeRabbit review on Atlas Cloud model options - [`7696d20`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7696d203a960d3aa1b062f7909d71139888fe50a) fix(atlas): validate model options and isolate schema changes - [`2eb0c4d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2eb0c4d5f0733d85371a65dd362d791b54e1c140) Merge branch 'staging' into feat/atlas-schema-driven-video-params - [`35bd7ca`](https://github.com/Pasta-Devs/Marinara-Engine/commit/35bd7cacf530071301e8a0d96d952e13f21abb35) docs: keep video provider list together ### 📊 Changes **20 files changed** (+1610 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -0) 📝 `docs/media/image-providers.md` (+1 -1) 📝 `docs/media/scene-video.md` (+32 -1) ➕ `e2e/atlas-cloud-options.e2e.ts` (+105 -0) ➕ `packages/client/src/components/connections/AtlasCloudModelOptions.tsx` (+365 -0) 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+20 -0) ➕ `packages/client/src/hooks/use-atlas-cloud-model-schema.ts` (+28 -0) 📝 `packages/client/src/localization/locales/en.json` (+22 -1) 📝 `packages/server/src/routes/connections.routes.ts` (+63 -2) 📝 `packages/server/src/routes/gallery.routes.ts` (+2 -0) 📝 `packages/server/src/routes/game.routes.ts` (+3 -0) 📝 `packages/server/src/routes/sprites.routes.ts` (+4 -0) 📝 `packages/server/src/services/generation/media-connection-fallback.ts` (+8 -3) ➕ `packages/server/src/services/media/atlas-cloud-video-schema.ts` (+416 -0) 📝 `packages/server/src/services/media/atlas-cloud.ts` (+60 -0) 📝 `packages/server/src/services/video/game-video-runtime.ts` (+5 -0) 📝 `packages/server/src/services/video/video-generation.ts` (+21 -2) 📝 `packages/shared/src/constants/video-generation-defaults.ts` (+55 -1) 📝 `packages/shared/src/types/video-generation-defaults.ts` (+38 -0) ➕ `scripts/regressions/atlas-cloud-video-schema.regression.ts` (+359 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #6408 ## Why this change - Atlas Cloud models do not share one input shape, but Marinara sent the same six fields (`model`, `prompt`, `duration`, `aspect_ratio`, `resolution`, `image`) to all of them. Checked against the published `Input` schema of all 110 Atlas Cloud text-to-video and image-to-video models, 44 received a body that violates their schema even when undeclared extra fields are ignored: missing `image_url` / `size` / `ratio` / `images`, `duration: 8` on models that only allow 5 or 10, or a string prompt where a list is required. - Users could not set any model-specific input (`negative_prompt`, `seed`, `generate_audio`, `shot_type`, `enable_prompt_expansion`, LoRA lists), so provider defaults always applied. On `alibaba/wan-2.6/image-to-video-flash`, for example, that means an LLM rewrites the prompt, the clip may cut between shots, and audio is generated unasked. - **Test Video** never sent an image, so image-to-video models that require one failed the connection test even though Gallery use would work. A text-to-video model passed the test and then silently dropped the user's illustration. - **Fetch Models** never contacted Atlas Cloud. It returned four hardcoded video models (three for images) while the public catalog lists 177 video and 128 image generation models. ## What changed - **Request fitting** (`packages/server/src/services/media/atlas-cloud-video-schema.ts`): read the selected model's published schema from `https://static.atlascloud.ai/model/schema/<id with "/" as "-">.json` (that URL convention held for all 200 video models in the catalog), cache it for 6 hours, and fit the connection defaults to it: image field name (`image`, `image_url`, `images[]`, `reference_images[]`), `size` from resolution + aspect ratio, `ratio` vs `aspect_ratio`, duration snapped to the model's list or range, resolution snapped to the model's own spelling, list-typed prompts, and no undeclared fields. Falls back to the previous body when no schema can be read. Every fitted value is logged; a dropped source illustration is logged as a warning. - **Test Video** sends a generated gradient first frame when the Atlas Cloud model's schema requires an image (skipped when `sharp` is unavailable). - **Fetch Models** reads Atlas Cloud's public catalog (no key needed) for image and video connections, lists image-to-video ahead of text-to-video, shows each video model's starting price per second, and keeps the starter list as the fallback. - **Model options in the connection editor**: a new `GET /api/connections/atlas-cloud/video-model-schema?model=` endpoint and a **Model options** section under **Video Defaults** list every input the model declares beyond the common controls, with Atlas Cloud's description and default. Options stay unsent until changed, are stored per model under `videoGeneration.atlas.modelOptions` in the connection's default parameters, are threaded through every `generateVideo` call site and the video fallback connection, and are checked against the schema before each request (managed, unknown, or out-of-range values are left out and named in the log). The section also lists the clip lengths / resolutions / sizes / aspect ratios the model accepts and warns when a text-to-video model cannot use the gallery image. - Regression: `scripts/regressions/atlas-cloud-video-schema.regression.ts`. Docs: `docs/media/scene-video.md`, `docs/media/image-providers.md`. `CHANGELOG.md` entries under `[Unreleased]`. Storage note: `modelOptions` is a new optional key inside the existing `videoGeneration.atlas` JSON on a connection's default parameters. Existing connections normalize to `{}`; no storage-format change. Network note: Atlas Cloud connections now make two unauthenticated GETs to Atlas Cloud hosts (`static.atlascloud.ai` for a model schema, `<base URL>/models` for the catalog). No API key is sent on either. Other: commits 2eb6dd36b and d3ca982c9 are small follow-ups from the screenshot pass and a code read. ## Validation - [ ] `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) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Run by the AI agent that prepared this PR (Windows 11, Node 25.9, worktree off `staging` at 674330b6c). These are not a substitute for the boxes above: - `pnpm localization:check`, `pnpm format:check`, `pnpm lint`, `pnpm check:e2e-types`, `pnpm check:token-estimation-types`, and `pnpm build` all exit 0. The only lint warning is the existing `react-hooks/exhaustive-deps` one in `GameNarration.tsx`. - `pnpm check` itself was **not** green on this machine: it stops at `impeccable:check` because `.agents/skills` is a git symlink and this Windows checkout has `core.symlinks=false`. Every later step was run individually as listed above. - `atlas-cloud-video-schema.regression.ts` and `open-issues.regression.ts` pass when run directly with `tsx`. - Offline sweep of the adapter over the live schemas of all 110 Atlas Cloud text-to-video / image-to-video models (defaults 8 s, 16:9, 720p, with a reference image), counting real violations only: 66 valid bodies before, 108 after. The two remaining are lip-sync models that require `audio_url`. Bodies for the curated Veo 3.1 models are unchanged. - Isolated instance (separate port and `DATA_DIR`), Chromium, dark mode, desktop width: **Model options** rendered for `alibaba/wan-2.6/image-to-video-flash` from the live schema; setting `shot_type`, `enable_prompt_expansion`, and `seed` then **Save** stored them per model; **Test Video** with debug logging showed the outgoing body carrying the generated first frame and those three options, with no `aspect_ratio`. Atlas Cloud answered 401 because the key was a placeholder. - **Fetch Models** logic was exercised by calling `fetchAtlasCloudModels` against the live catalog (177 video, 128 image), not by clicking the button. Still needs a human: ~~- Manually verify a real generation with a valid Atlas Cloud key: Gallery **Animate illustration** and **Test Video** on an image-to-video model, with and without changed model options.~~ tested locally. ~~- Manually verify a model that takes `image_url` accepts the base64 data URL Marinara sends (some schemas describe that field as a URL).~~ tested locally. ~~- Manually verify **Fetch Models** in the connection editor for an Atlas Cloud video connection and an Atlas Cloud image connection.~~ tested locally. - Manually verify the **Model options** section in light mode and at a mobile viewport, including a text-to-video model (warning shown), a model with a JSON/LoRA input, a mistyped model ID, and an invalid JSON value. - Manually verify Game Mode scene video, Storyboard animation, animated expressions, and call clips still generate through an Atlas Cloud connection. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [x] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) Follow-up: #6415 - [ ] Version/release files updated (only if this PR includes a version bump) `docs/media/scene-video.md` and `docs/media/image-providers.md` changed. A `[docs-i18n] docs/media/scene-video.md, docs/media/image-providers.md` follow-up issue still needs to be opened. New English UI keys live under `connections.mediaSources.atlas.modelOptions.*`; `connections.mediaSources.atlas.videoDefaultsNote` changed wording. ## UI evidence (if applicable) screenshots attached in comment below. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Atlas Cloud model lists now load the current catalog, including starting video prices, with fallback models when unavailable. - Video settings show model-specific options, descriptions, defaults, supported durations, resolutions, and image requirements. - Options are saved per model and can be reset to defaults. - **Improvements** - Video requests automatically adapt to each model’s supported inputs. - Unsupported settings are omitted, adjustments are reported, and incompatible source images are flagged. - **Documentation** - Updated Atlas Cloud setup and scene-video guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> ### Maintainer sweep adjustments and verification Preserve the valid `prototype` model option, reject unsafe inherited schema keys, validate object-valued inputs, and hide stale controls during a model change. The focused schema regression fails on the prior head and passes after these adjustments. `pnpm check` and `pnpm localization:check` pass; local CodeRabbit review reports zero findings. The real connection editor passed six browser cases: desktop Chromium, Android Chromium emulation and iPhone WebKit emulation in light and dark themes. Each case saves options, verifies numeric/string enum identity, switches between two models, and resets one model without deleting the other's saved settings. [Screenshots and regression evidence](https://gist.github.com/SpicyMarinara/cbf4a6a439b39cace9a43c5b22828b78). - [ ] Manually verify generation against a live Atlas Cloud account and real provider model schemas. - [ ] Manually verify the editor on physical mobile devices. No paid provider requests or physical-device checks were performed. The existing staging drag regression is being fixed in #6420 before the final merge gates are rerun. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:17:09 +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#7166
No description provided.