[GH-ISSUE #1428] [Issue]: D2 — Slurp2 identity tags do not lead the picture prompt in tag mode #725

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

Originally created by @Gunterlie on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1428

Originally assigned to: @Gunterlie on GitHub.

Summary

D2 from the identity-tag report (D1 is #1429).

In tag mode (Danbooru-style models), a Creator's identity tags (character tag, series tag) do not always lead the picture prompt. When the prompt writer already wrote them somewhere else, Slurp leaves them there, even with "Always in their pictures" (creatorImagePrefixes) set. Thanks to the reporter for a very precise trace — it made this easy to find.

Affected package

slurp2 (0.3.46, also older versions)

Expected behavior

For a tag model, when the Creator's name or "Always in their pictures" text is in the prompt but not at the start of the scene, Slurp moves it to the start (after the style profile's own tags). It is never in the prompt twice.

Actual behavior

Example (Umi): the writer produced
1girl, aged up, blue eyes, blue hair, long hair, ryuuzaki umi, magic knight rayearth, …
The prefix ryuuzaki umi, magic knight rayearth was already present, so it was skipped and the wrong order stayed.

Cause

slurpApplyImageSubject in
packages/slurp2/src/engine/packages/server/src/slp/base/media/slp-image-prompt.ts (around line 247) checks only if the text is present:

if (plain(prompt).includes(plain(who))) return prompt;

It runs after the style compiler (slp-images-service.ts, around line 627, on the body that slurpSplitStyleLead cut off), so the compiler's dedupe does not matter here.

Suggested fix (small, one function)

In slurpApplyImageSubject, only for family !== "natural":

  1. If the name/prefix is already at the start of the prompt (compared with plain()), return the prompt unchanged.
  2. If it is present somewhere else, remove that copy and put it at the start: ${who.toLocaleLowerCase()}, ${rest}. Clean up the comma/space left where it was.
  3. The match must still work for tag spellings the current check accepts: ryuuzaki_umi, souryuu asuka langley \(evangelion\), extra spaces, upper case.
  4. Natural-language prompts (family === "natural") keep today's behavior. Do not move words inside sentences.

Keep it simple: no new settings, no new files.

Test

Add cases to the existing tests/slurp2-image-subject.regression.ts:

  • "1girl, blue hair, ryuuzaki umi, magic knight rayearth, park" with prefix "ryuuzaki umi, magic knight rayearth" (tag family) → "ryuuzaki umi, magic knight rayearth, 1girl, blue hair, park"
  • Already leading → unchanged.
  • Underscore/escaped spelling in the prompt → moved, not duplicated.
  • Natural family → unchanged from today.

Run it: npx tsx --tsconfig tests/tsconfig.regressions.json tests/slurp2-image-subject.regression.ts
Then the full Slurp set: npm run test:noodle:regressions

Release checklist (for the PR)

  • Branch from staging, PR targets staging, link this issue.
  • Patch bump only: 0.3.46 → next patch in scripts/build-feature-packages.mjs (the slurp2 entry) and SLURP2_VERSION in packages/slurp2/src/engine/packages/client/src/slp/features/onboarding/slp-release.ts. The build fails if they differ.
  • Rebuild the package with the build script (set MARINARA_ENGINE_ROOT to a Marinara-Engine checkout). Do not hand-edit client.js, server.mjs, the zip, catalogs or hashes — they are generated.
  • npm run check and the baseline commands in AGENTS.md.
  • Leave the PR's test-plan checkboxes unticked; a maintainer ticks them.

Not in this issue (follow-ups, ask first)

  • D1, companions in insert/both mode: separate issue #1429. Do this one (D2) first.
  • A general "re-insert missing identity tags" safety net: not needed for now — "Always in their pictures" already adds missing tags, and this fix handles the order.

Tip for the reporter

The report shows creatorImageNames off for all Creators. That switch ("The image model knows this character") puts the card name at the start of the picture prompt by itself. With "Always in their pictures" set, it is not needed, but it explains why Tina's name could go missing before.

Environment

  • Marinara Engine: staging f2e5fb9a4291 (2.5.0)
  • Package version: slurp2 0.3.46
Originally created by @Gunterlie on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1428 Originally assigned to: @Gunterlie on GitHub. ## Summary **D2** from the identity-tag report (D1 is #1429). In tag mode (Danbooru-style models), a Creator's identity tags (`character tag, series tag`) do not always lead the picture prompt. When the prompt writer already wrote them somewhere else, Slurp leaves them there, even with "Always in their pictures" (`creatorImagePrefixes`) set. Thanks to the reporter for a very precise trace — it made this easy to find. ## Affected package `slurp2` (0.3.46, also older versions) ## Expected behavior For a tag model, when the Creator's name or "Always in their pictures" text is in the prompt but not at the start of the scene, Slurp moves it to the start (after the style profile's own tags). It is never in the prompt twice. ## Actual behavior Example (Umi): the writer produced `1girl, aged up, blue eyes, blue hair, long hair, ryuuzaki umi, magic knight rayearth, …` The prefix `ryuuzaki umi, magic knight rayearth` was already present, so it was skipped and the wrong order stayed. ## Cause `slurpApplyImageSubject` in `packages/slurp2/src/engine/packages/server/src/slp/base/media/slp-image-prompt.ts` (around line 247) checks only *if* the text is present: ```ts if (plain(prompt).includes(plain(who))) return prompt; ``` It runs after the style compiler (`slp-images-service.ts`, around line 627, on the body that `slurpSplitStyleLead` cut off), so the compiler's dedupe does not matter here. ## Suggested fix (small, one function) In `slurpApplyImageSubject`, only for `family !== "natural"`: 1. If the name/prefix is already at the start of the prompt (compared with `plain()`), return the prompt unchanged. 2. If it is present somewhere else, remove that copy and put it at the start: `${who.toLocaleLowerCase()}, ${rest}`. Clean up the comma/space left where it was. 3. The match must still work for tag spellings the current check accepts: `ryuuzaki_umi`, `souryuu asuka langley \(evangelion\)`, extra spaces, upper case. 4. Natural-language prompts (`family === "natural"`) keep today's behavior. Do not move words inside sentences. Keep it simple: no new settings, no new files. ## Test Add cases to the existing `tests/slurp2-image-subject.regression.ts`: - `"1girl, blue hair, ryuuzaki umi, magic knight rayearth, park"` with prefix `"ryuuzaki umi, magic knight rayearth"` (tag family) → `"ryuuzaki umi, magic knight rayearth, 1girl, blue hair, park"` - Already leading → unchanged. - Underscore/escaped spelling in the prompt → moved, not duplicated. - Natural family → unchanged from today. Run it: `npx tsx --tsconfig tests/tsconfig.regressions.json tests/slurp2-image-subject.regression.ts` Then the full Slurp set: `npm run test:noodle:regressions` ## Release checklist (for the PR) - Branch from `staging`, PR targets `staging`, link this issue. - Patch bump only: `0.3.46` → next patch in `scripts/build-feature-packages.mjs` (the `slurp2` entry) **and** `SLURP2_VERSION` in `packages/slurp2/src/engine/packages/client/src/slp/features/onboarding/slp-release.ts`. The build fails if they differ. - Rebuild the package with the build script (set `MARINARA_ENGINE_ROOT` to a Marinara-Engine checkout). Do not hand-edit `client.js`, `server.mjs`, the zip, catalogs or hashes — they are generated. - `npm run check` and the baseline commands in `AGENTS.md`. - Leave the PR's test-plan checkboxes unticked; a maintainer ticks them. ## Not in this issue (follow-ups, ask first) - **D1, companions in insert/both mode**: separate issue #1429. Do this one (D2) first. - A general "re-insert missing identity tags" safety net: not needed for now — "Always in their pictures" already adds missing tags, and this fix handles the order. ## Tip for the reporter The report shows `creatorImageNames` off for all Creators. That switch ("The image model knows this character") puts the card name at the start of the picture prompt by itself. With "Always in their pictures" set, it is not needed, but it explains why Tina's name could go missing before. ## Environment - Marinara Engine: staging `f2e5fb9a4291` (2.5.0) - Package version: slurp2 0.3.46
bsakaguchi 2026-10-20 17:30:06 +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-Agents#725
No description provided.