From 664c7d300c4a9326e5aebbd84a20cee5af829a0b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 22 Apr 2026 09:51:43 +0300 Subject: Improve comic style generation --- cmd/comicforge/cli.go | 51 +++++++++++++++++++++++++++++++--------------- cmd/comicforge/cli_test.go | 5 ----- 2 files changed, 35 insertions(+), 21 deletions(-) (limited to 'cmd') diff --git a/cmd/comicforge/cli.go b/cmd/comicforge/cli.go index 47ec2df..168395b 100644 --- a/cmd/comicforge/cli.go +++ b/cmd/comicforge/cli.go @@ -165,6 +165,13 @@ func runCommand(ctx context.Context, cmd *cobra.Command, deps commandDeps, flags Style: flags.style, ComicStyles: cfg.Styles.Comic, RealisticStyles: cfg.Styles.Realistic, + CartoonStyles: cfg.Styles.Cartoon, + Action90sStyles: cfg.Styles.Action90s, + MangaStyles: cfg.Styles.Manga, + CyberpunkStyles: cfg.Styles.Cyberpunk, + GoldenAgeStyles: cfg.Styles.GoldenAge, + HorrorStyles: cfg.Styles.Horror, + WatercolorStyles: cfg.Styles.Watercolor, Theme: flags.theme, Language: cfg.Language.Story, Script: cfg.Language.Script, @@ -197,28 +204,40 @@ func runPromptCommand(ctx context.Context, cmd *cobra.Command, deps commandDeps, } applyConfigOverrides(cmd, cfg, flags) + textProvider, err := deps.newTextProvider(cfg) + if err != nil { + return fmt.Errorf("build text provider: %w", err) + } imageProvider, err := deps.newImageProvider(cfg) if err != nil { return fmt.Errorf("build image provider: %w", err) } runner := deps.newRunner(&comic.RunnerConfig{ - ImageProvider: imageProvider, - Prompts: cfg, - OutputDir: flags.outputDir, - Style: flags.style, - ComicStyles: cfg.Styles.Comic, - RealisticStyles: cfg.Styles.Realistic, - Theme: flags.theme, - Language: cfg.Language.Story, - Script: cfg.Language.Script, - Slug: flags.slug, - UltraRealistic: resolveUltraRealistic(flags), - RealisticWeight: cfg.Story.RealisticWeight, - AspectRatio: cfg.Comic.AspectRatio, - PromptMaxChars: cfg.Comic.PromptMaxChars, - PageMaxRetries: cfg.Comic.PageMaxRetries, - PageRetryBase: time.Duration(cfg.Comic.PageRetryBaseSeconds) * time.Second, + TextProvider: textProvider, + ImageProvider: imageProvider, + Prompts: cfg, + OutputDir: flags.outputDir, + Style: flags.style, + ComicStyles: cfg.Styles.Comic, + RealisticStyles: cfg.Styles.Realistic, + CartoonStyles: cfg.Styles.Cartoon, + Action90sStyles: cfg.Styles.Action90s, + MangaStyles: cfg.Styles.Manga, + CyberpunkStyles: cfg.Styles.Cyberpunk, + GoldenAgeStyles: cfg.Styles.GoldenAge, + HorrorStyles: cfg.Styles.Horror, + WatercolorStyles: cfg.Styles.Watercolor, + Theme: flags.theme, + Language: cfg.Language.Story, + Script: cfg.Language.Script, + Slug: flags.slug, + UltraRealistic: resolveUltraRealistic(flags), + RealisticWeight: cfg.Story.RealisticWeight, + AspectRatio: cfg.Comic.AspectRatio, + PromptMaxChars: cfg.Comic.PromptMaxChars, + PageMaxRetries: cfg.Comic.PageMaxRetries, + PageRetryBase: time.Duration(cfg.Comic.PageRetryBaseSeconds) * time.Second, }) return runner.RunPrompt(ctx, flags.prompt) diff --git a/cmd/comicforge/cli_test.go b/cmd/comicforge/cli_test.go index 54c5ea8..27dc09c 100644 --- a/cmd/comicforge/cli_test.go +++ b/cmd/comicforge/cli_test.go @@ -404,7 +404,6 @@ func TestRootCommandSkipsTTSProviderWhenNarrationDisabled(t *testing.T) { func TestRootCommandPromptModeSkipsVocabFlow(t *testing.T) { tmpDir := t.TempDir() - var textCalled bool var ttsCalled bool var gotRunnerCfg *comic.RunnerConfig runner := &recordingRunner{} @@ -414,7 +413,6 @@ func TestRootCommandPromptModeSkipsVocabFlow(t *testing.T) { return config.DefaultConfig(), nil }, newTextProvider: func(*config.Config) (provider.TextProvider, error) { - textCalled = true return noopProvider{}, nil }, newImageProvider: func(cfg *config.Config) (provider.ImageProvider, error) { @@ -445,9 +443,6 @@ func TestRootCommandPromptModeSkipsVocabFlow(t *testing.T) { if err := cmd.ExecuteContext(context.Background()); err != nil { t.Fatalf("ExecuteContext() error = %v\noutput:\n%s", err, buf.String()) } - if textCalled { - t.Fatal("newTextProvider was called, want prompt mode to skip story flow") - } if ttsCalled { t.Fatal("newTTSProvider was called, want prompt mode to skip narration setup") } -- cgit v1.2.3