image-editlisted
Install: claude install-skill tensorslab/skills
# Image Edit - 图像编辑工具
基于 tl-image 的 quickedit 模型实现快速图像编辑操作。
## 脚本路径
本技能使用 tl-image 技能的 `tensorslab_image.py` 脚本,配合 `--model quickedit` 参数。脚本位于 tl-image 技能的 `scripts/` 目录下,**必须使用绝对路径执行**。根据 tl-image 技能的安装位置确定绝对路径。
例如,如果 tl-image 的 SKILL.md 位于 `/path/to/skills/tl-image/SKILL.md`,则:
```bash
python "<tl-image绝对路径>/scripts/tensorslab_image.py" "<编辑指令>" --source <image_path> --model quickedit
```
## 授权
使用前需确保已通过 TensorsLab 授权。运行:
```bash
python "<tl-image绝对路径>/scripts/tensorslab_auth.py"
```
如果之前已授权过(`~/.tensorslab/.env` 中有 key),则无需重复授权。
## 提示词规则
**所有传给脚本的提示词(prompt)必须用引号包裹**,防止 shell 解析问题:
```bash
# 正确
python "scripts/tensorslab_image.py" "remove the watermark" --source photo.jpg --model quickedit
python "scripts/tensorslab_image.py" "把天空改成星空" --source photo.jpg --model quickedit
# 错误 - 没有引号
python "scripts/tensorslab_image.py" remove the watermark --source photo.jpg --model quickedit
```
## 功能说明
### 1. 变宽高比(aspect)
改变图片宽高比,保持内容不变。
```bash
python "<tl-image绝对路径>/scripts/tensorslab_image.py" "保持画面内容不变,调整构图适应新的宽高比" --source input.jpg --model quickedit --resolution 16:9
```
支持的宽高比:`1:1`、`4:3`、`3:4`、`16:9`、`9:16`、`3:2`、`2:3`、`21:9`、`9:21`
用户请求映射:
- "正方形"、"1:1" → `1:1`
- "横屏"、"16:9"、"宽屏" → `16:9`
- "竖屏"、"9:16"、"手机屏" → `9:16`
- "4:3"、"标准" → `4:3`
### 2. 擦除对象(erase)
从图片中移除指定对象。
```bash
python "<tl-image绝对路径>/scripts/tensorslab_image.py" "remove the watermark from the image" --source photo.jpg --model quickedit
python "<tl-image绝对路径>/scripts/tensorslab_image.py" "remove