Community编程与开发github.com

图像生成技能

当用户请求生成、创建、想象或可视化图像(包括角色、场景、产品或任何视觉内容)时使用此技能。支持结构化提示和参考图像以进行引导式生成。

图像生成技能 是什么?

该技能通过结构化的 JSON 提示和 Python 脚本生成高质量图像。工作流程包括在 `/mnt/user-data/workspace/` 目录下创建 JSON 格式的提示文件,然后调用 `/mnt/skills/public/image-generation/scripts/generate.py` 脚本执行生成。支持通过 `--reference-images` 参数传入可选的参考图像以指导风格和构图,并通过 `--aspect-ratio` 参数控制宽高比(默认 16:9)。技能会自动根据环境变量(如 `GEMINI_API_KEY` 或 `MINIMAX_API_KEY`)选择 Gemini 或 MiniMax 提供商;MiniMax 仅使用 JSON 中的 `prompt` 字段,而 Gemini 则接收完整的结构化 JSON。建议在关键任务(如角色设计、特定产品或场景)中先使用 `image_search` 工具搜索并下载参考图像,以显著提升生成质量。生成后的图像通常保存在 `/mnt/user-data/outputs/` 目录下,可以通过 `present_files` 工具共享结果。

兼容平台~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/bytedance/deer-flow/tree/main/skills/public/image-generation

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

图像生成技能 是做什么的?

概述

此技能使用结构化提示和 Python 脚本生成高质量图像。工作流程包括创建 JSON 格式的提示,以及使用可选的参考图像执行图像生成。

核心能力

  • 为 AIGC 图像生成创建结构化的 JSON 提示
  • 支持多个参考图像以指导风格/构图
  • 通过自动化 Python 脚本执行生成图像
  • 处理各种图像生成场景(角色设计、场景、产品等)

工作流程

步骤 1: 理解需求

当用户请求图像生成时,需要识别:

  • 主题/内容:图像中应包含什么
  • 风格偏好:艺术风格、氛围、调色板
  • 技术规格:宽高比、构图、光照
  • 参考图像:用于指导生成的任何图像
  • 无需检查 /mnt/user-data 下的文件夹

步骤 2: 创建结构化提示

在 /mnt/user-data/workspace/ 中生成一个结构化的 JSON 文件,命名模式为:{描述性名称}.json

步骤 3: 执行生成

调用 Python 脚本:

python /mnt/skills/public/image-generation/scripts/generate.py \
  --prompt-file /mnt/user-data/workspace/prompt-file.json \
  --reference-images /path/to/ref1.jpg /path/to/ref2.png \
  --output-file /mnt/user-data/outputs/generated-image.jpg \
  --aspect-ratio 16:9

参数:

  • --prompt-file:JSON 提示文件的绝对路径(必需)
  • --reference-images:参考图像的绝对路径(可选,以空格分隔)
  • --output-file:输出图像文件的绝对路径(必需)
  • --aspect-ratio:生成图像的宽高比(可选,默认为 16:9)

[!NOTE] 不要阅读 python 文件,只需使用参数调用它。

角色生成示例

用户请求:“创建一个 1990 年代东京街头风格女性角色”

创建提示文件:/mnt/user-data/workspace/asian-woman.json

{
  "characters": [{
    "gender": "female",
    "age": "mid-20s",
    "ethnicity": "Japanese",
    "body_type": "slender, elegant",
    "facial_features": "delicate features, expressive eyes, subtle makeup with emphasis on lips, long dark hair partially wet from rain",
    "clothing": "stylish trench coat, designer handbag, high heels, contemporary Tokyo street fashion",
    "accessories": "minimal jewelry, statement earrings, leather handbag",
    "era": "1990s"
  }],
  "negative_prompt": "blurry face, deformed, low quality, overly sharp digital look, oversaturated colors, artificial lighting, studio setting, posed, selfie angle",
  "style": "Leica M11 street photography aesthetic, film-like rendering, natural color palette with slight warmth, bokeh background blur, analog photography feel",
  "composition": "medium shot, rule of thirds, subject slightly off-center, environmental context of Tokyo street visible, shallow depth of field isolating subject",
  "lighting": "neon lights from signs and storefronts, wet pavement reflections, soft ambient city glow, natural street lighting, rim lighting from background neons",
  "color_palette": "muted naturalistic tones, warm skin tones, cool blue and magenta neon accents, desaturated compared to digital photography, film grain texture"
}

