[PR #5066] [MERGED] fix(image): bound NanoGPT reference payloads #6611

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5066
Author: @SpicyMarinara
Created: 8/15/2026
Status: ✅ Merged
Merged: 8/15/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/5058-nanogpt-image-payload


📝 Commits (6)

  • 10329b5 fix(image): bound NanoGPT reference payloads
  • be23474 Merge remote-tracking branch 'origin/staging' into fix/5058-nanogpt-image-payload
  • ff1169a Merge branch 'staging' into fix/5058-nanogpt-image-payload
  • d2287cd Merge remote-tracking branch 'origin/staging' into fix/5058-nanogpt-image-payload
  • f320462 Merge remote-tracking branch 'origin/fix/5058-nanogpt-image-payload' into fix/5058-nanogpt-image-payload
  • fc501be Merge remote-tracking branch 'origin/staging' into fix/5058-nanogpt-image-payload

📊 Changes

3 files changed (+146 additions, -19 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/server/src/services/image/image-generation.ts (+67 -11)
📝 scripts/regressions/provider-compat.regression.ts (+78 -8)

📄 Description

Linked issue

Closes #5058

Why this change

NanoGPT image requests could exceed the provider’s documented 4 MB image-upload limit when Illustrator supplied several references. Separately, successful base64 output was accepted without validating that it contained image bytes, leaving malformed output to become a broken gallery image.

What changed

  • Bounded the complete NanoGPT JSON request to 4 MB and retained as many ordered references as fit.
  • Preferred NanoGPT’s documented hosted URL response, downloading it immediately into Marinara storage while retaining base64 fallback support.
  • Normalized data-URL and raw-base64 fallbacks, detected their actual image type, accepted compatibility aliases, and reported response fields on malformed output.
  • Added end-to-end provider regressions for oversized references, hosted URL download, base64 fallback, and invalid response diagnostics.
  • Added a user-facing changelog entry.

Validation

  • pnpm regression:providers
  • pnpm check
  • Manually generate with NanoGPT/Qwen Image both with and without reference images

Docs and release impact

  • Confirm no documentation or version update is required

Manual verification requested: generate one Illustrator image with multiple large references and one without references using a real NanoGPT Qwen Image connection, then confirm both appear in chat and Gallery.


🔄 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/5066 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/15/2026 **Status:** ✅ Merged **Merged:** 8/15/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/5058-nanogpt-image-payload` --- ### 📝 Commits (6) - [`10329b5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/10329b5aa8dd31d5eb9b6e165336f6595aedd89c) fix(image): bound NanoGPT reference payloads - [`be23474`](https://github.com/Pasta-Devs/Marinara-Engine/commit/be2347421ea4b46126aaf836aefb0fa5cfb097d0) Merge remote-tracking branch 'origin/staging' into fix/5058-nanogpt-image-payload - [`ff1169a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ff1169a79d5f60f16fcd359f150b3e6324461bdc) Merge branch 'staging' into fix/5058-nanogpt-image-payload - [`d2287cd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d2287cd8e0f30f11fe981bd6afbf198ec2f79795) Merge remote-tracking branch 'origin/staging' into fix/5058-nanogpt-image-payload - [`f320462`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f320462584167dc3af0fc950b41fd8d9f292dea1) Merge remote-tracking branch 'origin/fix/5058-nanogpt-image-payload' into fix/5058-nanogpt-image-payload - [`fc501be`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fc501be537ff12c402defe47200158a506ac7869) Merge remote-tracking branch 'origin/staging' into fix/5058-nanogpt-image-payload ### 📊 Changes **3 files changed** (+146 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/server/src/services/image/image-generation.ts` (+67 -11) 📝 `scripts/regressions/provider-compat.regression.ts` (+78 -8) </details> ### 📄 Description ## Linked issue Closes #5058 ## Why this change NanoGPT image requests could exceed the provider’s documented 4 MB image-upload limit when Illustrator supplied several references. Separately, successful base64 output was accepted without validating that it contained image bytes, leaving malformed output to become a broken gallery image. ## What changed - Bounded the complete NanoGPT JSON request to 4 MB and retained as many ordered references as fit. - Preferred NanoGPT’s documented hosted URL response, downloading it immediately into Marinara storage while retaining base64 fallback support. - Normalized data-URL and raw-base64 fallbacks, detected their actual image type, accepted compatibility aliases, and reported response fields on malformed output. - Added end-to-end provider regressions for oversized references, hosted URL download, base64 fallback, and invalid response diagnostics. - Added a user-facing changelog entry. ## Validation - [ ] `pnpm regression:providers` - [ ] `pnpm check` - [ ] Manually generate with NanoGPT/Qwen Image both with and without reference images ## Docs and release impact - [ ] Confirm no documentation or version update is required Manual verification requested: generate one Illustrator image with multiple large references and one without references using a real NanoGPT Qwen Image connection, then confirm both appear in chat and Gallery. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:12:04 +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#6611
No description provided.