[PR #6082] [MERGED] fix: image timeouts and large-backup imports #7054

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

📋 Pull Request Information

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

Base: staging ← Head: fix/image-generation-settings-6074


📝 Commits (8)

  • 74f9e39 chore: track image generation settings fix for #6074
  • 14b55c8 fix: honor image generation transport timeout (#6074)
  • 2c0d457 test: require prompt image cancellation settlement
  • c810656 Merge remote-tracking branch 'origin/staging' into fix/image-generation-settings-6074
  • adf82e5 docs: distinguish parameter editor defaults from effective values (#6073)
  • bb16161 fix: restore imports of full backups larger than 2 GiB (#6091)
  • 8042908 fix: honor selected local image backend transport timeout
  • 8d8c4fa test: retain import access checks without the obsolete size cap

📊 Changes

10 files changed (+115 additions, -11 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 docs/prompts/generation-parameters.md (+2 -2)
📝 packages/server/src/routes/backup.routes.ts (+3 -3)
📝 packages/server/src/services/image/image-generation.ts (+8 -2)
📝 scripts/regressions/avatar-lead-prompt.regression.ts (+22 -0)
📝 scripts/regressions/image-dimension-limit.regression.ts (+1 -0)
➕ scripts/regressions/image-generation-timeout.regression.ts (+62 -0)
📝 scripts/regressions/open-issues.regression.ts (+2 -2)
📝 scripts/regressions/profile-import-data-security.regression.ts (+7 -0)
📝 scripts/regressions/swarmui-timeout.regression.ts (+4 -2)

📄 Description

Linked issues

Closes #6074
Closes #6091

Also completes the English clarification found while reviewing #6073 / #6086.

Why this change

Slow image providers failed after five minutes even when IMAGE_GEN_TIMEOUT_MS allowed 30 minutes. Full-backup imports also regressed to a 2 GiB upload ceiling despite the existing streaming ZIP64 restore support.

What changed

  • Set header/body timeouts in the shared image-fetch helper from IMAGE_GEN_TIMEOUT_MS. Local backend requests use the existing ComfyUI/SwarmUI timeout resolver, including reference uploads; backend overrides, overall generation deadlines, cancellation, and outbound URL validation remain intact.
  • Remove the aggregate 2 GiB multipart and route limits from Import Profile. Reuse streaming uploads and the existing archive reader; retain the JSON, entry, path, CRC, and import validation.
  • Clarify parameter-editor fallback values versus effective requests and where preset, connection, and chat overrides apply. All ten translated packs receive the same clarification in #6086.

Current staging already retains 512x512 for custom OpenAI-compatible models and preserves character appearance alongside LoRA tags. Coverage was added for those reported cases without changing that behavior. No new dependencies or request paths.

Validation

Executed successfully:

  • pnpm check.
  • provider-compat, image-result-url-security, image-generation-timeout, image-dimension-limit, avatar-lead-prompt, and swarmui-timeout regressions with isolated temporary storage.
  • automatic-backup-retention, profile-import-data-security, profile-import-asset-security, and open-issues regressions with isolated temporary storage. Unauthorized remote multipart imports are rejected with HTTP 403; authorized local preview/import succeeds.
  • A real HTTP/multipart ZIP upload of 2,147,484,143 bytes: before the backup fix, HTTP 400 with "Profile archive upload was truncated"; afterward, HTTP 200 preview followed by successful import and byte-for-byte restoration of the fixture image. The temporary fixture uses valid ZIP preamble padding to cross the former limit without importing a huge asset.

The extended SwarmUI fixture delays session-response headers beyond the general image timeout but within the selected local-backend timeout: it failed with HeadersTimeoutError before the shared-helper correction and passes afterward.

The image transport regression reproduces HeadersTimeoutError before the patch, then verifies delayed headers/body, cancellation, and the configured deadline. It shortens fixture timeouts to avoid a five-minute test. Existing fixtures cover custom-model dimensions, known-provider size restrictions, fallback limits, and outbound image URL security. Avatar prompt coverage includes LoRA tags in positive and negative settings across four prompt grammars.

  • 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

Manually verify avatar/persona generation against the reporter's slow LocalAI model with 512x512 portrait settings and LoRA tags. Manually verify a real large full backup through the browser's Import Profile flow. No paid provider call, actual 30-minute wait, or manual container check was performed locally; the large-upload proof used the real local HTTP API.

The upload remains a privileged owner action. Physical disk capacity still applies; this change removes the artificial archive-size ceiling and adds no new deployment quota. Existing archive validation and cleanup remain in place.

Docs and release impact

Changelog updated under Unreleased. No version bump. The parameter guide clarification is mirrored by #6086 on docs-i18n. Existing backup documentation already describes restoring full backup ZIPs without a 2 GiB cap.

UI evidence (if applicable)

No UI changes.

Summary by CodeRabbit

  • Bug Fixes

    • Full-backup ZIP imports now support archives larger than 2 GiB.
    • Image generation now respects configured timeouts while waiting for provider responses and image data, including slower local and hosted backends.
    • Remote profile preview uploads from unprivileged addresses are rejected, while local previews remain available.
  • Documentation

    • Clarified how generation defaults, presets, connections, chat overrides, and effective parameter values are applied.
  • Tests

    • Added regression coverage for backup imports, image-generation timeouts, image dimensions, prompt handling, and profile-preview security.

🔄 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/6082 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/12/2026 **Status:** ✅ Merged **Merged:** 9/12/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/image-generation-settings-6074` --- ### 📝 Commits (8) - [`74f9e39`](https://github.com/Pasta-Devs/Marinara-Engine/commit/74f9e39865aad1c9878a8b852cfc192900acbf10) chore: track image generation settings fix for #6074 - [`14b55c8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/14b55c80fcf8e8aa0d30bd3175bfc3a4a683504a) fix: honor image generation transport timeout (#6074) - [`2c0d457`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2c0d4576c258f07a8a7d4fb38d01e36d947f14bd) test: require prompt image cancellation settlement - [`c810656`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c810656290fe706a5328d1b2bd2d644ef3e717f6) Merge remote-tracking branch 'origin/staging' into fix/image-generation-settings-6074 - [`adf82e5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/adf82e522677af079ebb930b9e0556940c9c8c87) docs: distinguish parameter editor defaults from effective values (#6073) - [`bb16161`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bb16161f79acfaa8df6c0d0eb27b1f07b344daa2) fix: restore imports of full backups larger than 2 GiB (#6091) - [`8042908`](https://github.com/Pasta-Devs/Marinara-Engine/commit/80429086dcea521f1fdc9da1234c00578669a299) fix: honor selected local image backend transport timeout - [`8d8c4fa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8d8c4faf3d438471da77261cc4cbdd8674b608f3) test: retain import access checks without the obsolete size cap ### 📊 Changes **10 files changed** (+115 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `docs/prompts/generation-parameters.md` (+2 -2) 📝 `packages/server/src/routes/backup.routes.ts` (+3 -3) 📝 `packages/server/src/services/image/image-generation.ts` (+8 -2) 📝 `scripts/regressions/avatar-lead-prompt.regression.ts` (+22 -0) 📝 `scripts/regressions/image-dimension-limit.regression.ts` (+1 -0) ➕ `scripts/regressions/image-generation-timeout.regression.ts` (+62 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+2 -2) 📝 `scripts/regressions/profile-import-data-security.regression.ts` (+7 -0) 📝 `scripts/regressions/swarmui-timeout.regression.ts` (+4 -2) </details> ### 📄 Description ## Linked issues Closes #6074 Closes #6091 Also completes the English clarification found while reviewing #6073 / #6086. ## Why this change Slow image providers failed after five minutes even when IMAGE_GEN_TIMEOUT_MS allowed 30 minutes. Full-backup imports also regressed to a 2 GiB upload ceiling despite the existing streaming ZIP64 restore support. ## What changed - Set header/body timeouts in the shared image-fetch helper from IMAGE_GEN_TIMEOUT_MS. Local backend requests use the existing ComfyUI/SwarmUI timeout resolver, including reference uploads; backend overrides, overall generation deadlines, cancellation, and outbound URL validation remain intact. - Remove the aggregate 2 GiB multipart and route limits from Import Profile. Reuse streaming uploads and the existing archive reader; retain the JSON, entry, path, CRC, and import validation. - Clarify parameter-editor fallback values versus effective requests and where preset, connection, and chat overrides apply. All ten translated packs receive the same clarification in #6086. Current staging already retains 512x512 for custom OpenAI-compatible models and preserves character appearance alongside LoRA tags. Coverage was added for those reported cases without changing that behavior. No new dependencies or request paths. ## Validation Executed successfully: - pnpm check. - provider-compat, image-result-url-security, image-generation-timeout, image-dimension-limit, avatar-lead-prompt, and swarmui-timeout regressions with isolated temporary storage. - automatic-backup-retention, profile-import-data-security, profile-import-asset-security, and open-issues regressions with isolated temporary storage. Unauthorized remote multipart imports are rejected with HTTP 403; authorized local preview/import succeeds. - A real HTTP/multipart ZIP upload of 2,147,484,143 bytes: before the backup fix, HTTP 400 with "Profile archive upload was truncated"; afterward, HTTP 200 preview followed by successful import and byte-for-byte restoration of the fixture image. The temporary fixture uses valid ZIP preamble padding to cross the former limit without importing a huge asset. The extended SwarmUI fixture delays session-response headers beyond the general image timeout but within the selected local-backend timeout: it failed with HeadersTimeoutError before the shared-helper correction and passes afterward. The image transport regression reproduces HeadersTimeoutError before the patch, then verifies delayed headers/body, cancellation, and the configured deadline. It shortens fixture timeouts to avoid a five-minute test. Existing fixtures cover custom-model dimensions, known-provider size restrictions, fallback limits, and outbound image URL security. Avatar prompt coverage includes LoRA tags in positive and negative settings across four prompt grammars. - [ ] 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 Manually verify avatar/persona generation against the reporter's slow LocalAI model with 512x512 portrait settings and LoRA tags. Manually verify a real large full backup through the browser's Import Profile flow. No paid provider call, actual 30-minute wait, or manual container check was performed locally; the large-upload proof used the real local HTTP API. The upload remains a privileged owner action. Physical disk capacity still applies; this change removes the artificial archive-size ceiling and adds no new deployment quota. Existing archive validation and cleanup remain in place. ## Docs and release impact Changelog updated under Unreleased. No version bump. The parameter guide clarification is mirrored by #6086 on docs-i18n. Existing backup documentation already describes restoring full backup ZIPs without a 2 GiB cap. ## UI evidence (if applicable) No UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Full-backup ZIP imports now support archives larger than 2 GiB. - Image generation now respects configured timeouts while waiting for provider responses and image data, including slower local and hosted backends. - Remote profile preview uploads from unprivileged addresses are rejected, while local previews remain available. - **Documentation** - Clarified how generation defaults, presets, connections, chat overrides, and effective parameter values are applied. - **Tests** - Added regression coverage for backup imports, image-generation timeouts, image dimensions, prompt handling, and profile-preview security. <!-- 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:16:07 +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#7054
No description provided.