[PR #1976] [MERGED] feat(image): add image style profiles and prompt compiler #5368

Closed
opened 2026-10-22 04:15:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1976
Author: @bignast
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/7/2026
Merged by: @SpicyMarinara

Base: staging ← Head: staging


📝 Commits (6)

  • cdec650 feat(image): add image style profiles and prompt compiler
  • 4ae2075 feat(image): enhance image prompt compilation with style profiles and negative prompt handling
  • ec6805e feat(image): implement token estimation and avoid instruction handling in prompt compilation
  • fa0c1c2 feat: enhance NPC and scene context handling
  • bc3175e feat(image): add title context to scene illustration prompts and enhance prompt cleaning
  • 6997275 feat(image): enhance image style profile handling and prompt compilation

📊 Changes

34 files changed (+3029 additions, -123 deletions)

View changed files

📝 README.md (+1 -0)
➕ docs/IMAGE_GENERATION.md (+44 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+37 -0)
📝 packages/client/src/components/connections/ConnectionEditor.tsx (+51 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+30 -3)
📝 packages/client/src/components/game/game-asset-generation-payload.ts (+10 -3)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+341 -2)
📝 packages/client/src/components/ui/ImagePromptReviewModal.tsx (+20 -0)
📝 packages/client/src/hooks/use-scene-analysis.ts (+4 -0)
📝 packages/client/src/hooks/use-settings-sync.ts (+4 -1)
📝 packages/client/src/stores/ui.store.ts (+21 -2)
📝 packages/server/scripts/run-tests.mjs (+1 -0)
📝 packages/server/src/routes/characters.routes.ts (+47 -7)
📝 packages/server/src/routes/game.routes.ts (+182 -22)
📝 packages/server/src/routes/generate.routes.ts (+91 -21)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+39 -22)
📝 packages/server/src/routes/sidecar.routes.ts (+4 -0)
📝 packages/server/src/routes/sprites.routes.ts (+94 -11)
📝 packages/server/src/services/agents/agent-executor.ts (+27 -0)
📝 packages/server/src/services/game/game-asset-generation.ts (+304 -25)

...and 14 more files

📄 Description

  • Introduced new image style profiles with detailed configurations for various styles including anime, realistic, and cinematic.
  • Implemented a prompt compiler to generate image prompts based on user input and selected styles.
  • Added utility functions for normalizing and managing image style profiles.
  • Created types for image style profiles and their settings to ensure type safety across the application.
  • Established a mechanism for deduplication of prompt fragments to enhance prompt quality.

Linked issue

Closes #1974

Why this change

See bug for details

What changed

Added additional logic to generate image prompts in fashions that are more friendly for various types of models.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • [] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Ran several different image generation flows. Note that I only have a SDXL lightning model currently, so additional testing with ZIT/Flux/etc models would be prudent.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Summary by CodeRabbit

Release Notes

  • New Features

    • Added image style profiles system allowing creation, customization, and management of image generation styles
    • Added negative prompt support for more control over image generation
    • Enhanced prompt review modal to allow editing of both positive and negative prompts
    • Improved game asset generation with enriched world context (location, weather, time, genre, setting)
  • Documentation

    • Added comprehensive image generation style profiles reference guide
  • Tests

    • Added image prompt compilation test suite

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1976 **Author:** [@bignast](https://github.com/bignast) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `staging` --- ### 📝 Commits (6) - [`cdec650`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cdec650f86f5dc70b3db56ff39e378ec7532f2f3) feat(image): add image style profiles and prompt compiler - [`4ae2075`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4ae20759e4772707a0ed3a6b25e1637227129763) feat(image): enhance image prompt compilation with style profiles and negative prompt handling - [`ec6805e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ec6805e04ebb1b9cf9f0c7aaf2c11f9e6e86b9db) feat(image): implement token estimation and avoid instruction handling in prompt compilation - [`fa0c1c2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fa0c1c2052cd89fd79b79b3f5c735a131f5f6032) feat: enhance NPC and scene context handling - [`bc3175e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bc3175eaca3a44c15182201f230a1523418db3bd) feat(image): add title context to scene illustration prompts and enhance prompt cleaning - [`6997275`](https://github.com/Pasta-Devs/Marinara-Engine/commit/69972750eb8516e207dc7e2ebe1e7a65df46c349) feat(image): enhance image style profile handling and prompt compilation ### 📊 Changes **34 files changed** (+3029 additions, -123 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -0) ➕ `docs/IMAGE_GENERATION.md` (+44 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+37 -0) 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+51 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+30 -3) 📝 `packages/client/src/components/game/game-asset-generation-payload.ts` (+10 -3) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+341 -2) 📝 `packages/client/src/components/ui/ImagePromptReviewModal.tsx` (+20 -0) 📝 `packages/client/src/hooks/use-scene-analysis.ts` (+4 -0) 📝 `packages/client/src/hooks/use-settings-sync.ts` (+4 -1) 📝 `packages/client/src/stores/ui.store.ts` (+21 -2) 📝 `packages/server/scripts/run-tests.mjs` (+1 -0) 📝 `packages/server/src/routes/characters.routes.ts` (+47 -7) 📝 `packages/server/src/routes/game.routes.ts` (+182 -22) 📝 `packages/server/src/routes/generate.routes.ts` (+91 -21) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+39 -22) 📝 `packages/server/src/routes/sidecar.routes.ts` (+4 -0) 📝 `packages/server/src/routes/sprites.routes.ts` (+94 -11) 📝 `packages/server/src/services/agents/agent-executor.ts` (+27 -0) 📝 `packages/server/src/services/game/game-asset-generation.ts` (+304 -25) _...and 14 more files_ </details> ### 📄 Description - Introduced new image style profiles with detailed configurations for various styles including anime, realistic, and cinematic. - Implemented a prompt compiler to generate image prompts based on user input and selected styles. - Added utility functions for normalizing and managing image style profiles. - Created types for image style profiles and their settings to ensure type safety across the application. - Established a mechanism for deduplication of prompt fragments to enhance prompt quality. <!-- Target branch: `staging`. The default base in this UI is `main` (release branch). --> <!-- Change the base to `staging` before submitting unless this is a maintainer-approved mainline change. --> <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #1974 ## Why this change See bug for details - ## What changed Added additional logic to generate image prompts in fashions that are more friendly for various types of models. - ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Ran several different image generation flows. Note that I only have a SDXL lightning model currently, so additional testing with ZIT/Flux/etc models would be prudent. - ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added image style profiles system allowing creation, customization, and management of image generation styles * Added negative prompt support for more control over image generation * Enhanced prompt review modal to allow editing of both positive and negative prompts * Improved game asset generation with enriched world context (location, weather, time, genre, setting) * **Documentation** * Added comprehensive image generation style profiles reference guide * **Tests** * Added image prompt compilation test suite <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:40 +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-Engine#5368
No description provided.