Image Transform logo

Image Transform

Organization
meitu
image-transform

图片几何变换/智能构图/尺寸变换(不改画面内容),覆盖旋转/翻转、倍数放大、无损缩小、调整尺寸、智能构图、画布扩展/扩图。当用户提到旋转、翻转、镜像、放大 N 倍、缩小到 xxx、扩图、改成 16:9、竖版改横版、outpaint、智能构图、重新构图、调整尺寸时触发。

Overview

Publishermeitu
Repositorymeitu-skills
Skill nameimage-transform
Stars
36
Forks
3
Bundled files
Instructions only
LicenseMIT
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by meitu on GitHub. Read the source before you install it.

Installation

Install the Image Transform 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.
    https://github.com/meitu/meitu-skills/tree/main/skills/image-transform
  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/meitu/meitu-skills.git /tmp/meitu-skills
mkdir -p .claude/skills
cp -r /tmp/meitu-skills/skills/image-transform .claude/skills/image-transform
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Image Transform 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 Image Transform 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 Image Transform 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.

Image Transform

Overview

对已有图片做几何变换(不改变画面内容)。4 类场景:旋转/翻转(-180°~180°)、等比放大(2/4/8 倍)、无损等比缩小、智能构图/画布扩展/尺寸变换(AI outpainting)。关键区分:"放大 N 倍/缩小到 800 宽/扩图/改尺寸"走本工具;"放大到 4K"(分辨率目标)走 image-superres-enhance。

API Mapping

  • 旋转/翻转:api_v1_layer_flow_edit_rotate
  • 等比放大:image_upscale_equal_proportion_edit
  • 无损缩小:image_dldownscaling_edit
  • 智能构图 / 画布扩展 / 尺寸变换:image_extension_layer_flow_filter

Dependencies

  • meitu-cli: >=2.0.6
  • 凭证:CONFIG AKSK → meitu tools update;EXEC AKSK → 实际执行(见根 CONFIG.md)
  • 环境变量:MEITU_OPENAPI_TOOL_TASK_MODE=command

路径别名:$VISUAL = {OPENCLAW_HOME}/workspace/visual/

Core Workflow

Preflight → Execute → Deliver

Preflight

  1. meitu --version ≥ 2.0.6
  2. 已用 CONFIG AKSK 跑过 meitu tools update
  3. 当前 AKSK = EXEC,MEITU_OPENAPI_TOOL_TASK_MODE=command
  4. output_dir:openclaw.yaml → ./output/ |else → $VISUAL/output/image-transform/;mkdir -p

Execute

触发信号 / 路由规则

核心维度:操作意图分支。

场景判定关键词路由
旋转 / 翻转旋转、顺时针、逆时针、翻转、镜像api_v1_layer_flow_edit_rotate
等比放大(倍数)放大 2/4/8 倍、等比放大image_upscale_equal_proportion_edit
无损缩小缩小到 xxx、无损缩小image_dldownscaling_edit
智能构图 / 画布扩展 / 改比例 / 尺寸变换扩图、改成 16:9、竖版改横版、outpaint、智能构图、重新构图、调整到指定宽高image_extension_layer_flow_filter

路由原则:缩小目标 > 原图 → 自动转 image_upscale_equal_proportion_edit;缩小目标 = 原图 → 直接返回原图。

参数定义

通用:

参数类型必填说明
image_urlSTRING是图片地址

api_v1_layer_flow_edit_rotate:

参数类型范围默认说明
rotateNUMBER-180 ~ 1800旋转角度;超出自动 clamp
flip_xBOOLEANtrue/falsefalse水平翻转
flip_yBOOLEANtrue/falsefalse垂直翻转

image_upscale_equal_proportion_edit:

参数类型范围默认说明
sr_numINTEGER2 / 4 / 82放大倍数;非法值取最近合法值(3→2,6→8)

image_dldownscaling_edit:

参数类型说明
target_widthINTEGER目标宽度(像素 px,禁止传比例数字)
target_heightINTEGER目标高度(像素 px,禁止传比例数字)
  • 仅给一边 → 按原图比例计算另一边
  • 目标 > 原图 → 自动切 image_upscale_equal_proportion_edit
  • 目标 = 原图 → 直接返回原图

image_extension_layer_flow_filter:

参数类型默认说明
widthINTEGER--目标宽度(像素 px,禁止传比例数字)
heightINTEGER--目标高度(像素 px,禁止传比例数字)
promptSTRING保持原图风格自然延伸扩展/重构区域 AI 补全描述

width/height 必须绝对像素值:用户说"16:9"→按原图尺寸计算像素(例:原图 1024×768,16:9 → width=1024, height=576);只说"扩图"无具体值 → 默认按 3:4 比例计算。扩展场景目标 < 原图 → 不调用,提示"目标尺寸需大于原图尺寸"。

工具调用

bash
# 旋转
meitu image-transform --image_url <url> --rotate 90 --json --download-dir {output_dir} --skill_name skill_image-transform
bash
# 等比放大
meitu image-transform --image_url <url> --sr_num 4 --json --download-dir {output_dir} --skill_name skill_image-transform
bash
# 缩小
meitu image-transform --image_url <url> --target_width 800 --json --download-dir {output_dir} --skill_name skill_image-transform 
bash
# 扩图
meitu image-transform --image_url <url> --width 1920 --height 1080 --json --download-dir {output_dir} --skill_name skill_image-transform

错误降级

场景处理方式
image_url 缺失提示"请提供需要变换的图片"
image_url 不可访问直接返回图片链接无效错误,不重试
rotate 超出 -180~180自动 clamp
sr_num 非法取最近合法值
downscale 目标 > 原图自动切 image_upscale_equal_proportion_edit
downscale 目标 = 原图不调用,直接返回原图
downscale 只给一边按原图比例计算另一边
扩图目标 < 原图不调用,提示"目标尺寸需大于原图尺寸"
智能构图/尺寸变换缺 width/height 且无法从比例推算提示"请提供目标宽高或目标比例"
任一 API 调用失败重试 1 次,仍失败返回错误
内容合规拦截直接返回合规提示,不重试、不降级
同时要旋转 + 扩图建议分步操作:先旋转再扩图

Deliver

  • 使用 Preflight 解析的 output_dir
  • 从 downloaded_files[0].saved_path 读取已下载文件路径
  • mv {downloaded_files[0].saved_path} {output_dir}/{YYYY-MM-DD}_{descriptive}_image-transform.{ext}

Output

  • 格式:image
  • 位置:项目 → ./output/,一次性 → $VISUAL/output/image-transform/

基线 Task ID

见 references/task-id-baseline.md 中对应行。

Frequently asked questions

What does the Image Transform AI skill do?

图片几何变换/智能构图/尺寸变换(不改画面内容),覆盖旋转/翻转、倍数放大、无损缩小、调整尺寸、智能构图、画布扩展/扩图。当用户提到旋转、翻转、镜像、放大 N 倍、缩小到 xxx、扩图、改成 16:9、竖版改横版、outpaint、智能构图、重新构图、调整尺寸时触发。

Why use Image Transform on TypingMind?

Because you install it once and use it with any model. Image Transform 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 Image Transform in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/meitu/meitu-skills/tree/main/skills/image-transform. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Image Transform?

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 Image Transform?

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

Is the Image Transform AI skill free?

Yes. It is published on GitHub by meitu under the MIT 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 👇