Xpersona
M

mopng-api

CLAWHUB · Unverified

通过 qise-studio/motu-agent 的 MoPNG Agent OpenAPI 协商完成图片生成与修图。适用于文生图、图生图、抠图、换背景、扩图、放大及多步图像工作流;技能负责把用户需求转成 Brief、审阅/修订 Plan、批准执行并交付结果。 Skill: mopng-api Owner: jkin8010 Summary: 通过 qise-studio/motu-agent 的 MoPNG Agent OpenAPI 协商完成图片生成与修图。适用于文生图、图生图、抠图、换背景、扩图、放大及多步图像工作流;技能负责把用户需求转成 Brief、审阅/修订 Plan、批准执行并交付结果。 Tags: latest:0.1.8 Version history: v0.1.8 | 2026-08-17T11:52:54.229Z | auto **Major update: Switch from legacy mopng.cn endpoints to MoPNG Agent OpenAPI workflow via qise-studio/motu-agent.** - Uses a new agent-based multi-step workflow (Brief →

62
Rank
84
Safety
1.4k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s1720a0vz8zby0xwkev6yzmgbh83hrd7:mopng-api
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-jkin8010-mopng-api/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

66,704 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: mopng-api
description: 通过 qise-studio/motu-agent 的 MoPNG Agent OpenAPI 协商完成图片生成与修图。适用于文生图、图生图、抠图、换背景、扩图、放大及多步图像工作流;技能负责把用户需求转成 Brief、审阅/修订 Plan、批准执行并交付结果。
metadata:
  openclaw:
    requires:
      bins:
        - python3
      env:
        - MOPNG_API_KEY
    primaryEnv: MOPNG_API_KEY
---

# MoPNG Agent 协商技能

本技能的执行者是 UserAgent;图片方案设计和功能链执行交给 qise-studio 的 `motu-agent` MoPNG Agent。调用本仓库的客户端:

```bash
python3 scripts/mopng_agent.py agent <subcommand> ...
```

不要再调用旧的 `mopng.cn` 直连功能端点,也不要把 `remove-bg`、`text-to-image` 等旧命令当作本技能接口。

## 配置

| 环境变量 | 必填 | 说明 |
|---|---:|---|
| `MOPNG_API_KEY` | 是 | MoPNG 用户 API Key,格式通常为 `ak_...`;仅放在宿主私密配置中。 |
| `MOPNG_AGENT_BASE_URL` | 否 | `motu-agent` 地址,默认 `https://agent-api.mopng.cn`;不要重复填写 `/api/v1/open/agent`。 |
| `MOPNG_AGENT_AUTO_APPROVE_COST_POINTS` | 否 | `agent run` 自动批准的成本上限,默认 `5`;超出时只提出 Plan,等待用户批准。 |

鉴权使用 `X-API-Key: $MOPNG_API_KEY`。服务端同时支持 `Authorization: Bearer $MOPNG_API_KEY`,但客户端默认使用前者。

## 工作流

### 1. 先澄清并生成 Brief

从用户请求提取以下信息;不确定时只询问会影响方案或成本的关键项:

- `user_intent`:保留用户原意的完整描述。
- `spec.goal`:例如 `文生图`、`背景替换`、`风格转换`、`抠图`、`扩图`、`放大`。
- `spec.usage`:电商主图、头像、海报等用途。
- `spec.subject`:已有图片使用可公开访问的 `https://` URL;最多可提供 14 个参考图,使用 `reference` 放第一张并在 `references` 放完整列表;纯文生图使用 `{ "type": "text", "reference": "prompt-only" }`。
- `spec.style`:用 `constraint` 和 `avoid` 表达风格、保留项、禁止项。
- `spec.size`、`spec.format`、`budget`、`sensitive`:只有用户给出或合理推断时填写;默认 `balanced`、10 点、120 秒、PNG。

本契约的 `subject.reference` 是 URL 或 `prompt-only`,不是本地路径,也不是 base64。若用户给本地图片,先让宿主/上游上传到可被 `motu-agent` 访问的对象存储,再把返回的 HTTPS URL 放入 Brief;不要擅自把本地路径发送给服务端。

### 2. 创建会话并展示 Plan

```bash
python3 scripts/mopng_agent.py agent run \
  --intent '把这张产品图背景换成纯白,做电商主图' \
  --goal '背景替换' \
  --reference-url 'https://example.com/product.png' \
  --usage '电商主图' \
  --style-constraint '产品边缘干净,纯白背景' \
  --avoid '复杂背景、明显阴影' \
  --width 1024 --height 1024 --format png
```

客户端 POST `/api/v1/open/agent/session`,随后读取返回的 `plan`。向用户解释:功能步骤、模型选项、预计成本/时间、输出规格和备选方案。Plan 中的模型候选和成本以服务端为准,不要自行替换模型或估算价格。

需要让用户选择模型时,先查询服务端实时目录,不要使用过期硬编码列表:

```bash
python3 scripts/mopng_agent.py agent models --capability text-to-image
```

`capability` 常见值包括 `text-to-image`、`image-to-image`、`image-edit` 和 `vision`;返回的每个模型包含 `capabilities`。

### 3. 协商修订

用户要求换模型、调整成本档位、补充约束或调整预算时,提交 `revision`:

```bash
python3 scripts/mopng_agent.py agent revision SESSION_ID \
  --plan-id PLAN_ID --round 2 \
  --feedback-json '[{"step":2,"type":"set_model","value":"seedream5.0-pro"}]' \
  --reason '用户希望保留更多产品细节'
```

允许的 `feedback[].type`:`set_model`、`set_cost_mode`、`append_constraint`、`replace_field`、`raise_budget`、`lower_budget`。最多 3 轮修订;服务端拒绝超限或不合法模型。每次修订后重新展示 Plan,不能跳过用户确认。

### 4. 批准并轮询

得到用户明确批准后:

```bash
python3 scripts/mopng_agent.py agent approve SESSION_ID
python3 scripts/mopng_agent.py agent status SESSION_ID --watch
```

客户端 POST `/approve` 获取 `exec_id`,再 GET `/exec` 轮询。成功时交付 `result_image_url`;视觉问答类 Plan 可能返回 `result_text` 而不是图片。简要报告 `steps_log`、实际模型、实际成本、耗时、`ai_labeling` 和可用的 `llm_bill

README.md

# mopng-api

面向 OpenClaw 的 MoPNG Agent Skill。它调用 qise-studio `motu-agent` 的公共 OpenAPI,让 UserAgent 与 MoPNG Agent 协商图片生成或修图方案,再由服务端执行功能链。

## 配置

```bash
export MOPNG_API_KEY='ak_...'                 # 私密配置,不要提交或粘贴到对话
export MOPNG_AGENT_BASE_URL='https://agent-api.mopng.cn'
```

`MOPNG_AGENT_BASE_URL` 默认是 `https://agent-api.mopng.cn`。客户端会自动请求 `/api/v1/open/agent`,鉴权头为 `X-API-Key`。

查询服务端当前模型目录:

```bash
python3 scripts/mopng_agent.py models --capability text-to-image
```

## 一键协商

已有图片必须先有 `motu-agent` 可访问的 HTTPS URL;多个参考图可重复传入 `--reference-url`:

```bash
python3 scripts/mopng_agent.py run \
  --intent '把产品图背景换成白色,做电商主图' \
  --goal '背景替换' \
  --reference-url 'https://example.com/product.png' \
  --usage '电商主图' \
  --style-constraint '纯白背景,产品边缘干净' \
  --width 1024 --height 1024 --watch
```

纯文生图不传 `--reference-url`:

```bash
python3 scripts/mopng_agent.py run \
  --intent '生成一张电影感的橘猫宇航员海报' \
  --goal '文生图' --usage '海报' --watch
```

低于 `MOPNG_AGENT_AUTO_APPROVE_COST_POINTS`(默认 5 点)的方案会自动批准;其他方案停在 Plan 阶段,需显式执行 `approve`。

## 手动协商

```bash
python3 scripts/mopng_agent.py brief --intent '...' --goal '风格转换' --reference-url 'https://...'
python3 scripts/mopng_agent.py plan SESSION_ID
python3 scripts/mopng_agent.py revision SESSION_ID --plan-id PLAN_ID --round 2 \
  --feedback-json '[{"step":1,"type":"set_cost_mode","value":"premium"}]'
python3 scripts/mopng_agent.py approve SESSION_ID
python3 scripts/mopng_agent.py status SESSION_ID --watch
```

支持的 OpenAPI 操作是创建会话、读取 Plan、修订、批准、轮询执行、打断和删除会话。完整行为和安全边界见 [SKILL.md](SKILL.md)。

## 校验

```bash
uv run pytest tests/ -v
uv run bandit -r scripts -ll
```

_meta.json

{
  "ownerId": "kn73xq3tps2010pza42wgwjqss82g1s4",
  "slug": "mopng-api",
  "version": "0.1.8",
  "publishedAt": 1786967574229
}

skill-card.md

## Description:

mopng-api helps an agent negotiate MoPNG Agent OpenAPI image generation and editing workflows, including text-to-image, image-to-image, background removal or replacement, outpainting, upscaling, plan review, approval, and result delivery.

This skill is ready for commercial/non-commercial use.

## Publisher:

[jkin8010](https://clawhub.ai/user/jkin8010)

### License/Terms of Use:

MIT

## Use Case:

Developers and external agents use this skill to turn image generation or image editing requests into MoPNG Agent briefs, review or revise the returned plan, approve execution when appropriate, and report image or text results with cost and status details.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill can send a MoPNG API key and image reference URLs to configurable remote services.

Mitigation: Use only a trusted HTTPS MoPNG Agent endpoint, keep MOPNG_API_KEY private, and do not pass private, internal, or credential-bearing URLs as reference images.

Risk: Low-cost runs can be auto-approved and may consume account credits.

Mitigation: Use --no-auto-approve or set MOPNG_AGENT_AUTO_APPROVE_COST_POINTS to 0 when explicit approval is required before paid execution.

Risk: The skill depends on server-provided plans, model catalogs, costs, and execution status.

Mitigation: Show the returned plan, model choices, estimated cost, elapsed time, and final status to the user, and do not replace server values with local estimates.

## Reference(s):

- [Source repository](https://github.com/jkin8010/mopng-api)
- [ClawHub skill page](https://clawhub.ai/jkin8010/skills/mopng-api)
- [README](artifact/README.md)
- [Skill instructions](artifact/SKILL.md)

## Skill Output:

**Output Type(s):** [Guidance, Shell commands, Configuration, Text, Markdown]

**Output Format:** [Markdown guidance with shell commands and JSON API payloads or results]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Requires MOPNG_API_KEY. The remote service may return a result_image_url for image workflows or result_text for visual question answering workflows.]

## Skill Version(s):

0.1.8 (source: ClawHub release metadata; artifact pyproject.toml and _meta.json report 0.1.0)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

.github/workflows/ci.yml

name: CI

on:
  push:
    branches: [main]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v4
        with:
          version: "0.5.x"
      - name: Sync dev deps
        run: uv sync --frozen
      - name: Pytest
        run: uv run pytest tests/ -v
      - name: Bandit
        run: uv run bandit -r scripts -ll

Sponsored

Ads related to mopng-api and adjacent AI workflows.