Ai Image Gen logo

Ai Image Gen

OrganizationPopular
ZJU-REAL
ai-image-gen

通用 AI 生图:文生图 / 图生图 / 图像变体。当用户说 AI 生图、AI 画图、文生图、图生图、生成图片、生成配图、图像生成、AI 出图、AI 作图、换图、改图、图像编辑、给我画一张、生成一张图 时使用。支持 OpenAI 兼容 API 与 apimart 异步 API,用户自备 API key。

Overview

PublisherZJU-REAL
RepositoryEasel
Skill nameai-image-gen
Stars
1.2K
Forks
175
Bundled files
1
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ZJU-REAL on GitHub. Read the source before you install it.

Installation

Install the Ai Image Gen AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ZJU-REAL/Easel.git /tmp/Easel
mkdir -p .claude/skills
cp -r /tmp/Easel/skills/openclaw/ai-image-gen .claude/skills/ai-image-gen
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ai Image Gen in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ai Image Gen on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ai Image Gen is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

ai-image-gen Skill

通用 AI 文生图 / 图生图 / 图像变体。用户自备图像生成 API key(OpenAI 兼容 或 apimart 异步),产物写入 outputs/

调用共享脚本 skills/shared/scripts/ai_image.py(纯标准库,无第三方依赖)。 本 SKILL 不索要、不回显、不写入、不提交任何真实 API key —— key 只存在于用户自己的 .env

边界(和相邻 SKILL 区分)

  • ai-image-gen(本 SKILL):通用 AI 生图,任意题材,文生图 / 图生图 / 变体。
  • ecom-details-image:电商详情页 / 商品主图专用出图(25 场景模板、PDP 序列)。要做电商商品图走它。
  • card-* / poster-*:HTML+CSS 渲染截图(金句卡、小红书卡、海报),非 AI 生成,是确定性设计出图。
  • image-editing:已有图片的确定性处理(改尺寸/裁剪/加水印/压缩),不生成新画面。

配置(执行前必读)

配置检查路径铁律:先 cdAGENTS.md 末尾给出的 Easel 项目根,确认当前目录有 .envskills/shared/scripts/ai_image.py,再运行下列命令。不得在 OpenClaw workspace 用 ./shared/scripts/... 检查,也不得用 env / printenv 代替读取项目 .env;否则会把已配置的 IMG_BASE_URL/Key 误判为缺失。

需在项目根目录 .env 中设置三项(脚本从当前目录向上自动查找 .env):

变量说明兼容别名
IMG_BASE_URLAPI 根地址OPENAI_BASE_URL / OPENAI_API_BASE / BASE_URL
IMG_MODEL图片模型名OPENAI_IMAGE_MODEL / IMAGE_MODEL / OPENAI_MODEL
IMG_API_KEYAPI keyOPENAI_API_KEY / API_KEY

支持两类服务,脚本按 base_url 自动检测(也可 --mode sync|async 强制):

  • OpenAI 兼容(同步)base_url 不含 apimart。走 /images/generations/images/edits/images/variations。 示例:IMG_BASE_URL=https://api.openai.com/v1IMG_MODEL=gpt-image-1
  • apimart(异步轮询)base_urlapimart。提交任务 → 轮询 /tasks/<id> → 下载。 示例:IMG_BASE_URL=https://api.apimart.ai/v1

执行步骤

1. 先确认配置(离线,不发请求)

bash
python skills/shared/scripts/ai_image.py check

打印三项配置状态(key 脱敏显示)、命中的别名、自动检测的模式。缺项时给出 .env 填写示例并以退出码 2 结束。配置未就绪就不要往下走,直接把缺什么、怎么配告诉用户。

2. 文生图 text2img

先把用户诉求写成一条清晰的图像 Prompt(主体 + 风格 + 构图 + 光线 + 画质),再执行:

bash
python skills/shared/scripts/ai_image.py text2img \
  --prompt "一只戴墨镜的柴犬,扁平插画风,明亮撞色背景,高细节" \
  --size 1024x1024 --n 1 \
  --output outputs/主题名/ai-image
  • --size:同步模式用像素(1024x1024 / 1536x1024 / 1024x1536…);异步模式用比例(1:1 / 16:9 / 9:16…)。
  • --n:生成张数(多张时按序号自动命名)。
  • --output:目录(多张自动编号)或含扩展名的单文件;统一放 outputs/主题名/
  • 同步可加 --quality low|medium|high;异步可加 --resolution 1k|2k|4k

3. 图生图 / 图像编辑 img2img

基于一张输入图 + 指令生成新图(OpenAI 走 /images/edits multipart,可选 --mask 局部编辑;apimart 把输入图作参考图走生成端点):

bash
python skills/shared/scripts/ai_image.py img2img \
  --prompt "把背景换成夜晚霓虹街道,保留主体" \
  --image path/to/input.png \
  --output outputs/主题名/edited.png

4. 图像变体 variations

由一张图生成多个变体:

bash
python skills/shared/scripts/ai_image.py variations \
  --image path/to/input.png --n 3 \
  --output outputs/主题名/variations

5. 交付

告诉用户产物路径、生成参数(模式/模型/尺寸/张数)。如需再改尺寸/加水印/压缩,转 image-editing

产物

统一输出到 outputs/主题名/。脚本会自动创建目录,多张按时间戳 + 序号命名。

Profile 感知

有账号 Profile(=== EASEL ACCOUNT PROFILE ===)时,把品牌视觉风格(配色 / 调性 / 元素偏好)融入 Prompt,保持系列图统一;无 Profile 时按用户描述走通用生成。

常见问题

  • 缺 key / 缺配置check 会明确指出缺哪项及 .env 示例;报错为友好中文,不抛 traceback。
  • 同步 vs 异步用错尺寸格式:同步用像素、异步用比例。用 --mode 可强制模式。
  • 不要把真实 key 写进任何产物或提交

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ai Image Gen AI skill do?

通用 AI 生图:文生图 / 图生图 / 图像变体。当用户说 AI 生图、AI 画图、文生图、图生图、生成图片、生成配图、图像生成、AI 出图、AI 作图、换图、改图、图像编辑、给我画一张、生成一张图 时使用。支持 OpenAI 兼容 API 与 apimart 异步 API,用户自备 API key。

Why use Ai Image Gen on TypingMind?

Because you install it once and use it with any model. Ai Image Gen is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ai Image Gen in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ZJU-REAL/Easel/tree/main/skills/openclaw/ai-image-gen. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ai Image Gen?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ai Image Gen?

As many as you like. As long as a model supports skills, you can use Ai Image Gen with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ai Image Gen AI skill free?

Yes. It is published on GitHub by ZJU-REAL under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