执行生成:

python /mnt/skills/public/image-generation/scripts/generate.py \
  --prompt-file /mnt/user-data/workspace/cyberpunk-hacker.json \
  --output-file /mnt/user-data/outputs/cyberpunk-hacker-01.jpg \
  --aspect-ratio 2:3

带参考图像:

{
  "characters": [{
    "gender": "based on [Image 1]",
    "age": "based on [Image 1]",
    "ethnicity": "human from [Image 1] adapted to Star Wars universe",
    "body_type": "based on [Image 1]",
    "facial_features": "matching [Image 1] with slight weathered look from space travel",
    "clothing": "Star Wars style outfit - worn leather jacket with utility vest, cargo pants with tactical pouches, scuffed boots, belt with holster",
    "accessories": "blaster pistol on hip, comlink device on wrist, goggles pushed up on forehead, satchel with supplies, personal vehicle based on [Image 2]",
    "era": "Star Wars universe, post-Empire era"
  }],
  "prompt": "Character inspired by [Image 1] standing next to a vehicle inspired by [Image 2] on a bustling alien planet street in Star Wars universe aesthetic. Character wearing worn leather jacket with utility vest, cargo pants with tactical pouches, scuffed boots, belt with blaster holster. The vehicle adapted to Star Wars aesthetic with weathered metal panels, repulsor engines, desert dust covering, parked on the street. Exotic alien marketplace street with multi-level architecture, weathered metal structures, hanging market stalls with colorful awnings, alien species walking by as background characters. Twin suns casting warm golden light, atmospheric dust particles in air, moisture vaporators visible in distance. Gritty lived-in Star Wars aesthetic, practical effects look, film grain texture, cinematic composition.",
  "negative_prompt": "clean futuristic look, sterile environment, overly CGI appearance, fantasy medieval elements, Earth architecture, modern city",
  "style": "Star Wars original trilogy aesthetic, lived-in universe, practical effects inspired, cinematic film look, slightly desaturated with warm tones",
  "composition": "medium wide shot, character in foreground with alien street extending into background, environmental storytelling, rule of thirds",
  "lighting": "warm golden hour lighting from twin suns, rim lighting on character, atmospheric haze, practical light sources from market stalls",
  "color_palette": "warm sandy tones, ochre and sienna, dusty blues, weathered metals, muted earth colors with pops of alien market colors",
  "technical": {
    "aspect_ratio": "9:16",
    "quality": "high",
    "detail_level": "highly detailed with film-like texture"
  }
}
python /mnt/skills/public/image-generation/scripts/generate.py \
  --prompt-file /mnt/user-data/workspace/star-wars-scene.json \
  --reference-images /mnt/user-data/uploads/character-ref.jpg /mnt/user-data/uploads/vehicle-ref.jpg \
  --output-file /mnt/user-data/outputs/star-wars-scene-01.jpg \
  --aspect-ratio 16:9

常见场景

对不同场景使用不同的 JSON 模式。

角色设计:

  • 身体属性(性别、年龄、种族、体型)
  • 面部特征和表情
  • 服装和配饰
  • 历史时代或设定
  • 姿势和背景

场景生成:

  • 环境描述
  • 一天中的时间、天气
  • 氛围和情绪
  • 焦点和构图

产品可视化:

  • 产品细节和材质
  • 灯光设置
  • 背景和场景
  • 展示角度

