← 返回 Skills 市场
stanleychanh

aliyun-image

作者 StanleyChanH · GitHub ↗ · v1.1.0
cross-platform ⚠ suspicious
1185
总下载
1
收藏
7
当前安装
6
版本数
在 OpenClaw 中安装
/install aliyun-image
功能描述
阿里云百炼图像生成、编辑与翻译。文生图:根据文本生成图像,支持复杂文字渲染。图像编辑:单图编辑、多图融合、风格迁移、物体增删。图像翻译:翻译图像中的文字,保留原始排版,支持11种源语言和14种目标语言。触发词:生成图片、AI作画、文生图、图像编辑、修图、换背景、风格迁移、多图融合、图像翻译、图片翻译。模型:qwen-image-plus(默认)、qwen-image-max、qwen-image-edit-plus(默认)、qwen-image-edit-max、qwen-mt-image。
使用说明 (SKILL.md)

阿里云百炼图像生成与编辑

🔄 同步更新:本项目在 GitHubClawHub 同步发布。

快速开始

前提条件

# 配置 API Key
export DASHSCOPE_API_KEY="sk-xxxx"

文生图

import os, requests

resp = requests.post(
    "https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation",
    headers={"Authorization": f"Bearer {os.getenv('DASHSCOPE_API_KEY')}"},
    json={
        "model": "qwen-image-plus",
        "input": {"messages": [{"role": "user", "content": [{"text": "一只橘猫在阳光下打盹"}]}]},
        "parameters": {"prompt_extend": True, "watermark": False}
    }
)
print(resp.json()["output"]["choices"][0]["message"]["content"][0]["image"])

图像编辑

resp = requests.post(
    "https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation",
    headers={"Authorization": f"Bearer {os.getenv('DASHSCOPE_API_KEY')}"},
    json={
        "model": "qwen-image-edit-plus",
        "input": {"messages": [{"role": "user", "content": [
            {"image": "https://example.com/photo.jpg"},
            {"text": "把背景换成星空"}
        ]}]},
        "parameters": {"prompt_extend": True, "watermark": False}
    }
)
print(resp.json()["output"]["choices"][0]["message"]["content"][0]["image"])

图像翻译

import os, requests, time

# 1. 创建翻译任务
resp = requests.post(
    "https://dashscope.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis",
    headers={
        "Authorization": f"Bearer {os.getenv('DASHSCOPE_API_KEY')}",
        "X-DashScope-Async": "enable"
    },
    json={
        "model": "qwen-mt-image",
        "input": {
            "image_url": "https://example.com/english-poster.jpg",
            "source_lang": "en",
            "target_lang": "zh"
        }
    }
)
task_id = resp.json()["output"]["task_id"]

# 2. 轮询获取结果
while True:
    time.sleep(3)
    result = requests.get(
        f"https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}",
        headers={"Authorization": f"Bearer {os.getenv('DASHSCOPE_API_KEY')}"}
    ).json()
    if result["output"]["task_status"] == "SUCCEEDED":
        print(result["output"]["image_url"])
        break

默认配置

场景 默认模型 高质量模型
文生图 qwen-image-plus qwen-image-max
图像编辑 qwen-image-edit-plus qwen-image-edit-max
图像翻译 qwen-mt-image -

规则:默认使用 Plus 系列,仅当用户明确要求"最好的"、"最高质量"时使用 Max 系列。

默认参数

{
  "negative_prompt": "低分辨率,低画质,肢体畸形,手指畸形,画面过饱和,蜡像感",
  "prompt_extend": true,
  "watermark": false
}

详细参考

按需加载以下文档:

文档 用途
references/text-to-image.md 文生图完整API参考:模型列表、分辨率、所有参数
references/image-edit.md 图像编辑完整API参考:单图编辑、多图融合、输入要求
references/image-translate.md 图像翻译完整API参考:支持语言、异步调用、术语定义

工具脚本

脚本 用途
scripts/client.py 封装好的API客户端,支持文生图、图像编辑和图像翻译

使用脚本

# 文生图
python scripts/client.py generate "一只橘猫在阳光下打盹" --size 1920*1080

# 图像编辑
python scripts/client.py edit "https://example.com/photo.jpg" "把背景换成星空" -n 2

# 图像翻译
python scripts/client.py translate "https://example.com/english.jpg" --source en --target zh

关键注意事项

  1. 图像URL有效期:生成的图像URL仅保留 24小时,请及时下载
  2. 地域:API Key 和请求地址必须属于同一地域(北京/新加坡)
  3. 费用:按成功生成的图像张数计费

常见错误

