engine/ provides a standalone command-line comic generation engine that does not require Chrome.
It accepts:
- an input file (
.htmlor.txt) - a YAML configuration file (providers, models, generation and output settings)
It produces:
- a single PNG comic sheet (similar to extension download flow)
node engine/cli/comic-engine-cli.js --input <path> --config <path> --output <path> [options]
node engine/cli/comic-engine-cli.js --url <https://...> --config <path> --output <path> [options]Equivalent npm command:
npm run engine:comicify -- --input <path> --config <path> --output <path>-i, --input <path>: input file path (.html,.htm,.txt)-c, --config <path>: YAML config file-o, --output <path>: output PNG path--url <https://...>: fetch URL via Playwright and save HTML snapshot before generation--snapshot-path <path>: explicit snapshot HTML path (otherwise auto-generated near output PNG)--fetch-timeout-ms <ms>: Playwright page load timeout (default45000)--title <value>: override generated storyboard title--debug-dir <dir>: save raw storyboard/debug artifacts (storyboard.raw.txt,storyboard.json,result.json)-h, --help: print usage-v, --version: print CLI version
The engine loads .env.e2e.local and .env.local from repo root (if present).
Supported keys:
GEMINI_API_KEYOPENAI_API_KEYOPENROUTER_API_KEYHUGGINGFACE_INFERENCE_API_TOKEN(orHUGGINGFACE_API_KEY)CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_API_TOKEN
Example structure:
input:
format: auto # auto|html|text
max_chars: 14000
strip_selectors:
- script
- style
- nav
- footer
generation:
panel_count: 3
objective: summarize
output_language: en
detail_level: low
style_prompt: "clean comic panel art, consistent characters"
providers:
text:
provider: gemini # gemini|openai|openrouter|cloudflare|huggingface
model: gemini-2.5-flash
api_key_env: GEMINI_API_KEY
image:
provider: gemini
model: gemini-2.0-flash-exp-image-generation
api_key_env: GEMINI_API_KEY
runtime:
timeout_ms: 120000
image_concurrency: 3
retries: 1
output:
width: 1400
panel_height: 700
caption_height: 120
header_height: 120
footer_height: 34
padding: 24
gap: 16
background: "#f8fafc"
brand: "Made with Web2Comics Engine"engine/examples/config.gemini.ymlengine/examples/config.openai.yml
Gemini:
npm run engine:comicify -- --input engine/examples/sample-story.txt --config engine/examples/config.gemini.yml --output engine/out/gemini-comic.png --debug-dir engine/out/gemini-debugOpenAI:
npm run engine:comicify -- --input engine/examples/sample-story.txt --config engine/examples/config.openai.yml --output engine/out/openai-comic.png --debug-dir engine/out/openai-debugSaved HTML:
npm run engine:comicify -- --input path/to/page.html --config engine/examples/config.gemini.yml --output engine/out/page-comic.pngLive URL (snapshot + original flow):
npm run engine:comicify -- --url https://en.wikipedia.org/wiki/Comics --config engine/examples/config.gemini.yml --output engine/out/wiki-comic.png --debug-dir engine/out/wiki-debug- Increase
runtime.image_concurrencyfor faster multi-panel image generation. - Use lower
panel_countfor lower latency. - Keep
input.max_charsfocused to reduce storyboard latency.
npm run test:engine