特定模板

仅当用户请求匹配时,才读取以下模板文件。

输出处理

生成后:

  • 图像通常保存在 /mnt/user-data/outputs/ 中
  • 使用 present_files 工具与用户共享生成的图像
  • 简要描述生成结果
  • 提供迭代调整建议

提示:使用参考图像增强生成

在视觉准确性至关重要的场景中,在生成之前先使用 image_search 工具 查找参考图像。

推荐使用 image_search 工具的场景:

  • 角色/肖像生成:搜索类似的姿势、表情或风格,以指导面部特征和身体比例
  • 特定对象或产品:查找真实对象的参考图像,确保准确呈现
  • 建筑或环境场景:搜索位置参考以捕捉真实细节
  • 时尚和服装:查找风格参考以确保准确的服装细节和造型

示例工作流程:

  1. 调用 image_search 工具查找合适的参考图像:
    image_search(query="Japanese woman street photography 1990s", size="Large")
    
  2. 将返回的图像 URL 下载到本地文件
  3. 将下载的图像作为 --reference-images 参数用于生成脚本

这种方法通过为模型提供具体的视觉指导,而非仅依赖文本描述,显著提高了生成质量。

提供商(Gemini / MiniMax)

此技能通过环境变量自动选择提供商(无需修改 CLI):

  • 设置 GEMINI_API_KEY → 使用 Gemini(默认,未更改)。
  • 仅设置 MINIMAX_API_KEY → 使用 MiniMax(/v1/image_generation,模型 image-01)。
  • 通过 IMAGE_GENERATION_PROVIDER=gemini|minimax 显式强制指定一个。

