[PR #886] [MERGED] feat: add RunPod Serverless ComfyUI image generation support #4820

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

📋 Pull Request Information

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

Base: staging ← Head: pr-ready-runpod


📝 Commits (1)

  • 78ff5b0 feat: add RunPod Serverless ComfyUI image generation support

📊 Changes

11 files changed (+613 additions, -3 deletions)

View changed files

📝 packages/client/src/components/connections/ConnectionEditor.tsx (+41 -3)
📝 packages/server/src/db/migrate.ts (+5 -0)
📝 packages/server/src/db/schema/connections.ts (+2 -0)
📝 packages/server/src/routes/connections.routes.ts (+9 -0)
📝 packages/server/src/services/image/image-generation.ts (+14 -0)
➕ packages/server/src/services/image/runpod-comfyui.service.ts (+270 -0)
📝 packages/server/src/services/storage/connections.storage.ts (+5 -0)
➕ packages/server/test/runpod-comfyui.test.ts (+255 -0)
📝 packages/shared/src/constants/model-lists.ts (+9 -0)
📝 packages/shared/src/schemas/connection.schema.ts (+1 -0)
📝 packages/shared/src/types/connection.ts (+2 -0)

📄 Description

Linked issue

Closes #885

https://github.com/Pasta-Devs/Marinara-Engine/issues/885 - Integration of Runpod Serverless endpoint option for image gen.

Why this change

This allows the creation of image gen connections targetting runpod serverless endpoints through the normal connection creation.

What changed

9 files · 607 additions · 3 deletions

New provider - RunPod Serverless ComfyUI

  • Added runpod_comfyui to IMAGE_GENERATION_SOURCES, EXPLICIT_IMAGE_SOURCES, and inferImageSource() — registers RunPod Serverless ComfyUI as a first-class image generation backend

  • New handler (packages/server/src/services/image/runpod-comfyui.service.ts) communicates with RunPod's async job API (POST /run → poll /status/{id} → extract base64 from output.images[0].data). Substitutes %prompt%, %seed%, %width%, %height% placeholders before sending the workflow JSON

New DB column -image_endpoint_id

  • Added to the api_connections schema, migration, and shared APIConnection type — a dedicated field for endpoint-based image services so users don't need to repurpose the model field

UI - Connection editor

  • New Endpoint ID text field when RunPod is selected in the image source dropdown
  • ComfyUI workflow JSON textarea now visible for RunPod connections (labelled "Required")
  • Amber config hint explaining the setup

Route fix - /test endpoint

  • RunPod connections return a friendly message directing users to "Test Image" instead of hitting /models and getting a 404

Tests - 8 new unit tests

  • Mock HTTP server tests covering: successful generation (first-poll and multi-poll), failed/cancelled jobs, auth errors, missing workflow, invalid JSON, and empty output handling

Validation

  • 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

Have ran this as a container, created a connection to my runpod serverless endpoint and generated images sucessfully, including testing the connection and generating a test image and using it in GM mode as illustrator. This leverages mostly the normal comfyui features so changes are quite tight and limited in scope.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - unsure if this is worthy of a changelog entry.
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

New state when creating:

image

And testing:

image

🔄 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/886 **Author:** [@AndyGJ](https://github.com/AndyGJ) **Created:** 5/15/2026 **Status:** ✅ Merged **Merged:** 5/17/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `pr-ready-runpod` --- ### 📝 Commits (1) - [`78ff5b0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/78ff5b056d8b2a90fe4b6b901cc69e14f503f7ad) feat: add RunPod Serverless ComfyUI image generation support ### 📊 Changes **11 files changed** (+613 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+41 -3) 📝 `packages/server/src/db/migrate.ts` (+5 -0) 📝 `packages/server/src/db/schema/connections.ts` (+2 -0) 📝 `packages/server/src/routes/connections.routes.ts` (+9 -0) 📝 `packages/server/src/services/image/image-generation.ts` (+14 -0) ➕ `packages/server/src/services/image/runpod-comfyui.service.ts` (+270 -0) 📝 `packages/server/src/services/storage/connections.storage.ts` (+5 -0) ➕ `packages/server/test/runpod-comfyui.test.ts` (+255 -0) 📝 `packages/shared/src/constants/model-lists.ts` (+9 -0) 📝 `packages/shared/src/schemas/connection.schema.ts` (+1 -0) 📝 `packages/shared/src/types/connection.ts` (+2 -0) </details> ### 📄 Description ## Linked issue Closes #885 https://github.com/Pasta-Devs/Marinara-Engine/issues/885 - Integration of Runpod Serverless endpoint option for image gen. ## Why this change This allows the creation of image gen connections targetting [runpod ](https://www.runpod.io/) [serverless](https://www.runpod.io/product/serverless) endpoints through the normal connection creation. - ## What changed 9 files · 607 additions · 3 deletions ### New provider - RunPod Serverless ComfyUI - Added runpod_comfyui to IMAGE_GENERATION_SOURCES, EXPLICIT_IMAGE_SOURCES, and inferImageSource() — registers RunPod Serverless ComfyUI as a first-class image generation backend - New handler (packages/server/src/services/image/runpod-comfyui.service.ts) communicates with RunPod's async job API (POST /run → poll /status/{id} → extract base64 from output.images[0].data). Substitutes %prompt%, %seed%, %width%, %height% placeholders before sending the workflow JSON ### New DB column -image_endpoint_id - Added to the api_connections schema, migration, and shared APIConnection type — a dedicated field for endpoint-based image services so users don't need to repurpose the model field ### UI - Connection editor - New Endpoint ID text field when RunPod is selected in the image source dropdown - ComfyUI workflow JSON textarea now visible for RunPod connections (labelled "Required") - Amber config hint explaining the setup ### Route fix - /test endpoint - RunPod connections return a friendly message directing users to "Test Image" instead of hitting /models and getting a 404 ### Tests - 8 new unit tests - Mock HTTP server tests covering: successful generation (first-poll and multi-poll), failed/cancelled jobs, auth errors, missing workflow, invalid JSON, and empty output handling ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Have ran this as a container, created a connection to my runpod serverless endpoint and generated images sucessfully, including testing the connection and generating a test image and using it in GM mode as illustrator. This leverages mostly the normal comfyui features so changes are quite tight and limited in scope. - ## Docs and release impact - [X] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - unsure if this is worthy of a changelog entry. - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) New state when creating: <img width="766" height="1056" alt="image" src="https://github.com/user-attachments/assets/403e2576-8073-416d-9269-aba645b92ec5" /> And testing: <img width="776" height="1047" alt="image" src="https://github.com/user-attachments/assets/f5112b5b-d550-4411-852b-93ba08ad8908" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:55 +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#4820
No description provided.