[PR #815] [MERGED] Support Grok image generation #4786

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

📋 Pull Request Information

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

Base: main ← Head: feat/issue-751-grok-image-generation


📝 Commits (1)

  • 2641eb4 Support Grok image generation

📊 Changes

2 files changed (+89 additions, -0 deletions)

View changed files

📝 packages/server/src/services/image/image-generation.ts (+75 -0)
📝 packages/shared/src/constants/model-lists.ts (+14 -0)

📄 Description

Linked issue

Closes #751

Why this change

  • Grok / xAI image generation expects aspect-ratio based image sizing, so routing it through Marinara's existing OpenAI-style image generation path sends the wrong shape for size configuration.

What changed

  • Added xAI / Grok Imagine as an explicit image generation source with default base URL and model entries.
  • Taught image source inference to detect xAI image connections from api.x.ai URLs and Grok image model names.
  • Added an xAI image generation backend that sends aspect_ratio instead of OpenAI's size field and reads either base64 or URL image responses.

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 ran pnpm --filter @marinara-engine/server lint.
  • Codex ran pnpm check.
  • Codex ran node scratch\issue-751-xai-image-request.mjs against a local stub server. The proof confirmed xAI image generation posts to /v1/images/generations with aspect_ratio, response_format: "b64_json", and no size field.
  • Manual xAI credential verification is still needed: create an image generation connection with https://api.x.ai/v1, select a Grok image model, and run the test image flow with a real xAI key.

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 - server/shared image provider support only.


🔄 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/815 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/14/2026 **Status:** ✅ Merged **Merged:** 5/14/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `main` ← **Head:** `feat/issue-751-grok-image-generation` --- ### 📝 Commits (1) - [`2641eb4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2641eb40cdcd7e486d800cdc3d84f353db209584) Support Grok image generation ### 📊 Changes **2 files changed** (+89 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/image/image-generation.ts` (+75 -0) 📝 `packages/shared/src/constants/model-lists.ts` (+14 -0) </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 #751 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Grok / xAI image generation expects aspect-ratio based image sizing, so routing it through Marinara's existing OpenAI-style image generation path sends the wrong shape for size configuration. ## What changed <!-- List the key changes in this PR --> - Added xAI / Grok Imagine as an explicit image generation source with default base URL and model entries. - Taught image source inference to detect xAI image connections from `api.x.ai` URLs and Grok image model names. - Added an xAI image generation backend that sends `aspect_ratio` instead of OpenAI's `size` field and reads either base64 or URL image responses. ## 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 ran `pnpm --filter @marinara-engine/server lint`. - Codex ran `pnpm check`. - Codex ran `node scratch\issue-751-xai-image-request.mjs` against a local stub server. The proof confirmed xAI image generation posts to `/v1/images/generations` with `aspect_ratio`, `response_format: "b64_json"`, and no `size` field. - Manual xAI credential verification is still needed: create an image generation connection with `https://api.x.ai/v1`, select a Grok image model, and run the test image flow with a real xAI key. ## 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 - server/shared image provider support only. --- <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:39 +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#4786
No description provided.