MiniMax 可选覆盖:MINIMAX_API_HOST(默认 https://api.minimaxi.com), MINIMAX_IMAGE_MODEL(默认 image-01)。参考图像以 MiniMax subject_reference 角色图像的形式发送。CLI 和 --prompt-file / --reference-images / --output-file / --aspect-ratio 参数对两个提供商相同。

MiniMax 提示处理(提供商内部)。 编写内容与提供商无关——无论哪个提供商处于活动状态,都编写相同的结构化 JSON。MiniMax image-01 消耗单个文本字符串,因此 MiniMax 路径本身仅发送 JSON prompt 字段(其他字段如 style / composition / negative_prompt 适用于 Gemini 路径),并启用 prompt_optimizer,以便 MiniMax 在服务器端进行扩展。MiniMax 将该提示限制为 1500 个字符;如果 prompt 字段更长,脚本将返回错误,而不是调用 API。Gemini 路径接收完整的结构化 JSON。

注意事项

  • 无论用户使用何种语言,始终使用英文编写提示
  • JSON 格式确保结构化的、可解析的提示
  • 参考图像显著提升生成质量
  • 迭代优化对获得最佳结果是正常过程
  • 对于角色生成,包含详细角色对象以及一个整合的 prompt 字段

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

academic-paper-review

Use this skill when the user requests to review, analyze, critique, or summarize academic papers, research articles, preprints, or scientific publications. Supports comprehensive structured reviews covering methodology assessment, contribution evaluation, literature positioning, and constructive feedback generation. Trigger on queries involving paper URLs, uploaded PDFs, arXiv links, or requests like "review this paper", "analyze this research", "summarize this study", or "write a peer review".

bootstrap

Generate a personalized SOUL.md through a warm, adaptive onboarding conversation. Trigger when the user wants to create, set up, or initialize their AI partner's identity — e.g., "create my SOUL.md", "bootstrap my agent", "set up my AI partner", "define who you are", "let's do onboarding", "personalize this AI", "make you mine", or when a SOUL.md is missing. Also trigger for updates: "update my SOUL.md", "change my AI's personality", "tweak the soul".

bytedance/academic-paper-review

Use this skill when the user requests to review, analyze, critique, or summarize academic papers, research articles, preprints, or scientific publications. Supports comprehensive structured reviews covering methodology assessment, contribution evaluation, literature positioning, and constructive feedback generation. Trigger on queries involving paper URLs, uploaded PDFs, arXiv links, or requests like "review this paper", "analyze this research", "summarize this study", or "write a peer review".

bytedance/chart-visualization

This skill should be used when the user wants to visualize data. It intelligently selects the most suitable chart type from 26 available options, extracts parameters based on detailed specifications, and generates a chart image using a JavaScript script.

bytedance/claude-to-deerflow

Interact with DeerFlow AI agent platform via its HTTP API. Use this skill when the user wants to send messages or questions to DeerFlow for research/analysis, start a DeerFlow conversation thread, check DeerFlow status or health, list available models/skills/agents in DeerFlow, manage DeerFlow memory, upload files to DeerFlow threads, or delegate complex research tasks to DeerFlow. Also use when the user mentions deerflow, deer flow, or wants to run a deep research task that DeerFlow can handle.

bytedance/consulting-analysis

Use this skill when the user requests to generate, create, or write professional research reports including but not limited to market analysis, consumer insights, brand analysis, financial analysis, industry research, competitive intelligence, investment due diligence, or any consulting-grade analytical report. This skill operates in two phases — (1) generating a structured analysis framework with chapter skeleton, data query requirements, and analysis logic, and (2) after data collection by other skills, producing the final consulting-grade report with structured narratives, embedded charts, and strategic insights.

bytedance/data-analysis

Use this skill when the user uploads Excel (.xlsx/.xls) or CSV files and wants to perform data analysis, generate statistics, create summaries, pivot tables, SQL queries, or any form of structured data exploration. Supports multi-sheet Excel workbooks, aggregation, filtering, joins, and exporting results to CSV/JSON/Markdown.

bytedance/deep-research

Use this skill instead of WebSearch for ANY question requiring web research. Trigger on queries like "what is X", "explain X", "compare X and Y", "research X", or before content generation tasks. Provides systematic multi-angle research methodology instead of single superficial searches. Use this proactively when the user's question needs online information.

bytedance/find-skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

bytedance/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

bytedance/github-deep-research

Conduct multi-round deep research on any GitHub Repo. Use when users request comprehensive analysis, timeline reconstruction, competitive analysis, or in-depth investigation of GitHub. Produces structured markdown reports with executive summaries, chronological timelines, metrics analysis, and Mermaid diagrams. Triggers on Github repository URL or open source projects.

bytedance/image-generation

Use this skill when the user requests to generate, create, imagine, or visualize images including characters, scenes, products, or any visual content. Supports structured prompts and reference images for guided generation.

bytedance/podcast-generation

Use this skill when the user requests to generate, create, or produce podcasts from text content. Converts written content into a two-host conversational podcast audio format with natural dialogue.

bytedance/ppt-generation

Use this skill when the user requests to generate, create, or make presentations (PPT/PPTX). Creates visually rich slides by generating images for each slide and composing them into a PowerPoint file.

bytedance/skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

bytedance/surprise-me

Create a delightful, unexpected "wow" experience for the user by dynamically discovering and creatively combining other enabled skills. Triggers when the user says "surprise me" or any request expressing a desire for an unexpected creative showcase. Also triggers when the user is bored, wants inspiration, or asks for "something interesting".

bytedance/vercel-deploy

Deploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as "Deploy my app", "Deploy this to production", "Create a preview deployment", "Deploy and give me the link", or "Push this live". No authentication required - returns preview URL and claimable deployment link.

bytedance/video-generation

Use this skill when the user requests to generate, create, or imagine videos. Supports structured prompts and reference image for guided generation.

bytedance/web-design-guidelines

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

chart-visualization

This skill should be used when the user wants to visualize data. It intelligently selects the most suitable chart type from 26 available options, extracts parameters based on detailed specifications, and generates a chart image using a JavaScript script.

相关技能