openai/skills

imagegen

明确参考图与修改目标,再生成项目图像

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

imagegen 是什么?

在具备对应能力的Codex环境里生成或编辑照片、插图、商品图和透明背景等位图。默认走内置图像工具;只有用户明确选择时才使用需要OPENAI_API_KEY的附带CLI。新图生成、参考风格与保留主体的编辑会分别处理。

中文说明由本站依据来源整理;英文原文保留在页面下方。

适合用在

  • 需要新生成、编辑或基于参考变化生成照片、插画、商品图、精灵图或透明背景位图,并且当前 Codex 环境具备图像生成能力。

这些情况不适合

  • 目标更适合直接编辑 SVG、代码原生矢量或 HTML/CSS/canvas;来源明确不建议用该 Skill 代替这些工作。
按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 imagegen,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 imagegen

请在 Codex 的当前工作环境中安装并检查 imagegen 这个 Skill。

项目身份:openai/skills / imagegen
来源:https://github.com/openai/skills/blob/49f948faa9258a0c61caceaf225e179651397431/skills/.system/imagegen/SKILL.md
已定位的源文件:skills/.system/imagegen/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 提供用途、主体、构图、逐字文字、必须保留或避免内容;输入图注明是参考还是编辑目标。
  • 内置工具是否可用以当前会话为准;CLI回退需明确选择并配置真实API凭证。

会得到什么

  • 最终位图、项目保存路径和使用的提示词与工具模式。

实际使用顺序

  1. 先判断生成还是编辑、单图还是多版本;本地编辑目标在内置路径先加载供模型查看。
  2. 整理用户已有约束,不随意添加人物、品牌、口号或配色;默认调用内置图像能力,不可用时说明而非自动切换付费CLI。
  3. 查看生成结果与文字、主体、边缘等约束,按单点修改迭代;项目使用的最终文件复制到工作区再更新引用。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

教学示例:用imagegen为一个咖啡产品介绍页生成一张无文字、无品牌的陶瓷杯商品图,横向构图并留出可排文案的空间。先使用当前会话内置工具;若不可用,只说明情况,不自行调用API。选定结果保存到项目output/imagegen/mug-v1.png,不覆盖已有素材。
预期结果

预期得到符合用途的位图和项目内路径,或明确工具缺失;本站未执行图像生成。

使用前先看这些限制

使用条件与边界

  • 适合现有SVG、矢量图标或代码原生图形的小修改,应优先编辑原资产;不能用生成位图替代所有图形任务。
针对这个 Skill 的疑问

常见问题

必须先配API Key吗?

本版本默认内置工具不要求API Key;明确选择CLI回退才需要。工具在具体会话是否可用需另行核对。

生成文件可以只留在Codex缓存吗?

预览可以;项目代码引用的资产必须放入工作区,不能依赖用户目录中的临时生成路径。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

skills/.system/imagegen/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas.

查看源文件章节 / Source sections
  • 原文:Image Generation Skill
  • 原文:Top-level modes and rules
  • 原文:When to use
  • 原文:When not to use
  • 原文:Decision tree
  • 工作流程 / Workflow
  • 原文:Prompt augmentation
  • 原文:Specificity policy
  • 原文:Use-case taxonomy (exact slugs)
  • 原文:Shared prompt schema
  • 示例 / Examples
  • 原文:Generation example (hero image)
  • 原文:Edit example (invariants)
  • 原文:Prompting best practices
  • 原文:Guidance by asset type
  • 原文:Fallback CLI mode only
  • 原文:Temp and output conventions
  • 原文:Dependencies
  • 原文:Environment
  • 原文:Script-mode notes
  • 原文:Reference map
原文:Image Generation Skill

Generates or edits images for the current project (for example website assets, game assets, UI mockups, product mockups, wireframes, logo design, photorealistic images, or infographics).

原文:Top-level modes and rules

This skill has exactly two top-level modes: - **Default built-in tool mode (preferred):** built-in `image_gen` tool for normal image generation and editing. Does not require `OPENAI_API_KEY`. - **Fallback CLI mode (explicit-only):** `scripts/image_gen.py` CLI. Use only when the user explicitly asks for the CLI path. Requires `OPENAI_API_KEY`. Within the explicit CLI fallback only, the CLI exposes three subcommands: - `generate` - `edit` - `generate-batch` Rules: - Use the built-in `image_gen` tool by default for all normal image generation and editing requests. - Never switch to CLI fallback automatically. - If the built-in tool fails or is unavailable, tell the user the CLI fallback exists and that it requires `OPENAI_API_KEY`. Proceed only if the user explicitly asks for that fallback. - If the user explicitly asks for CLI mode, use the bundled `scripts/image_gen.py` workflow. Do not create one-off SDK runners. - Never modify `scripts/image_gen.py`. If something is missing, ask the user before doing anything else. Built-in save-path policy: - In built-in tool mode, Codex saves generated images under `$CODEX_HOME/*` by default. - Do not describe or rely on OS temp as the default built-in destination. - Do not describe or rely on a destination-path argument (if any) on the built-in `image_gen` tool. If a specific location is needed, generate first and then move or copy the selected output from `$CODEX_HOME/generated_images/...`. - Save-path precedence in built-in mode: 1. If the user names a destination, move or copy the selected output there. 2. If the image is meant for the current project, move or copy the final selected image into the workspace before finishing. 3. If the image is only for preview or brainstorming, render it inline; the underlying file can remain at the default `$CODEX_HOME/*` path. - Never leave a project-referenced asset only at the default `$CODEX_HOME/*` path. - Do not overwrite an existing asset unless the user explicitly asked for replacement; otherwise create a sibling versioned filename such as `hero-v2.png` or `item-icon-edited.png`.

