[GH-ISSUE #3804] Feature: local ComfyUI as a video generation source (WAN 2.2 etc.) #2053

Closed
opened 2026-10-21 05:44:57 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @kh0p on GitHub (Jul 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3804

Originally assigned to: @SpicyMarinara on GitHub.

Motivation

video_generation currently supports only cloud services (Google AI Studio, xAI, OpenRouter, Seedance). Local video models — WAN 2.2 in particular, including its widely-used NSFW-capable community merges — run well through ComfyUI on consumer GPUs, and the engine's scene videos / Game Mode storyboard animations would work fully offline with such a source.

Working reference implementation

I have this running locally as a patch and can turn it into a PR if the approach sounds acceptable:

  • A comfyui branch in generateVideoUnqueued() (dispatch on videoService/videoGenerationSource === "comfyui" or :8188 in the base URL), wrapped in the existing withVideoGenerationDeadline.
  • generateComfyUiVideo() mirrors the image provider's ComfyUI flow: substitute placeholders into an API-format workflow template (%prompt%, %width%, %height%, %seed%, %length% = frame count derived from durationSeconds × 16 fps, %reference_image_name% → uploads request.referenceImage via /upload/image for i2v graphs), queue via /prompt, poll /history, download the mp4 from the gifs/images output of e.g. the core SaveVideo node.
  • Aspect/resolution mapping: 9:16 swaps dimensions; 480p → 832×480, otherwise 1280×720.

Open design questions where maintainer preference matters:

  1. Where the workflow template lives. My patch reads a file path from an env var (MARINARA_COMFYUI_VIDEO_WORKFLOW), but reusing the connection's existing comfyuiWorkflow column (already in the schema and connection import format) seems cleaner — it just needs threading through VideoGenerationRequest or the video runtime resolution.
  2. Whether to register a comfyui entry in VIDEO_GENERATION_SOURCES so the connection UI offers it (connection import already accepts arbitrary source strings).
  3. Timeout guidance: local WAN 14B renders can exceed the 30-minute default VIDEO_GEN_TIMEOUT_MS on mid-range GPUs; docs should probably mention raising it for local sources.

Happy to open the PR either way — with the env-var approach as-is, or the connection-field approach if that's the preferred design.

🤖 Generated with Claude Code

Originally created by @kh0p on GitHub (Jul 19, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3804 Originally assigned to: @SpicyMarinara on GitHub. ## Motivation `video_generation` currently supports only cloud services (Google AI Studio, xAI, OpenRouter, Seedance). Local video models — WAN 2.2 in particular, including its widely-used NSFW-capable community merges — run well through ComfyUI on consumer GPUs, and the engine's scene videos / Game Mode storyboard animations would work fully offline with such a source. ## Working reference implementation I have this running locally as a patch and can turn it into a PR if the approach sounds acceptable: - A `comfyui` branch in `generateVideoUnqueued()` (dispatch on `videoService`/`videoGenerationSource === "comfyui"` or `:8188` in the base URL), wrapped in the existing `withVideoGenerationDeadline`. - `generateComfyUiVideo()` mirrors the image provider's ComfyUI flow: substitute placeholders into an API-format workflow template (`%prompt%`, `%width%`, `%height%`, `%seed%`, `%length%` = frame count derived from `durationSeconds` × 16 fps, `%reference_image_name%` → uploads `request.referenceImage` via `/upload/image` for i2v graphs), queue via `/prompt`, poll `/history`, download the mp4 from the `gifs`/`images` output of e.g. the core `SaveVideo` node. - Aspect/resolution mapping: `9:16` swaps dimensions; `480p` → 832×480, otherwise 1280×720. Open design questions where maintainer preference matters: 1. **Where the workflow template lives.** My patch reads a file path from an env var (`MARINARA_COMFYUI_VIDEO_WORKFLOW`), but reusing the connection's existing `comfyuiWorkflow` column (already in the schema and connection import format) seems cleaner — it just needs threading through `VideoGenerationRequest` or the video runtime resolution. 2. Whether to register a `comfyui` entry in `VIDEO_GENERATION_SOURCES` so the connection UI offers it (connection import already accepts arbitrary source strings). 3. Timeout guidance: local WAN 14B renders can exceed the 30-minute default `VIDEO_GEN_TIMEOUT_MS` on mid-range GPUs; docs should probably mention raising it for local sources. Happy to open the PR either way — with the env-var approach as-is, or the connection-field approach if that's the preferred design. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bsakaguchi 2026-10-21 05:44:57 +07:00
  • closed this issue
  • added the
    in-pr
    label
Author
Owner

@SpicyMarinara commented on GitHub (Jul 19, 2026):

We can add it as a Connection source for video generation, yeah.

<!-- gh-comment-id:5014942170 --> @SpicyMarinara commented on GitHub (Jul 19, 2026): We can add it as a Connection source for video generation, yeah.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 19, 2026):

Addressed in #3806. Marinara now supports local ComfyUI as a video source through the existing connection workflow field, including API-workflow placeholders, optional reference-image upload, queue/history polling, MP4 validation, and existing video deadlines. Documentation and defaults are included. Local pnpm check, mock ComfyUI protocol integration, and all PR checks pass; all three CodeRabbit findings were applied and the incremental re-review returned no actionable comments.

<!-- gh-comment-id:5015047947 --> @SpicyMarinara commented on GitHub (Jul 19, 2026): Addressed in #3806. Marinara now supports local ComfyUI as a video source through the existing connection workflow field, including API-workflow placeholders, optional reference-image upload, queue/history polling, MP4 validation, and existing video deadlines. Documentation and defaults are included. Local pnpm check, mock ComfyUI protocol integration, and all PR checks pass; all three CodeRabbit findings were applied and the incremental re-review returned no actionable comments.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 19, 2026):

If possible, check on staging if all works well. I have no way of testing local stuff.

<!-- gh-comment-id:5015073717 --> @SpicyMarinara commented on GitHub (Jul 19, 2026): If possible, check on staging if all works well. I have no way of testing local stuff.
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#2053
No description provided.