错误码 原因 解决方案
InvalidApiKey API Key无效 检查环境变量配置
InvalidParameter 参数错误 检查请求格式
DataInspectionFailed 内容审核失败 修改输入内容
安全使用建议
This package appears to implement Aliyun DashScope image APIs and will work if you provide a DASHSCOPE_API_KEY, but the public metadata omitted that required environment variable and the homepage/source fields are incomplete. Before installing: 1) Verify the upstream repository (the SKILL.md points to a GitHub URL) and inspect its commits and issues to confirm legitimacy. 2) Supply a least-privilege API key (create a key with only the needed AIGC scopes) and avoid using broader account keys. 3) Remember local files you pass to the client may be uploaded to Aliyun — don't send sensitive images. 4) Test in an isolated environment first and monitor network requests (ensure calls go to dashscope.aliyuncs.com). If the missing DASHSCOPE_API_KEY declaration or absent homepage concerns you, ask the publisher to correct the metadata before proceeding.
功能分析
Type: OpenClaw Skill Name: aliyun-image Version: 1.1.0 The skill provides legitimate functionality for interacting with Alibaba Cloud's image services. However, the `scripts/client.py` file contains two significant vulnerabilities: 1) The `edit` function allows reading arbitrary local files (e.g., `/etc/passwd`) if a user-controlled path is provided, base64-encoding their content, and sending them to the Aliyun API, posing a Local File Inclusion (LFI) risk. 2) The `download` function allows writing downloaded content to arbitrary file paths, potentially enabling path traversal and arbitrary file write. These are critical vulnerabilities due to a lack of input sanitization, but do not show clear evidence of intentional malicious behavior by the skill author.
能力评估
Purpose & Capability
Name/description, docs, and client code all target Aliyun DashScope image APIs (generation, edit, translate) and use endpoints under dashscope.aliyuncs.com — that part is coherent. However, registry metadata lists no required environment variables or primary credential, while SKILL.md/README/scripts clearly require DASHSCOPE_API_KEY. The skill's Source/Homepage are marked unknown/none despite repository links inside SKILL.md/README, which is an inconsistency in provenance information.
Instruction Scope
Runtime instructions and code show normal API usage: POST to DashScope endpoints, async task polling, and optional local-file-to-base64 encoding for uploads. The instructions do not ask the agent to read unrelated system files or secrets. Important behavior: the client will read local image files (if given) and encode+upload them, and will download generated images, which is expected for image-edit/translate but carries privacy implications.
Install Mechanism
No install spec (instruction-only) which minimizes installer risk. There is nevertheless a client.py bundled in the package; no install steps are provided to add system binaries. This is consistent with an instruction-only skill but it's worth noting code files are present even though no installation is declared.
Credentials
The skill requires a single API key (DASHSCOPE_API_KEY) according to SKILL.md/README/scripts, which is proportionate to the described cloud API usage. However the declared registry requirements list no env vars or primary credential — a clear mismatch. The client only uses that single key (no unrelated credentials), so the requested privilege is limited but the omission in metadata is a red flag.
Persistence & Privilege
always:false and default invocation settings; no persistent or elevated privileges are requested. The skill does not modify other skills or system-wide configs. Autonomous invocation is allowed (platform default) but not combined with other high-risk flags.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install aliyun-image
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /aliyun-image 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Automated sync from GitHub commit 56549b0f3120ad01774334791346aabe55431ab1
v1.0.4
Automated sync from GitHub commit b94e39f32013bb1b0487489f939a68d08c9a86c2
v1.0.3
Automated sync from GitHub commit 1bb31279748a98c8a71ea3674ca62a7b096ad0d6
v1.0.2
作者改为 StanleyChanH,添加 GitHub Actions 自动同步,更新同步更新说明文档
v1.0.1
更新 API 文档和示例代码,优化技能说明和触发词,完善参考文档结构
v1.0.0
首次发布:支持文生图和图像编辑
元数据
Slug aliyun-image
版本 1.1.0
许可证
累计安装 7
当前安装数 7
历史版本数 6
常见问题

aliyun-image 是什么?

阿里云百炼图像生成、编辑与翻译。文生图:根据文本生成图像,支持复杂文字渲染。图像编辑:单图编辑、多图融合、风格迁移、物体增删。图像翻译:翻译图像中的文字,保留原始排版,支持11种源语言和14种目标语言。触发词:生成图片、AI作画、文生图、图像编辑、修图、换背景、风格迁移、多图融合、图像翻译、图片翻译。模型:qwen-image-plus(默认)、qwen-image-max、qwen-image-edit-plus(默认)、qwen-image-edit-max、qwen-mt-image。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1185 次。

如何安装 aliyun-image?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install aliyun-image」即可一键安装,无需额外配置。

aliyun-image 是免费的吗?

是的,aliyun-image 完全免费(开源免费),可自由下载、安装和使用。

aliyun-image 支持哪些平台?

aliyun-image 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 aliyun-image?

由 StanleyChanH(@stanleychanh)开发并维护,当前版本 v1.1.0。

💬 留言讨论