[GH-ISSUE #1271] [Feature]: Optional agent-written image-generation prompts with model-specific formatting (e.g. NovelAI Diffusion 4.5 Full) #618

Closed
opened 2026-10-20 17:30:50 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @GetBeholder on GitHub (May 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1271

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

The image-generation prompt system builds the positive prompt by concatenating
written descriptions (for example the ${appearanceLine} in the Game NPC
Portrait) into a single string of joined prose. Some image connections/models —
such as NovelAI Diffusion 4.5 Full — expect tag-based formatting rather than
prose. Based on the reporter's observation (stated as "correct me if I'm wrong"),
this concatenated prose appears to be sent as the positive prompt, which results
in unusable images for those models.

Proposed behavior

Add an alternate, toggleable prompt-building mode. When enabled, instead of
concatenating template strings, an agent writes the positive and negative
prompts from the relevant context.

  • Provide the agent general per-connection/model prompting instructions — e.g.
    for NovelAI Diffusion 4.5 Full: a brief overview of the tagging system, prompt
    order, tag weights, and formatting.
  • Make the included context configurable: current messages/scene text, lorebook
    entries, character details, reference images, etc., to improve relevance and
    accuracy.
  • Two-stage prompt preview:
    1. the prompt that is sent to the agent writing the image-generation prompts, then
    2. the positive and negative prompts that will be sent to the image-gen
      connection/model.

Expected owner or impact area

  • App shell, navigation, startup, or providers
  • Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Refactor branch considerations

From a quick scan (pointer for triage, not from the reporter): image-gen prompt
assembly and agent execution currently appear to live in the React-free engine
(src/engine/contracts/constants/image-generation-defaults.ts,
src/engine/contracts/constants/agent-prompts.ts,
src/engine/agents-runtime/executor/agent-executor.ts), with visuals surfaced
under src/features/runtime/visuals. Suggested guardrails: keep new
prompt-strategy logic React-free in the engine rather than in feature
components; route any connection/model calls through shared API wrappers instead
of raw Tauri/remote calls; and avoid broadening Game-mode files (e.g.
GameSurface.tsx) for what is mode-neutral image-gen behavior.

Alternatives considered

Not specified by the reporter.

Additional context

Source: community forum post by AzraelRole, 6:47 PM. The reporter offered to
clarify and explicitly framed the "sent as the positive prompt" detail as an
observation to be corrected if wrong.

Template check

Please uncheck 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 @GetBeholder on GitHub (May 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1271 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? The image-generation prompt system builds the positive prompt by concatenating written descriptions (for example the `${appearanceLine}` in the Game NPC Portrait) into a single string of joined prose. Some image connections/models — such as NovelAI Diffusion 4.5 Full — expect tag-based formatting rather than prose. Based on the reporter's observation (stated as "correct me if I'm wrong"), this concatenated prose appears to be sent as the positive prompt, which results in unusable images for those models. ## Proposed behavior Add an alternate, toggleable prompt-building mode. When enabled, instead of concatenating template strings, an agent writes the positive and negative prompts from the relevant context. - Provide the agent general per-connection/model prompting instructions — e.g. for NovelAI Diffusion 4.5 Full: a brief overview of the tagging system, prompt order, tag weights, and formatting. - Make the included context configurable: current messages/scene text, lorebook entries, character details, reference images, etc., to improve relevance and accuracy. - Two-stage prompt preview: 1. the prompt that is sent to the agent writing the image-generation prompts, then 2. the positive and negative prompts that will be sent to the image-gen connection/model. ## Expected owner or impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Refactor branch considerations From a quick scan (pointer for triage, not from the reporter): image-gen prompt assembly and agent execution currently appear to live in the React-free engine (`src/engine/contracts/constants/image-generation-defaults.ts`, `src/engine/contracts/constants/agent-prompts.ts`, `src/engine/agents-runtime/executor/agent-executor.ts`), with visuals surfaced under `src/features/runtime/visuals`. Suggested guardrails: keep new prompt-strategy logic React-free in the engine rather than in feature components; route any connection/model calls through shared API wrappers instead of raw Tauri/remote calls; and avoid broadening Game-mode files (e.g. `GameSurface.tsx`) for what is mode-neutral image-gen behavior. ## Alternatives considered Not specified by the reporter. ## Additional context Source: community forum post by AzraelRole, 6:47 PM. The reporter offered to clarify and explicitly framed the "sent as the positive prompt" detail as an observation to be corrected if wrong. ## Template check Please uncheck 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.
Author
Owner

@cha1latte commented on GitHub (May 26, 2026):

Triage note: labeling this as scope-risk because model-specific image prompt formatting is aligned with image generation, but agent-authored prompts, configurable context, per-connection instructions, negative prompts, and two-stage preview span engine prompt strategy plus UI.

The least risky next step is to decide a narrow prompt-strategy contract first, then build one model/connection-focused slice before expanding the context controls.

<!-- gh-comment-id:4547265531 --> @cha1latte commented on GitHub (May 26, 2026): Triage note: labeling this as `scope-risk` because model-specific image prompt formatting is aligned with image generation, but agent-authored prompts, configurable context, per-connection instructions, negative prompts, and two-stage preview span engine prompt strategy plus UI. The least risky next step is to decide a narrow prompt-strategy contract first, then build one model/connection-focused slice before expanding the context controls.
Author
Owner

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

So basically a setting that we can tick on/off whether we want to include appearances from cards and whether we would like to prompt the model with tags or proper descriptions. Let's add it in Settings.

<!-- gh-comment-id:4555988043 --> @SpicyMarinara commented on GitHub (May 27, 2026): So basically a setting that we can tick on/off whether we want to include appearances from cards and whether we would like to prompt the model with tags or proper descriptions. Let's add it in Settings.
Author
Owner

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

Implemented on refactor in 981971c1 and 750d5302: Settings now exposes image prompt controls for including card appearances and choosing descriptive vs tag-style prompts; those settings are wired into selfie prompts and Game asset prompts. Validation: pnpm check, pnpm lint, and the targeted scene-service vitest run.

<!-- gh-comment-id:4556350275 --> @SpicyMarinara commented on GitHub (May 27, 2026): Implemented on refactor in 981971c1 and 750d5302: Settings now exposes image prompt controls for including card appearances and choosing descriptive vs tag-style prompts; those settings are wired into selfie prompts and Game asset prompts. Validation: pnpm check, pnpm lint, and the targeted scene-service vitest run.
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#618
No description provided.