modelscope.cn

modelscope-api

使用魔搭平台(ModelScope)API进行图片生成和编辑

Installation

$ npx skills add https://modelscope.cn

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from modelscope.cn · top by installs.

npx skills add https://modelscope.cn

Browse all from modelscope.cn

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,431 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

ModelScope API 图片生成/编辑

环境准备

  • Node.js >= 18(使用内置 fetch)
  • 设置环境变量:
set MODELSCOPE_API_KEY=ms-你的API密钥

功能

1. 图片生成 (image-generator.js)

使用 Tongyi-MAI/Z-Image-Turbo 模型根据提示词生成图片。

node image-generator.js -p "一只可爱的猫咪"
node image-generator.js -p "科幻城市夜景" -o city_night.jpg

参数:

  • -p, --prompt - 生成提示词(必需)
  • -o, --output - 输出文件名(可选)
  • -h, --help - 显示帮助

2. 图片编辑 (image-editor.js)

使用 Qwen/Qwen-Image-Edit-2511 模型编辑已有图片。

node image-editor.js -i ./photo.jpg -p "给图中的人戴上墨镜"
node image-editor.js -i ./dog.png -p "给狗戴上生日帽" -o birthday_dog.jpg

参数:

  • -i, --image - 输入图片路径(必需)
  • -p, --prompt - 编辑提示词(必需)
  • -o, --output - 输出文件名(可选)
  • -h, --help - 显示帮助

输出信息

脚本会显示模型调用限制信息:

  • 模型剩余调用次数
  • 总请求剩余次数

目录结构

modelscope-api/
├── SKILL.md              # 技能说明文档
├── image-generator.js    # 图片生成脚本
└── image-editor.js       # 图片编辑脚本