emojigen-nano-banana
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEmojiGen Nano Banana
EmojiGen Nano Banana
Use this skill to reproduce the EmojiGen Pro workflow as a reusable agent workflow instead of a browser app.
Read this skill end to end before you start work. Do not jump straight to writing a config, building a prompt, or calling a model until you have read the SOP and decided how you will satisfy every step.
使用本技能可将EmojiGen Pro工作流复刻为可复用的Agent工作流,无需依赖浏览器应用。
开始操作前请通读本技能说明,在阅读完标准操作流程(SOP)并确认你能完成每一步要求之前,不要直接编写配置、构建提示词或调用模型。
What to collect before doing work
工作前需要收集的信息
Do not start generation until you have either explicit answers or safe defaults for:
- Reference image path.
- Output mode: or
animated.static - Emotion list, or a category prompt that can be expanded into emotions.
- Style target, such as ,
皮克斯 3D,吉卜力.Q版 LINE - Optional custom text and color.
- Output directory.
- Backend choice:
- Gemini Developer API via ,
GEMINI_API_KEY, orGOOGLE_API_KEYAPI_KEY - Vertex AI via plus
GOOGLE_GENAI_USE_VERTEXAI=trueandGOOGLE_CLOUD_PROJECTGOOGLE_CLOUD_LOCATION - Another image tool chosen by the agent when Gemini access is unavailable
- Gemini Developer API via
Before generation, inspect the current reference image and rewrite for this exact subject. Never reuse stale , , or style notes from a previous run on a different person.
characterNotescharacterNotespropNotesIf the user is adapting the original EmojiGen Pro repository, first reconstruct the workflow from the codebase before you rewrite anything. Preserve the original sequence:
- Collect or generate emotion labels.
- Assemble one long prompt for a strict 4x6 sticker sheet.
- Generate the sheet image from the reference image.
- Slice the sheet into frames or stickers.
- Encode GIFs for animated mode.
在确认以下信息的明确答案或安全默认值之前,不要启动生成流程:
- 参考图像路径。
- 输出模式:(动态)或
animated(静态)。static - 情绪列表,或可扩展为情绪的分类提示词。
- 风格目标,例如 、
皮克斯 3D、吉卜力。Q版 LINE - 可选的自定义文本和颜色。
- 输出目录。
- 后端选择:
- 通过、
GEMINI_API_KEY或GOOGLE_API_KEY调用Gemini开发者APIAPI_KEY - 配置、
GOOGLE_GENAI_USE_VERTEXAI=true和GOOGLE_CLOUD_PROJECT调用Vertex AIGOOGLE_CLOUD_LOCATION - 无法访问Gemini时,由Agent选择其他图像工具
- 通过
生成前,请检查当前参考图像,为当前对象重写。切勿复用之前针对其他对象生成的过时、或风格说明。
characterNotescharacterNotespropNotes如果用户需要适配原版EmojiGen Pro仓库,在重写任何内容前,请先从代码库中还原原有工作流,保留原始执行顺序:
- 收集或生成情绪标签。
- 为严格的4x6贴纸表组装完整长提示词。
- 基于参考图像生成贴纸表图像。
- 将贴纸表切割为单帧或单张贴纸。
- 动态模式下编码为GIF。
Default decisions
默认配置规则
- Only use these image models:
- ->
Nano Banana Progemini-3-pro-image-preview - ->
Nano Banana 2gemini-3.1-flash-image-preview
- Default to unless the user explicitly asks for
Nano Banana Pro.Nano Banana 2 - Default style:
皮克斯 3D - Default :
removeBackgroundfalse - Random emotions should be generated by the agent locally by default. Do not depend on a Gemini text model unless the user explicitly wants model-generated wording.
- Keep count constraints hard:
- static mode always resolves to exactly stickers
24 - animated mode only allows ,
1, or2GIFs4
- static mode always resolves to exactly
- Force image generation settings to:
- aspect ratio
3:2 - image size
2K
- aspect ratio
- Keep the output contract stable even if image generation uses a fallback tool:
prompt.txtresolved-config.jsongrid.*- extracted
stickers/ manifest.json
- 仅允许使用以下图像模型:
- 对应
Nano Banana Progemini-3-pro-image-preview - 对应
Nano Banana 2gemini-3.1-flash-image-preview
- 除非用户明确要求使用,否则默认使用
Nano Banana 2。Nano Banana Pro - 默认风格:
皮克斯 3D - 默认(移除背景)配置:
removeBackgroundfalse - 默认由Agent本地生成随机情绪,除非用户明确要求由模型生成措辞,否则不要依赖Gemini文本模型。
- 严格遵守数量约束:
- 静态模式固定生成张贴纸
24 - 动态模式仅允许生成、
1或2个GIF4
- 静态模式固定生成
- 强制使用以下图像生成设置:
- 宽高比
3:2 - 图像尺寸
2K
- 宽高比
- 即使使用备用工具生成图像,也要保持输出约定稳定:
prompt.txtresolved-config.json- (网格图文件)
grid.* - 提取出的目录
stickers/ manifest.json
Working sequence
工作流程
0. Stage the source image when the path is unstable
0. 路径不稳定时暂存源图像
If the image came from the clipboard, a pasted chat image, or any source whose original path is unreliable, save it into first:
/tmpbash
node skills/emojigen-nano-banana/scripts/emojigen.mjs stage-image \
--from-clipboardOr copy a known file into so later steps use a stable path:
/tmpbash
node skills/emojigen-nano-banana/scripts/emojigen.mjs stage-image \
--input /abs/path/to/source.pngUse the staged path for all later steps.
如果图像来自剪贴板、聊天粘贴的图片,或其他原始路径不可靠的来源,请先保存到目录:
/tmpbash
node skills/emojigen-nano-banana/scripts/emojigen.mjs stage-image \
--from-clipboard或者将已知文件复制到,确保后续步骤使用稳定路径:
/tmpbash
node skills/emojigen-nano-banana/scripts/emojigen.mjs stage-image \
--input /abs/path/to/source.png后续所有步骤都使用暂存后的路径。
1. Prepare config
1. 准备配置
Start from . Fill only the fields needed for the current task.
assets/example-config.jsonIf the user did not give an emotion list, leave empty and provide .
emotionscategoryPromptThen:
- infer a category prompt from the request and let the agent produce the random emotions directly, or
- only if the user explicitly wants model-generated wording, run:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs suggest-emotions \
--category "职场打工人, 加班, 摸鱼, 收到, 崩溃, 阴阳怪气" \
--count 4基于启动配置,仅填写当前任务需要的字段。
assets/example-config.json如果用户没有提供情绪列表,将留空,填入即可。
emotionscategoryPrompt接下来:
- 从用户请求中推断分类提示词,由Agent直接生成随机情绪,或者
- 仅当用户明确要求模型生成措辞时,执行:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs suggest-emotions \
--category "职场打工人, 加班, 摸鱼, 收到, 崩溃, 阴阳怪气" \
--count 42. Run preflight before generation
2. 生成前执行预检
Preflight checks the backend, confirms the staged reference path, and resolves missing random emotions without starting image generation:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs preflight \
--config path/to/config.json \
--reference /tmp/emojigen-input-123.png预检会检查后端配置、确认暂存的参考路径、补全缺失的随机情绪,不会启动图像生成:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs preflight \
--config path/to/config.json \
--reference /tmp/emojigen-input-123.png3. Build the prompt
3. 构建提示词
Always build the prompt through the script so the wording stays consistent:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs build-prompt \
--config path/to/config.json \
--out path/to/output/prompt.txtDo not stop here. is not the delivery workflow.
build-prompt始终通过脚本构建提示词,保证措辞一致性:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs build-prompt \
--config path/to/config.json \
--out path/to/output/prompt.txt不要在这一步停止,不是交付工作流的终点。
build-prompt4. Generate the 4x6 grid
4. 生成4x6网格图
If Gemini or Vertex AI is available, prefer the built-in generator:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs generate-grid \
--config path/to/config.json \
--reference path/to/reference.png \
--out path/to/output/grid.pngThe script rejects image models outside and , and always sends + .
Nano Banana ProNano Banana 23:22KDo not take and call a raw image model yourself when the built-in workflow is available. That bypasses the skill's staging, preflight, slicing, background-removal, and quality gates.
prompt.txtIf another image tool is a better fit, still use this skill. Build the prompt with this skill, generate the grid elsewhere, then continue with .
make-assets如果可以使用Gemini或Vertex AI,优先使用内置生成器:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs generate-grid \
--config path/to/config.json \
--reference path/to/reference.png \
--out path/to/output/grid.png脚本会拒绝和之外的图像模型,且始终传递宽高比和尺寸参数。
Nano Banana ProNano Banana 23:22K内置工作流可用时,不要自行读取调用原生图像模型,这会绕过本技能的暂存、预检、切割、背景移除和质量校验环节。
prompt.txt如果其他图像工具更适配需求,仍然可以使用本技能:先用本技能构建提示词,在其他工具生成网格图后,继续执行步骤即可。
make-assets5. Produce GIFs or static stickers
5. 生成GIF或静态贴纸
If you already have a grid image, run:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs make-assets \
--config path/to/config.json \
--grid path/to/output/grid.png \
--out-dir path/to/outputThis creates square crops, optional background removal, and GIF outputs for animated mode.
Keep by default. Only enable background removal when the user explicitly wants transparent stickers and the generated sheet clearly uses a flat, separable background.
removeBackground: falseRead after or . If is , do not deliver the result yet. Rerun with stricter , stronger square-safe composition constraints, or .
manifest.jsonmake-assetsrunmanifest.quality.statuswarncharacterNotesremoveBackground: falseBackground removal uses a corner-connected flood-fill strategy. This is safer than making every near-background color transparent, and avoids punching holes in faces or clothing when skin tones are similar to the background.
Treat square-safe composition as a hard requirement, not a style preference. The final assets are cropped to square cells, so the subject must stay centered and stable across frames or the GIF will jitter after slicing.
如果已经有网格图,执行:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs make-assets \
--config path/to/config.json \
--grid path/to/output/grid.png \
--out-dir path/to/output该命令会生成正方形裁切图、可选的背景移除处理,以及动态模式下的GIF输出。
默认保持,仅当用户明确要求透明贴纸,且生成的贴纸表使用了平坦、可分离的背景时,才启用背景移除。
removeBackground: false执行或后请读取,如果为,暂不要交付结果,使用更严格的、更强的正方形安全构图约束,或设置重新运行。
make-assetsrunmanifest.jsonmanifest.quality.statuswarncharacterNotesremoveBackground: false背景移除采用角落连通的漫水填充策略,比将所有接近背景的颜色设为透明更安全,可避免当肤色与背景接近时,在面部或衣物上产生透明孔洞。
正方形安全构图是硬性要求,不是风格偏好:最终资源会被裁切为正方形单元格,主体必须在各帧中保持居中稳定,否则切割后GIF会产生抖动。
6. Full end-to-end run
6. 完整端到端运行
When no step needs manual intervention, use the orchestration command:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs run \
--config path/to/config.json \
--reference path/to/reference.png \
--out-dir /tmp/emojigen-run \
--deliver-dir path/to/workspace-output \
--cleanup-tempUse to copy the finished assets into the working directory or a client delivery folder.
--deliver-dirUse after delivery when the outputs were generated under . macOS may eventually clear , but not immediately enough for agent workflows.
--cleanup-temp/tmp/emojigen-*/tmpTreat this as the preferred path. The default expectation is:
stage-imagepreflightrun- inspect
manifest.quality - deliver only if quality is acceptable
Do not skip any of these steps unless the user explicitly narrows the task and you can still preserve output quality.
如果所有步骤都不需要人工干预,使用编排命令:
bash
node skills/emojigen-nano-banana/scripts/emojigen.mjs run \
--config path/to/config.json \
--reference path/to/reference.png \
--out-dir /tmp/emojigen-run \
--deliver-dir path/to/workspace-output \
--cleanup-temp使用将完成的资源复制到工作目录或客户交付文件夹。
--deliver-dir交付后如果输出生成在目录下,使用清理临时文件。macOS最终会自动清空,但对于Agent工作流来说清理不够及时。
/tmp/emojigen-*--cleanup-temp/tmp推荐优先使用该路径,默认执行顺序为:
- (暂存图像)
stage-image - (预检)
preflight - (运行全流程)
run - 检查(质量校验)
manifest.quality - 质量合格才交付
除非用户明确缩小了任务范围且你能保证输出质量,否则不要跳过任何步骤。
Fallback rules
回退规则
- If no Gemini credentials are present, say that explicitly and either ask for credentials or use another image-capable tool.
- If another tool generated the grid, say that the final GIF packaging still came from this skill.
- If background removal damages line art or text, rerun with and keep the pure solid background from prompt-time constraints.
removeBackground: false - Do not proactively enable background removal just because the script supports it.
- If the input image arrived as a pasted or clipboard image, stage it to before any prompt or generation step.
/tmp - If the user only asked for random emotions, do not call a text model by default. Generate them directly unless the user explicitly wants a model to brainstorm them.
- 如果没有Gemini凭证,明确告知用户,可索要凭证或使用其他支持图像生成的工具。
- 如果网格图由其他工具生成,说明最终GIF打包仍由本技能完成。
- 如果背景移除损坏了线稿或文本,设置重新运行,保留提示词约束生成的纯色背景。
removeBackground: false - 不要仅因为脚本支持背景移除就主动启用该功能。
- 如果输入图像是粘贴或来自剪贴板的图像,在任何提示词构建或生成步骤前,先将其暂存到目录。
/tmp - 如果用户仅要求生成随机情绪,默认不要调用文本模型,直接生成即可,除非用户明确要求由模型 brainstorm 情绪。
References
参考资料
- Read for CLI usage, environment variable precedence, and output layout.
references/workflow.md - Read when choosing between Gemini API and Vertex AI.
references/model-backends.md
- 阅读了解CLI用法、环境变量优先级和输出目录结构。
references/workflow.md - 选择Gemini API和Vertex AI时,阅读。
references/model-backends.md