mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3225] [Feature]: Toggle for Dynamic LLM Prompt Generation in GM Mode Assets #1735
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#1735
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 @RyushoYosei on GitHub (Jul 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3225
Originally assigned to: @SpicyMarinara on GitHub.
What problem does this solve?
The current GM Mode image generation relies on rigid, hardcoded prose templates in the prompt review panel (e.g., aggressively forcing a humanoid fallback rule: "Unless the description says otherwise, do not infer an animal species...").
While this prevents wild hallucinations on cloud image APIs, it completely breaks compatibility for local text-to-image pipelines. Local diffusion checkpoints—especially fine-tunes like Illustrious or SDXL—rely heavily on dense tag weights and completely choke on conversational, negative prose structures.
Furthermore, applying a hardcoded "humanoid/person" bias template universally across GM Mode bleeds into and muddies up non-character assets like environmental backgrounds and cinematic action scenes. By trying to hardcode these limits to save minor text token overhead, the current setup ironically makes the feature work only with massive cloud LLMs, locking out local hardware setups.
Proposed solution
Add an optional settings toggle under the Illustrator / Image Generation configuration:
[ ] Enable Dynamic LLM Prompt Generation for GM Mode AssetsWhen enabled, instead of wrapping the asset context in a hardcoded prose template, the engine sends a quick, dedicated text API call to the connected LLM. The LLM is tasked with translating the active context into a highly optimized positive prompt string before passing it to the image provider.
This should apply universally across all three image generation triggers in GM Mode:
Alternatives considered
Leaving the templates as hardcoded text strings was considered, but it fundamentally breaks local image generation workflows. Because local models require specialized formatting (like raw Danbooru / e621 style tag layouts), a static conversational template cannot serve both cloud APIs and local checkpoints simultaneously.
Additional context
This infrastructure isn't a massive structural shift for the codebase—it is already proven to work seamlessly within Marinara Engine's own architecture via the "Selfie responses" mechanism in normal Chat Mode. This suggestion simply extends that flexible, on-demand pipeline to GM Mode.
Additionally, making this an optional toggle completely protects the engine's token-conservation philosophy. Users who are highly sensitive to text API credits can leave it off and use the default baked-in string. Power users running local hardware or who don't mind the minor token cost can choose to flip it on.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jul 5, 2026):
Ah, this came from the image generation initially generating all NPCs as animals for some reason? I can just remove those mentions, will be easier.
@RyushoYosei commented on GitHub (Jul 7, 2026):
Thanks for the quick text patch! However, removing the specific "animal" line only fixes the surface symptom—the core architectural issue is still present.
The main issue isn't just that specific phrase; it is the fact that the generator uses conversational prose templates for everything. Local diffusion models (like Illustrious or SDXL fine-tunes) cannot interpret natural language paragraphs efficiently, especially when they contain structured limitations. They heavily rely on dense, comma-separated Danbooru/e621-style tag weights (e.g.,
1girl, solo, portrait, masterwork, upper body).When GM Mode forces backgrounds, key moments, and portraits into a conversational text layout, the local CLIP text encoder gets completely muddy, leading to broken generation results. Cloud APIs handle prose fine, but local hardware setups choke on it.
This is why an optional settings toggle is still desperately needed. It allows the frontend to stay lightweight by default, but gives local hardware users the option to let the active LLM dynamically generate optimized tag-heavy prompts on the fly (just like the engine already successfully achieves via the
Selfie responsepipeline). Could we reopen this to consider adding that option?@SpicyMarinara commented on GitHub (Jul 7, 2026):
I addressed this issue, though? Furthermore, go to Settings -> Advanced -> Image Generation -> Style Profiles.
@RyushoYosei commented on GitHub (Jul 8, 2026):
I appreciate the pointer to the Style Profiles menu. Which , I admit, I was already using, and had already tried, as well as already tried custom editing to fix the issue. However, that doesn't actually solve the architectural issue for GM Mode assets.
The "Prompt grammar" dropdown in the Style Profiles only changes how the additive style modifiers are formatted. The actual core scene/NPC content payload generated by GM Mode is still being wrapped in a hardcoded natural language prose template before it reaches the image generator.
Selecting "Danbooru tags" there just results in a hybrid prompt:
[Rigid Conversational Prose Description] + [Style Profile Tags]Because the local CLIP/T5 text encoder hits that conversational prose paragraph first, the prompt attention gets completely muddied, causing local diffusion models (like Illustrious or SDXL) to produce broken or generic outputs.
The requested toggle isn't for formatting style profiles—it's to allow the entire active GM context to be dynamically translated into an optimized tag-weight string by the text LLM on the fly (bypassing the hardcoded prose templates entirely), exactly like the engine already successfully achieves via the
Selfie responsepipeline in normal Chat Mode.If you don't understand what I mean, I can offer to simplify the language for you.