[PR #889] [MERGED] Fix ComfyUI workflow placeholder types #4822

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

📋 Pull Request Information

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

Base: staging ← Head: fix/issue-875-comfyui-numeric-workflow


📝 Commits (2)

  • 42f79c6 Fix ComfyUI workflow placeholder types
  • 3343ef0 Merge remote-tracking branch 'upstream/staging' into fix/issue-875-comfyui-numeric-workflow

📊 Changes

1 file changed (+45 additions, -27 deletions)

View changed files

📝 packages/server/src/services/image/image-generation.ts (+45 -27)

📄 Description

Linked issue

Closes #875

Why this change

  • The bundled ComfyUI workflow was sending numeric placeholders like %width%, %height%, and %seed% as JSON strings, which can crash ComfyUI nodes that expect numbers.

What changed

  • Replaced ComfyUI workflow JSON-string substitution with a type-aware recursive placeholder resolver.
  • Exact numeric placeholders now become numbers, while placeholders embedded inside larger strings still resolve as text.
  • Preserved existing optional replacements for model and reference image placeholders.

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

  • Codex reproduced the original payload bug with a stub ComfyUI /prompt endpoint. Before the fix, the captured default workflow contained "widthType": "string" and "heightType": "string".
  • Codex reran the same repro after the fix. The captured default workflow contained "widthType": "number", "heightType": "number", "seedType": "number", and "stepsType": "number".
  • Codex also tested a custom workflow edge case where exact numeric placeholders stay numeric and embedded placeholders still substitute as string content.
  • pnpm check passed locally.
  • No human-only verification is currently blocking the core claim. A real ComfyUI generation run is still useful as an integration smoke test before merge if a configured ComfyUI instance is available.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

N/A - backend ComfyUI payload serialization fix, verified with captured request payloads.


🔄 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/889 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/15/2026 **Status:** ✅ Merged **Merged:** 5/15/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `staging` ← **Head:** `fix/issue-875-comfyui-numeric-workflow` --- ### 📝 Commits (2) - [`42f79c6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/42f79c61a581d24819a3e52af4525bd2ee363344) Fix ComfyUI workflow placeholder types - [`3343ef0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3343ef02392df2e6546bf8f1682cbd9ef61afa76) Merge remote-tracking branch 'upstream/staging' into fix/issue-875-comfyui-numeric-workflow ### 📊 Changes **1 file changed** (+45 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/image/image-generation.ts` (+45 -27) </details> ### 📄 Description ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #875 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - The bundled ComfyUI workflow was sending numeric placeholders like `%width%`, `%height%`, and `%seed%` as JSON strings, which can crash ComfyUI nodes that expect numbers. ## What changed <!-- List the key changes in this PR --> - Replaced ComfyUI workflow JSON-string substitution with a type-aware recursive placeholder resolver. - Exact numeric placeholders now become numbers, while placeholders embedded inside larger strings still resolve as text. - Preserved existing optional replacements for model and reference image placeholders. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `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 <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Codex reproduced the original payload bug with a stub ComfyUI `/prompt` endpoint. Before the fix, the captured default workflow contained `"widthType": "string"` and `"heightType": "string"`. - Codex reran the same repro after the fix. The captured default workflow contained `"widthType": "number"`, `"heightType": "number"`, `"seedType": "number"`, and `"stepsType": "number"`. - Codex also tested a custom workflow edge case where exact numeric placeholders stay numeric and embedded placeholders still substitute as string content. - `pnpm check` passed locally. - No human-only verification is currently blocking the core claim. A real ComfyUI generation run is still useful as an integration smoke test before merge if a configured ComfyUI instance is available. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) N/A - backend ComfyUI payload serialization fix, verified with captured request payloads. --- <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:57 +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#4822
No description provided.