diff options
Diffstat (limited to 'internal/comic/artist.go')
| -rw-r--r-- | internal/comic/artist.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/internal/comic/artist.go b/internal/comic/artist.go index 13826ee..7ccf084 100644 --- a/internal/comic/artist.go +++ b/internal/comic/artist.go @@ -214,7 +214,11 @@ func (a *Artist) generateWithRetry(ctx context.Context, prompt, outputFile, labe } func (a *Artist) generatePromptImage(ctx context.Context, prompt, outputFile string) error { - return a.generateWithRetryAndValidation(ctx, prompt, outputFile, "manual prompt image", nil, nil) + renderedPrompt, err := a.prompts.RenderPrompt(manualPromptTemplate, a.manualPromptData(prompt)) + if err != nil { + return fmt.Errorf("render manual prompt: %w", err) + } + return a.generateWithRetryAndValidation(ctx, renderedPrompt, outputFile, "manual prompt image", nil, nil) } type imageOutputValidator func(context.Context, string, string, string) error @@ -379,6 +383,16 @@ func (a *Artist) backPromptData(storyText, style, bible, blurb string) map[strin } } +func (a *Artist) manualPromptData(prompt string) map[string]any { + return map[string]any{ + "Prompt": strings.TrimSpace(prompt), + "Style": localizedStylePrompt(a.style, a.language, a.script), + "Theme": a.theme, + "RenderingRequirement": a.renderingRequirement(), + "RenderingRequirementEnd": a.renderingRequirementEnd(), + } +} + func (a *Artist) renderingRequirement() string { if a.ultraRealistic { text, err := a.prompts.RenderPrompt(renderingRequirementPrompt, nil) |
