gemini-infographic
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGemini Infographic Generator
Gemini 信息图生成器
Generate professional infographic images from text descriptions using Gemini Nano Banana Pro SDK ().
@google/genai借助Gemini Nano Banana Pro SDK(),根据文本描述生成专业的信息图图片。
@google/genaiPrerequisites
前提条件
- API Key: Configured in skill file with
.envandGEMINI_API_KEY=...(if needed).HTTPS_PROXY=... - Node.js 18+: Dependencies pre-installed in .
scripts/node_modules/
- API密钥:在技能的文件中配置
.env和GEMINI_API_KEY=...(如有需要)。HTTPS_PROXY=... - Node.js 18+:依赖包已预安装在目录中。
scripts/node_modules/
Workflow
工作流程
Step 1: Understand the User's Request
步骤1:理解用户需求
Extract from the user's description:
- Topic: What the infographic is about
- Style: Preferred visual style (see styles.md)
- Orientation: landscape (default), portrait, or square
- Detail level: brief, standard, or detailed (default)
- Language: zh-CN (default), en, ja, ko, etc.
Defaults when not specified: style=, orientation=, detail=, language=.
autolandscapedetailedzh-CN从用户的描述中提取以下信息:
- 主题:信息图的核心内容
- 风格:偏好的视觉风格(详见styles.md)
- 排版方向:横版(默认)、竖版或方形
- 细节级别:简洁、标准或详细(默认)
- 语言:zh-CN(默认)、en、ja、ko等
未指定时的默认值:风格=、排版方向=、细节=、语言=。
autolandscapedetailedzh-CNStep 2: Generate the Infographic
步骤2:生成信息图
Run the generation script:
bash
node {SKILL_DIR}/scripts/generate_infographic.mjs \
--prompt "user's description here" \
--style professional \
--orientation landscape \
--detail detailed \
--language zh-CN \
--output "{WORKSPACE}/infographic/{DATE}" \
--name "descriptive_filename"Replace with the current workspace root, with today's .
{WORKSPACE}{DATE}YYYY-MM-DDParameters:
| Parameter | Values | Default |
|---|---|---|
| auto, sketchnote, kawaii, professional, scientific, anime, claymation, editorial, storyboard, bento, bricks | auto |
| landscape, portrait, square | landscape |
| brief, standard, detailed | detailed |
| zh-CN, en, ja, ko, or any language name | zh-CN |
| gemini-3-pro-image-preview, gemini-3.1-flash-image-preview | gemini-3-pro-image-preview |
| 512, 1K, 2K, 4K | 2K |
运行生成脚本:
bash
node {SKILL_DIR}/scripts/generate_infographic.mjs \
--prompt "用户描述内容" \
--style professional \
--orientation landscape \
--detail detailed \
--language zh-CN \
--output "{WORKSPACE}/infographic/{DATE}" \
--name "描述性文件名"将替换为当前工作区根目录,替换为当日的格式日期。
{WORKSPACE}{DATE}YYYY-MM-DD参数说明:
| 参数 | 可选值 | 默认值 |
|---|---|---|
| auto, sketchnote, kawaii, professional, scientific, anime, claymation, editorial, storyboard, bento, bricks | auto |
| landscape, portrait, square | landscape |
| brief, standard, detailed | detailed |
| zh-CN, en, ja, ko或任意语言名称 | zh-CN |
| gemini-3-pro-image-preview, gemini-3.1-flash-image-preview | gemini-3-pro-image-preview |
| 512, 1K, 2K, 4K | 2K |
Step 3: Verify and Report
步骤3:验证并反馈
After generation, confirm the output file exists and report its path. Re-run with modified parameters for adjustments.
生成完成后,确认输出文件是否存在,并反馈其路径。如需调整,可修改参数后重新运行脚本。
Examples
示例
User: "做一个关于全球气候变化的信息图,专业风格"
bash
node {SKILL_DIR}/scripts/generate_infographic.mjs \
--prompt "全球气候变化:温度趋势、碳排放数据、冰川融化、海平面上升" \
--style professional --detail detailed \
--output "./infographic/2026-03-17" --name "climate_change"User: "Create a cute infographic about photosynthesis"
bash
node {SKILL_DIR}/scripts/generate_infographic.mjs \
--prompt "Photosynthesis: sunlight + water + CO2 → glucose + oxygen" \
--style kawaii --detail standard --language en \
--output "./infographic/2026-03-17" --name "photosynthesis"用户请求:"做一个关于全球气候变化的信息图,专业风格"
bash
node {SKILL_DIR}/scripts/generate_infographic.mjs \
--prompt "全球气候变化:温度趋势、碳排放数据、冰川融化、海平面上升" \
--style professional --detail detailed \
--output "./infographic/2026-03-17" --name "climate_change"用户请求:"Create a cute infographic about photosynthesis"
bash
node {SKILL_DIR}/scripts/generate_infographic.mjs \
--prompt "Photosynthesis: sunlight + water + CO2 → glucose + oxygen" \
--style kawaii --detail standard --language en \
--output "./infographic/2026-03-17" --name "photosynthesis"Style & Prompt Tips
风格与提示词技巧
- Data-heavy → or
professionalscientific - Educational → or
storyboardsketchnote - Social media → +
portraitorkawaiianime - Enrich user descriptions with data points and section breakdowns before passing to script
- See styles.md and prompt_template.md for details
- 数据密集型内容 → 选择或
professional风格scientific - 教育类内容 → 选择或
storyboard风格sketchnote - 社交媒体适用 → 选择排版 +
portrait或kawaii风格anime - 在将用户描述传入脚本前,可补充数据点和板块划分信息
- 详情请参考styles.md和prompt_template.md