[GH-ISSUE #8017] [Issue]: Pictures and clips are lost when a local LLM and ComfyUI share one GPU (llama-swap) #7519

Closed
opened 2026-10-24 04:03:47 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @JamesMowery on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8017

Originally assigned to: @SpicyMarinara on GitHub.

Summary

With one GPU shared between a local LLM and a local image/video backend (for example llama-swap swapping between a llama.cpp model and ComfyUI), pictures and clips wait for minutes and are often lost. A ComfyUI video behind such a swapper can also fail after five minutes, and a selfie whose prompt comes back empty disappears without a word.

Expected behavior

  • Text and media requests to a shared GPU take turns, so a picture doesn't wait forever behind chat replies and the GPU swaps once per turn instead of once per request.
  • A ComfyUI video waits for its render, however long a render gate holds the request.
  • An empty selfie prompt reports an error.

Actual behavior

  • A swapper only sees requests. A media request waits while any text request is in flight, and every new text request for the loaded model goes straight past it, so with a few chats generating, pictures waited for minutes and were lost.
  • A ComfyUI video request failed at Undici's five-minute headers timeout while a render gate held POST /prompt.
  • When the selfie prompt writer returned nothing (or only a think block), the selfie ended silently.

Steps to reproduce

  1. Run a local LLM and ComfyUI behind llama-swap on one GPU, and point Marinara's text and image connections at it.
  2. Keep two or three chats generating while a Roleplay chat makes Illustrator pictures or a Conversation character sends a selfie.
  3. The picture waits behind each new reply and often never arrives.

Environment

  • Marinara Engine version: 2.5.1 (staging)
  • Install type: source
  • OS + version: Linux (Debian 13)
  • Browser or app shell: desktop browser; llama-swap with llama.cpp and ComfyUI on one GPU

Logs, screenshots, or video

The video failure is Undici's headers timeout (UND_ERR_HEADERS_TIMEOUT) after five minutes.

Additional context

The fix is opt-in (MARINARA_SHARED_GPU_HOSTS), so setups with separate GPUs or hosted providers are untouched. @SpicyMarinara for visibility.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @JamesMowery on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8017 Originally assigned to: @SpicyMarinara on GitHub. ## Summary With one GPU shared between a local LLM and a local image/video backend (for example llama-swap swapping between a llama.cpp model and ComfyUI), pictures and clips wait for minutes and are often lost. A ComfyUI video behind such a swapper can also fail after five minutes, and a selfie whose prompt comes back empty disappears without a word. ## Expected behavior - Text and media requests to a shared GPU take turns, so a picture doesn't wait forever behind chat replies and the GPU swaps once per turn instead of once per request. - A ComfyUI video waits for its render, however long a render gate holds the request. - An empty selfie prompt reports an error. ## Actual behavior - A swapper only sees requests. A media request waits while any text request is in flight, and every new text request for the loaded model goes straight past it, so with a few chats generating, pictures waited for minutes and were lost. - A ComfyUI video request failed at Undici's five-minute headers timeout while a render gate held `POST /prompt`. - When the selfie prompt writer returned nothing (or only a think block), the selfie ended silently. ## Steps to reproduce 1. Run a local LLM and ComfyUI behind llama-swap on one GPU, and point Marinara's text and image connections at it. 2. Keep two or three chats generating while a Roleplay chat makes Illustrator pictures or a Conversation character sends a selfie. 3. The picture waits behind each new reply and often never arrives. ## Environment - Marinara Engine version: 2.5.1 (`staging`) - Install type: source - OS + version: Linux (Debian 13) - Browser or app shell: desktop browser; llama-swap with llama.cpp and ComfyUI on one GPU ## Logs, screenshots, or video The video failure is Undici's headers timeout (`UND_ERR_HEADERS_TIMEOUT`) after five minutes. ## Additional context The fix is opt-in (`MARINARA_SHARED_GPU_HOSTS`), so setups with separate GPUs or hosted providers are untouched. @SpicyMarinara for visibility. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-24 04:03:47 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Oct 23, 2026):

Resolved by #8018, merged into staging as 507830a8a8b27360d4c4aa6d56438f66037519f7. Verified that the reviewed head 6c6705bf1ed2b0ff8091535dd3dccc8b1eac4e13 is a parent of the merge and an ancestor of current staging. All 8 required checks passed, the current-head Dottore review isolated no defects, all review threads were resolved, and the current-head owner approval is recorded in the review.

The opt-in MARINARA_SHARED_GPU_HOSTS configuration coordinates text/media turns for the listed proxy hosts without holding a global media permit while waiting for the GPU. The ComfyUI request uses the configured video render deadline for both headers and body, and empty/think-only selfie prompts now produce an explicit error. The four relevant regression files passed at the contributor head and in a clean integration fixture with staging's pnpm 12 graph; the integration also passed full pnpm check. Additional real-route controls verified empty prompts, cancellation, cap enforcement and release of all permits/waiters.

This is source and controlled provider-boundary proof, not a claim of a physical llama-swap/GPU session or a real five-minute render. Configure the opt-in hosts for a shared-GPU setup; leave the setting empty for separate GPUs or remote providers. The pending ten-language documentation publication is tracked by #8019 / #8140.

Post-merge Regression Checks, container publication, and CodeQL are still running at the time of closure. No pending check is being reported as passed.

<!-- gh-comment-id:6356993730 --> @SpicyMarinara commented on GitHub (Oct 23, 2026): Resolved by #8018, merged into `staging` as `507830a8a8b27360d4c4aa6d56438f66037519f7`. Verified that the reviewed head `6c6705bf1ed2b0ff8091535dd3dccc8b1eac4e13` is a parent of the merge and an ancestor of current staging. All 8 required checks passed, the current-head Dottore review isolated no defects, all review threads were resolved, and the current-head owner approval is recorded in [the review](https://github.com/Pasta-Devs/Marinara-Engine/pull/8018#pullrequestreview-5623677586). The opt-in `MARINARA_SHARED_GPU_HOSTS` configuration coordinates text/media turns for the listed proxy hosts without holding a global media permit while waiting for the GPU. The ComfyUI request uses the configured video render deadline for both headers and body, and empty/think-only selfie prompts now produce an explicit error. The four relevant regression files passed at the contributor head and in a clean integration fixture with staging's pnpm 12 graph; the integration also passed full `pnpm check`. Additional real-route controls verified empty prompts, cancellation, cap enforcement and release of all permits/waiters. This is source and controlled provider-boundary proof, not a claim of a physical llama-swap/GPU session or a real five-minute render. Configure the opt-in hosts for a shared-GPU setup; leave the setting empty for separate GPUs or remote providers. The pending ten-language documentation publication is tracked by #8019 / #8140. Post-merge [Regression Checks](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39897510828), [container publication](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39897510338), and [CodeQL](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39897510200) are still running at the time of closure. No pending check is being reported as passed.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 23, 2026):

Post-merge publication is complete at 507830a8a8b27360d4c4aa6d56438f66037519f7: Regression Checks, container publication, and CodeQL all succeeded. Both AMD64 and ARM64 configurations in the staging Docker image identify this exact merge; manifest digest sha256:e63f243f4202e05487a56c5d70cbcf5daebf5543b5b0c25e71798dd1915798f1.

The related ten-language configuration documentation is also published through #8140. All 20 raw branch files matched their reviewed bytes and hashes before #8019 was closed.

<!-- gh-comment-id:6357146316 --> @SpicyMarinara commented on GitHub (Oct 23, 2026): Post-merge publication is complete at `507830a8a8b27360d4c4aa6d56438f66037519f7`: [Regression Checks](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39897510828), [container publication](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39897510338), and [CodeQL](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39897510200) all succeeded. Both AMD64 and ARM64 configurations in the staging Docker image identify this exact merge; manifest digest `sha256:e63f243f4202e05487a56c5d70cbcf5daebf5543b5b0c25e71798dd1915798f1`. The related ten-language configuration documentation is also published through #8140. All 20 raw branch files matched their reviewed bytes and hashes before #8019 was closed.
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#7519
No description provided.