mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #8422] [Issue]: Grok images without a reference picture arrive as a doubled data URL and break #8352
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8352
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SpicyMarinara on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8422
Originally assigned to: @SpicyMarinara on GitHub.
Summary
A Grok (xAI) image with no reference picture fails or comes out broken, although xAI generates it and bills for it. xAI's generations endpoint fills
b64_jsonwith a whole data URL (data:image/jpeg;base64,…).generateXAIpasses it on unchanged as the base64 of a PNG, so callers builddata:image/png;base64,data:image/jpeg;base64,…and decode garbage bytes.Expected behavior
The image arrives as the JPEG xAI returned, with the right type.
Actual behavior
The decoded bytes are not an image. In Otome Hearth, every archetype love interest's look (painted with no reference picture) failed on every Grok connection, while card characters, which send their avatar and so use xAI's edits endpoint (answered with a URL), painted fine. xAI's own request log shows each image generated (
numInputImages: 0,mimeType: image/jpeg).The same path serves the Engine's own avatar generation with no reference, and any package painting someone with no avatar on Grok.
Steps to reproduce
grok-imagine-image-2.0).Environment
a3f34f0d9)Logs, screenshots, or video
xAI request log (ids removed):
"response": { "images": [{ "base64": "data:image/jpeg;base64,/9j/4AAQ…", "mimeType": "image/jpeg" }] }.packages/server/src/services/image/image-generation.ts,generateXAI:if (result?.b64_json) return { base64: result.b64_json, mimeType: "image/png", ext: "png" };Additional context
NanoGPT's reader already decodes a data URL in
b64_json(decodeImageDataUrl). The shared OpenAI-compatible reader and Together AI also label everyb64_jsonPNG. Otome Hearth carries a package-side shim until this is fixed (Pasta-Devs/Marinara-Agents#1844).Template check