[GH-ISSUE #7784] [Issue]: Pictures and videos are lost when a local LLM and ComfyUI share one GPU through llama-swap #4298

Closed
opened 2026-10-21 06:14:25 +07:00 by bsakaguchi · 0 comments
Owner

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

Summary

On a single GPU where llama-swap swaps between a local LLM and ComfyUI, pictures and videos that characters send are lost when several chats ask for them at once. Most never reach ComfyUI, and Marinara shows no error for them. This is the gap described in #6498: Marinara's text requests and its image/video queue do not take turns on the shared GPU.

Expected behavior

Every selfie, Illustrator picture and video message either appears in the chat or shows an error. When text and media share one GPU, a waiting picture gets its turn instead of waiting behind an endless stream of text requests.

Actual behavior

In one test with four chats (conversation selfies, group selfies, video messages and an Illustrator picture), about 4–9 pictures and 1–3 videos were expected. ComfyUI received two jobs and Marinara saved one video. From the llama-swap, ComfyUI and Marinara logs:

  1. Media starves behind text. llama-swap queues a ComfyUI request while the LLM has a request in flight, but every new LLM request for the already-loaded model goes straight through. With several chats generating, a video and an Illustrator picture waited 6 minutes and only got through when Marinara was shut down. llama-swap's scheduler priority only orders requests that are already queued, so it cannot fix this; only the client can hold back new text requests.
  2. ComfyUI video requests fail after exactly 5 minutes. comfyUiVideoFetch does not raise Undici's default 300 s headers timeout, so a video whose queue wait plus render passes 5 minutes fails with fetch failed: Headers Timeout Error. Image requests already raise it to the image timeout.
  3. An empty selfie prompt is dropped without a trace. generateSelfie returns quietly when the prompt writer gives back nothing, with no selfie_error and no log line. The video prompt writer already removes leading <think> blocks and reports an empty prompt.

Pictures queued behind a starved or hung request then wait in the provider lane and never log anything.

Steps to reproduce

  1. Run llama-swap with one exclusive GPU group holding a local LLM and ComfyUI, and point Marinara's text, image and video connections at it.
  2. Open three or four conversations or group chats with selfies and video messages enabled.
  3. Ask for a picture or video in each chat, one after another, so text generation keeps running while media waits.

Environment

  • Marinara Engine version: 2.5.0 (staging)
  • Install type: source
  • OS + version: Debian 13
  • Browser or app shell: Firefox
  • llama-swap v265; ComfyUI behind a small gate that holds POST /prompt open until the render finishes

Logs, screenshots, or video

Excerpt from the llama-swap debug log (the ComfyUI request waited from 00:13:32 to 00:19:30 while about 20 LLM requests went straight through):

00:13:32.443 group: queuing request for model comfyui_auto (would evict in-flight process)
00:13:51.171 group: fast-path serving model Artemis-31B-v1.2-NVFP4-Vision (already ready)
...
00:19:30.735 group: queued request for model comfyui_auto now starting swap

Marinara:

[00:18:32.985] ERROR: [commands] Video message failed
  TypeError: fetch failed
  caused by: HeadersTimeoutError: Headers Timeout Error

Additional context

Follow-up to #6498. A PR adding opt-in turn-taking for a shared GPU host is on the way.

CLOSED UNTIL I GET MORE CLAUDE CODE USAGE AVAILABLE.

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 18, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7784 ## Summary On a single GPU where llama-swap swaps between a local LLM and ComfyUI, pictures and videos that characters send are lost when several chats ask for them at once. Most never reach ComfyUI, and Marinara shows no error for them. This is the gap described in #6498: Marinara's text requests and its image/video queue do not take turns on the shared GPU. ## Expected behavior Every selfie, Illustrator picture and video message either appears in the chat or shows an error. When text and media share one GPU, a waiting picture gets its turn instead of waiting behind an endless stream of text requests. ## Actual behavior In one test with four chats (conversation selfies, group selfies, video messages and an Illustrator picture), about 4–9 pictures and 1–3 videos were expected. ComfyUI received two jobs and Marinara saved one video. From the llama-swap, ComfyUI and Marinara logs: 1. **Media starves behind text.** llama-swap queues a ComfyUI request while the LLM has a request in flight, but every new LLM request for the already-loaded model goes straight through. With several chats generating, a video and an Illustrator picture waited 6 minutes and only got through when Marinara was shut down. llama-swap's scheduler priority only orders requests that are already queued, so it cannot fix this; only the client can hold back new text requests. 2. **ComfyUI video requests fail after exactly 5 minutes.** `comfyUiVideoFetch` does not raise Undici's default 300 s headers timeout, so a video whose queue wait plus render passes 5 minutes fails with `fetch failed: Headers Timeout Error`. Image requests already raise it to the image timeout. 3. **An empty selfie prompt is dropped without a trace.** `generateSelfie` returns quietly when the prompt writer gives back nothing, with no `selfie_error` and no log line. The video prompt writer already removes leading `<think>` blocks and reports an empty prompt. Pictures queued behind a starved or hung request then wait in the provider lane and never log anything. ## Steps to reproduce 1. Run llama-swap with one exclusive GPU group holding a local LLM and ComfyUI, and point Marinara's text, image and video connections at it. 2. Open three or four conversations or group chats with selfies and video messages enabled. 3. Ask for a picture or video in each chat, one after another, so text generation keeps running while media waits. ## Environment - Marinara Engine version: 2.5.0 (staging) - Install type: source - OS + version: Debian 13 - Browser or app shell: Firefox - llama-swap v265; ComfyUI behind a small gate that holds `POST /prompt` open until the render finishes ## Logs, screenshots, or video Excerpt from the llama-swap debug log (the ComfyUI request waited from 00:13:32 to 00:19:30 while about 20 LLM requests went straight through): ``` 00:13:32.443 group: queuing request for model comfyui_auto (would evict in-flight process) 00:13:51.171 group: fast-path serving model Artemis-31B-v1.2-NVFP4-Vision (already ready) ... 00:19:30.735 group: queued request for model comfyui_auto now starting swap ``` Marinara: ``` [00:18:32.985] ERROR: [commands] Video message failed TypeError: fetch failed caused by: HeadersTimeoutError: Headers Timeout Error ``` ## Additional context Follow-up to #6498. A PR adding opt-in turn-taking for a shared GPU host is on the way. **CLOSED UNTIL I GET MORE CLAUDE CODE USAGE AVAILABLE.** ## 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.
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#4298
No description provided.