From e809e691649923b87ff4c13366069e69c67d2d7b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 22 Apr 2026 00:24:27 +0300 Subject: Improve prompt variety for generated comic pages --- internal/comic/artist.go | 2 ++ internal/config/config_test.go | 2 ++ internal/image/gemini_api.go | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'internal') diff --git a/internal/comic/artist.go b/internal/comic/artist.go index a54c01a..b089769 100644 --- a/internal/comic/artist.go +++ b/internal/comic/artist.go @@ -345,6 +345,8 @@ func (a *Artist) galleryPromptData(style, bible string, galleryNum int) map[stri "ScriptName": localizedScriptName(a.script), "Style": localizedStylePrompt(style, a.language, a.script), "Bible": bible, + "GalleryNum": galleryNum, + "TotalGalleryPages": a.galleryPages, "Pose": galleryPoses[(galleryNum-1)%len(galleryPoses)], "RenderingRequirement": a.renderingRequirement(), "RenderingRequirementEnd": a.renderingRequirementEnd(), diff --git a/internal/config/config_test.go b/internal/config/config_test.go index e27906d..60152be 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -210,6 +210,8 @@ func TestEmbeddedPromptTemplatesRender(t *testing.T) { "BlurbBox": "правоъгълно текстово поле с кратък текст", "SeriesTitle": "КомиксФордж Приключения", "Pose": "extreme close-up portrait", + "GalleryNum": 1, + "TotalGalleryPages": 5, } for _, name := range []string{ diff --git a/internal/image/gemini_api.go b/internal/image/gemini_api.go index f1aa1c8..720388b 100644 --- a/internal/image/gemini_api.go +++ b/internal/image/gemini_api.go @@ -59,7 +59,9 @@ func geminiReferenceParts(prompt string, refs [][]byte) []*genai.Part { refNote := fmt.Sprintf( "The %d reference image(s) above show the exact character appearance that must be preserved. "+ - "Every character, animal, or object must look identical in the new image. Now generate:\n\n", + "Every character, animal, or object must keep the same identity, face, costume, colours, and markings. "+ + "Use the references for identity only: do not copy their scene, pose, camera angle, panel layout, lighting, action, or background. "+ + "The new image must follow the new prompt's story beat and composition. Now generate:\n\n", len(refs), ) parts = append(parts, &genai.Part{Text: refNote + prompt}) -- cgit v1.2.3