modelscope-image

魔搭(ModelScope)AI 图片生成。支持多种模型、LoRA 微调。触发词:生成图片、AI绘画、文生图、image generation、generate image。当用户要求生成图片、画图、AI 作画,或提到魔搭、ModelScope时使用。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "modelscope-image" with this command: npx skills add focus883/modelscope-img

ModelScope 图片生成

调用魔搭(ModelScope) API 生成 AI 图片。支持切换模型,优化AI识别模型名称不准确。

快速开始

# 设置 API Key(首次使用)
set MODELSCOPE_API_KEY=你的密钥

# 或保存到配置文件
py scripts/generate_qwen.py --save-key 你的密钥
py scripts/generate_tongyi.py --save-key 你的密钥

# 使用z-image生成图片
py scripts/generate_tongyi.py -p "A golden cat"
py scripts/generate_tongyi.py -p "一只在月光下奔跑的银狼" -o wolf.jpg

使用qwen-image生成图片

py scripts/generate_qwen.py -p "A golden cat" py scripts/generate_qwen.py -p "一只在月光下奔跑的银狼" -o wolf.jpg


## 参数说明

| 参数 | 说明 | 默认值 |
|------|------|--------|
| `-p, --prompt` | 图片描述(必需) | - |
| `-m, --model` | 模型 ID | Tongyi-MAI/Z-Image |
| `-o, --output` | 输出文件路径 | result_image.jpg |
| `-l, --lora` | 单个 LoRA repo-id | - |
| `--lora-weight` | 单个 LoRA 权重 | 1.0 |
| `--lora-json` | 多 LoRA JSON 配置 | - |
| `--api-key` | API Key | 从环境变量/配置文件读取 |

## LoRA 支持

**使用qwen-image生成图片时,单个 LoRA:**
```bash
py scripts/generate_qwen.py -p "动漫少女" -l your-lora-id --lora-weight 0.8

使用z-image生成图片时,单个 LoRA:

py scripts/generate_tongyi.py -p "动漫少女" -l your-lora-id --lora-weight 0.8

多个 LoRA(权重之和需为 1.0):

py scripts/generate.py -p "风景画" --lora-json "{\"lora-1\": 0.6, \"lora-2\": 0.4}"

API Key 配置

三种方式(优先级从高到低):

  1. 命令行参数: --api-key YOUR_KEY
  2. 环境变量: set MODELSCOPE_API_KEY=YOUR_KEY
  3. 配置文件: ~/.modelscope/api_key

获取 API Key: https://modelscope.cn/my/myaccesstoken

依赖

pip install requests pillow

支持2种常用模型,直接使用

  • Qwen/Qwen-Image-2512 - 快速生成
  • Tongyi-MAI/Z-Image - 快速生成(默认)
  • 更多模型见 ModelScope 平台

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

WeChat Official Accounts Article Engagement Metrics API

Call GET /api/weixin/get-article-feedback/v1 for WeChat Official Accounts Article Engagement Metrics through JustOneAPI with articleUrl.

Registry SourceRecently Updated
General

03 Logistics Alert

对菜鸟物流订单进行异常监控、预警分级和赔偿标准匹配。 基于淘宝/天猫物流时效规则(2024最新版)、菜鸟专线赔付标准 和行业物流SLA基准数据,帮助内控人员快速识别异常订单、 预判风险并给出处置建议和赔偿预算。 v1.7 新增:AE-03细分规则(退件/异地/乱序)、AE-10联动供应商评分规则、赔偿封顶规则明确...

Registry SourceRecently Updated
General

Xiaohongshu (RedNote) User Published Notes API

Call 2 get-user-note-list versions for Xiaohongshu (RedNote) User Published Notes through JustOneAPI with userId.

Registry SourceRecently Updated
General

01 Complaint Classification

基于 GB/T 42499-2023 国家标准和阿里巴巴平台规则, 对用户投诉进行智能分类、优先级评定、责任方判断和派发建议。 适用于菜鸟物流、菜鸟驿站、淘宝闪购三条业务线。 v1.7 新增:统一引用 GLOSSARY.md、INSUFFICIENCY-HANDLING.md、RULE-UPDATE-SOP.md。

Registry SourceRecently Updated