Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

comics-generator

从一句话主题生成四格漫画:分镜脚本 → 生图提示词 →(可选)成图。

核心逻辑在 SKILL.md(Cursor Agent Skill)。四格按起、承、转、合设计可读反转,不是四张独立插画拼贴。

快速开始

  1. 在 Cursor 中打开本仓库,加载 SKILL.md(或把 skill 装到 ~/.cursor/skills/)。
  2. 触发:
/four-panel-comic 画一幅程序员使用 AI 写代码的搞笑四格漫画
  1. 按对话完成澄清 → 确认分镜 → 确认提示词 → 选择生图方式。

Phase 1–3 不需要 API Key 或 Node.js。只有选择「本机 OpenRouter 直出」时才需要。

工作流

Phase 做什么 产出
1 需求澄清 主题、语气、风格、角色、语言 确认后进入分镜
2 分镜脚本 角色圣经 + 起承转合 output/comic-plan.md
3 生图提示 单图 2×2 提示词 output/comic-prompt.txt
4 成图 二选一(见下) output/four-panel-comic.png
5 质检 读图验收;严重缺陷改 prompt 后最多再生一次

Phase 4 生图方案

方案 1 — 复制 Prompt
output/comic-prompt.txt 贴到 ChatGPT / Gemini / Midjourney 等,建议 1:1 方图。成图保存为 output/four-panel-comic.png 后再质检。

方案 2 — OpenRouter 直出

export OPENROUTER_API_KEY="sk-or-..."

mkdir -p output
node scripts/generate-image.mjs \
  --prompt-file output/comic-prompt.txt \
  --output output/four-panel-comic.png \
  --aspect-ratio 1:1

可选模型:

node scripts/generate-image.mjs \
  --prompt-file output/comic-prompt.txt \
  --output output/four-panel-comic.png \
  --model google/gemini-3.1-flash-image-preview \
  --aspect-ratio 1:1

或:

export OPENROUTER_IMAGE_MODEL="google/gemini-3.1-flash-image-preview"

默认模型:google/gemini-3.1-flash-image-preview。需要 Node.js 20+

视觉风格

未指定时默认 modern。可选:

id 中文名 适合
modern 现代干净卡通 通用、职场/生活轻喜
guofeng 水墨国风 历史典故、古风
chibi 夸张 Q 版 强搞笑、表情包式
yonkoma 日式四格 冷幽默、日常短梗
gag 美式报纸四格 夸张肢体、对话驱动
picturebook 儿童绘本 低龄、温情
doodle 手绘涂鸦 随性吐槽
custom 自定义 用户自述风格

仓库结构

comics-generator/
├── SKILL.md                 # 四格漫画 Agent Skill(主流程)
├── scripts/
│   └── generate-image.mjs   # OpenRouter 生图脚本(可选)
├── output/                  # 当次分镜 / prompt / 成图
├── histories/               # 历史案例归档(可选)
└── README.md

说明:scripts/ 可能被 .gitignore 忽略;本地仍可保留脚本供方案 2 使用。敏感配置(如 .envrc)勿提交。

设计原则(摘要)

  • 合 > 转:第 4 格 punchline 必须比第 3 格更强、更一眼可读。
  • 单图 2×2:一张方图含完整四格,便于分享。
  • 对白宜短:单气泡通常 ≤18 个汉字;笑点靠表情/动作,不藏背景小字。
  • 角色一致:先写角色圣经,再写剧情,避免换装换发型。

完整规则、检查点与异常处理见 SKILL.md

许可与版权

本工具用于生成原创分镜与提示词。若选用「致敬某画风」的 custom 风格,请自行注意相关 IP 边界;请勿把官方角色/商标当作可商用素材。

About

generate comics based on SKILLs.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors