[GH-ISSUE #329] [Feature]: User editable image gen prompts #141

Closed
opened 2026-10-20 17:25:34 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @RaynoldVanHeyningen on GitHub (Apr 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/329

What problem does this solve?

The image gen prompts in ME are hardcoded strings in route handlers and asset gen services. There is no way to tune them without forking the source.

For example the multi-cell sprite sheet prompt uses most of its budget to grid bookkeeping and uses a hardcoded "solid white studio background", obviously this is done for background removal, but also background removal can use some upgrades (which i'll open a issue for later). The 'solid .. ' line unfortunately steers many local models towards a more flat, low-contrast aesthetic.

The prompt has no field where users can inject style/quality keywords, the only thing the user can influence is the characters 'appearance' field, which is already crowded with physical keywords.

Proposed solution

A small server side 'prompt overrides' that allows users to supply templates that replace registered prompt builders, with default behaviour unchanges. Effectively exposing these prompts to the client.

  • A new 'prompt_overrides' table, one row per registered key.
  • The registery where each entry declares it key, and the variables it interpolates, a default builder and example context for previews.
  • The same '${name}' emplating engine
  • A loadprompt helper that returns the users rendered template if present and enabled, otherwise returns the ME default. Also falls back to defaults on any error.
  • A new '/api/prompt-overrides' crud route, plus '/default' and '/preview'

Focused on all 8 flat image generation prompts:

  • expression sheet
  • single portrait
  • single full body
  • full body sheet
  • game npc portrait
  • game background
  • game scene illustration
  • conversation selfie

Conditional logic stays in typescript.

No UI in this scope, the API is consumable from any client (curl, a script extension or potentially a future built-in editor)

Alternatives considered

  1. Extending existing presets or agents: Presets focus on conversation/roleplay. Its not built for short single-purpose prompts. Agents are LLM agents with their own runtime, image generation prompts are not agent prompts, they are string builders called from routes
  2. Userscript / extension only: The existion extension system can already inject UI and call API endpoints, but there is no override API to call. The server has to find user supplied templates somewhere.

Additional context

I aleady have a reference implementation on my fork, and a seperate branch for a userscript extension example (this one still requires some work).

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @RaynoldVanHeyningen on GitHub (Apr 30, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/329 ## What problem does this solve? The image gen prompts in ME are hardcoded strings in route handlers and asset gen services. There is no way to tune them without forking the source. For example the multi-cell sprite sheet prompt uses most of its budget to grid bookkeeping and uses a hardcoded "solid white studio background", obviously this is done for background removal, but also background removal can use some upgrades (which i'll open a issue for later). The 'solid .. ' line unfortunately steers many local models towards a more flat, low-contrast aesthetic. The prompt has no field where users can inject style/quality keywords, the only thing the user can influence is the characters 'appearance' field, which is already crowded with physical keywords. ## Proposed solution A small server side 'prompt overrides' that allows users to supply templates that replace registered prompt builders, with default behaviour unchanges. Effectively exposing these prompts to the client. - A new 'prompt_overrides' table, one row per registered key. - The registery where each entry declares it key, and the variables it interpolates, a default builder and example context for previews. - The same '${name}' emplating engine - A loadprompt helper that returns the users rendered template if present and enabled, otherwise returns the ME default. Also falls back to defaults on any error. - A new '/api/prompt-overrides' crud route, plus '/default' and '/preview' Focused on all 8 flat image generation prompts: - expression sheet - single portrait - single full body - full body sheet - game npc portrait - game background - game scene illustration - conversation selfie Conditional logic stays in typescript. No UI in this scope, the API is consumable from any client (curl, a script extension or potentially a future built-in editor) ## Alternatives considered 1. Extending existing presets or agents: Presets focus on conversation/roleplay. Its not built for short single-purpose prompts. Agents are LLM agents with their own runtime, image generation prompts are not agent prompts, they are string builders called from routes 2. Userscript / extension only: The existion extension system can already inject UI and call API endpoints, but there is no override API to call. The server has to find user supplied templates somewhere. ## Additional context I aleady have a reference implementation on my fork, and a seperate branch for a userscript extension example (this one still requires some work). ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:25:34 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (May 3, 2026):

Thank you for the PR, merging it!

<!-- gh-comment-id:4366342220 --> @SpicyMarinara commented on GitHub (May 3, 2026): Thank you for the PR, merging it!
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#141
No description provided.