本段为节选,完整内容见源文件。

原文:When to use

- Generate a new image (concept art, product shot, cover, website hero) - Generate a new image using one or more reference images for style, composition, or mood - Edit an existing image (inpainting, lighting or weather transformations, background replacement, object removal, compositing, transparent background) - Produce many assets or variants for one task

原文:When not to use

- Extending or matching an existing SVG/vector icon set, logo system, or illustration library inside the repo - Creating simple shapes, diagrams, wireframes, or icons that are better produced directly in SVG, HTML/CSS, or canvas - Making a small project-local asset edit when the source file already exists in an editable native format - Any task where the user clearly wants deterministic code-native output instead of a generated bitmap

原文:Decision tree

Think about two separate questions: 1. **Intent:** is this a new image or an edit of an existing image? 2. **Execution strategy:** is this one asset or many assets/variants? Intent: - If the user wants to modify an existing image while preserving parts of it, treat the request as **edit**. - If the user provides images only as references for style, composition, mood, or subject guidance, treat the request as **generate**. - If the user provides no images, treat the request as **generate**. Built-in edit semantics: - Built-in edit mode is for images already visible in the conversation context, such as attached images or images generated earlier in the thread. - If the user wants to edit a local image file with the built-in tool, first load it with built-in `view_image` tool so the image is visible in the conversation context, then proceed with the built-in edit flow. - Do not promise arbitrary filesystem-path editing through the built-in tool. - If a local file still needs direct file-path control, masks, or other explicit CLI-only parameters, use the explicit CLI fallback only when the user asks for it. - For edits, preserve invariants aggressively and save non-destructively by default. Execution strategy: - In the built-in default path, produce many assets or variants by issuing one `image_gen` call per requested asset or variant. - In the explicit CLI fallback path, use the CLI `generate-batch` subcommand only when the user explicitly chose CLI mode and needs many prompts/assets. Assume the user wants a new image unless they clearly ask to change an existing one.

工作流程 / Workflow

1. Decide the top-level mode: built-in by default, fallback CLI only if explicitly requested. 2. Decide the intent: `generate` or `edit`. 3. Decide whether the output is preview-only or meant to be consumed by the current project. 4. Decide the execution strategy: single asset vs repeated built-in calls vs CLI `generate-batch`. 5. Collect inputs up front: prompt(s), exact text (verbatim), constraints/avoid list, and any input images. 6. For every input image, label its role explicitly: - reference image - edit target - supporting insert/style/compositing input 7. If the edit target is only on the local filesystem and you are staying on the built-in path, inspect it with `view_image` first so the image is available in conversation context. 8. If the user asked for a photo, illustration, sprite, product image, banner, or other explicitly raster-style asset, use `image_gen` rather than substituting SVG/HTML/CSS placeholders. If the request is for an icon, logo, or UI graphic that should match existing repo-native SVG/vector/code assets, prefer editing those directly instead. 9. Augment the prompt based on specificity: - If the user's prompt is already specific and detailed, normalize it into a clear spec without adding creative requirements. - If the user's prompt is generic, add tasteful augmentation only when it materially improves output quality. 10. Use the built-in `image_gen` tool by default. 11. If the user explicitly chooses the CLI fallback, then and only then use the fallback-only docs for quality, `input_fidelity`, masks, output format, output paths, and network setup. 12. Inspect outputs and validate: subject, style, composition, text accuracy, and invariants/avoid items. 13. Iterate with a single targeted change, then re-check. 14. For preview-only work, render the image inline; the underlying file may remain at the default `$CODEX_HOME/generated_images/...` path. 15. For project-bound work, move or copy the selected artifact into the workspace and update any consuming code or references. Never leave a project-referenced asset only at the default `$CODEX_HOME/generated_images/...` path. 16. For batches, persist only the selected finals i

本段为节选,完整内容见源文件。

文件 SHA256:826d05b806d51fa81cd650f1c0854b0a1f7fbccd1b152c588ded1797a2e7218f

仓库许可证记录:未提供;not-established,查看来源。

SKILL.md原文description · 2026-11-16T12:36:35.145Z

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas.

查看历史简介来源

历史收录数据

来源仓库openai/skills
Skill源路径skills/.system/imagegen/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源