← 返回 Skills 市场
songxf1024

Agnes Ai

作者 Song Xianfeng · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ✓ 安全检测通过
66
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install agnes-ai
功能描述
Generate images or videos via Agnes AI API using user-provided prompts, handling API key setup, file download, and asynchronous video status polling.
使用说明 (SKILL.md)

name: agnes-ai description: Wraps the Agnes AI API for image and video generation. Use when the user asks to generate images, pictures, photos, or videos with Agnes AI. Two image models: agnes-image-2.0-flash (image-to-image, multi-image) and agnes-image-2.1-flash (high-density text-to-image). OpenAI-compatible protocol. Requires an API key provided on first use.

Agnes AI — Image & Video Generation

Overview

Agnes AI provides image and video generation models accessible through an OpenAI-compatible HTTP API. Use this skill whenever the user wants to generate images or videos with Agnes AI.

  • API Base URL: https://apihub.agnes-ai.com/v1
  • Auth: Bearer token (AGNES_API_KEY)
  • Protocol: OpenAI-compatible request/response format

Model Selection

User Intent Model Endpoint
Generate images from text (high info density preferred) agnes-image-2.1-flash POST /v1/images/generations
Edit/existing image, image-to-image, multi-image composition agnes-image-2.0-flash POST /v1/images/generations
Generate videos, clips, animations agnes-video-v2.0 POST /v1/video/generations

Model choice guidance:

  • Default to agnes-image-2.1-flash for text-to-image (better high-information-density output)
  • Use agnes-image-2.0-flash when the user provides an input image for editing, style transfer, or multi-image composition
  • If unsure, ask the user which model they prefer, or default to agnes-image-2.1-flash for text-to-image

API Key Setup

IMPORTANT: Before any image or video generation, you MUST check for the API key. Do NOT proceed to call the API without a valid key. This check happens the first time the user asks you to generate something with Agnes (not during skill installation).

Checking for the Key

When the skill is triggered (user asks to generate an image/video), check these locations in order:

  1. Environment variable AGNES_API_KEY
  2. File ~/.agnes-ai/api_key

If No Key Found

Immediately stop and ask the user:

要使用 Agnes AI 生成功能,需要先配置 API Key。请提供你的 Agnes AI API Key,我会安全存储在本地。 (获取方式:登录 https://apihub.agnes-ai.com 后在控制台查看)

Do NOT attempt to call the API without a key.

Saving the Key

Save the key the user provides by writing it to ~/.agnes-ai/api_key (plain text, no trailing newline). Then set the environment variable for the current session:

mkdir -p ~/.agnes-ai
echo -n "sk-your-key-here" > ~/.agnes-ai/api_key
export AGNES_API_KEY="sk-your-key-here"

After saving, proceed with the generation request.

Never echo or log the API key value in any user-visible output.

Image Generation

Trigger: user asks to generate / create / make an image, picture, photo, illustration, poster, or visual with Agnes.

Model Selection Logic

  1. If the user provides an input image (image-to-image, editing, style transfer) → use agnes-image-2.0-flash
  2. If the user wants multi-image composition → use agnes-image-2.0-flash
  3. Default (text-to-image) → use agnes-image-2.1-flash

Call the API

Use the bundled script (scripts/generate.py in the same directory as this SKILL.md) for reliable execution. The script requires Python3 (standard library only, no dependencies):

# Text-to-image (agnes-image-2.1-flash, default)
python3 scripts/generate.py image \
  --prompt "\x3Cprompt>" \
  --size "\x3Csize>" \
  --output "\x3Coutput_path>"

# Image-to-image (agnes-image-2.0-flash)
python3 scripts/generate.py image \
  --prompt "\x3Cprompt>" \
  --image "\x3Cinput_image_url_or_path>" \
  --size "\x3Csize>" \
  --output "\x3Coutput_path>"

# Multi-image composition (agnes-image-2.0-flash)
python3 scripts/generate.py image \
  --prompt "\x3Cprompt>" \
  --image "url1" "url2" \
  --size "\x3Csize>" \
  --output "\x3Coutput_path>"

Or call the API directly with curl:

# Text-to-image (agnes-image-2.1-flash)
curl -s -X POST "https://apihub.agnes-ai.com/v1/images/generations" \
  -H "Authorization: Bearer $AGNES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "agnes-image-2.1-flash",
    "prompt": "\x3Cprompt>",
    "size": "\x3Csize>"
  }'

# Image-to-image (agnes-image-2.0-flash)
curl -s -X POST "https://apihub.agnes-ai.com/v1/images/generations" \
  -H "Authorization: Bearer $AGNES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "agnes-image-2.0-flash",
    "tags": ["img2img"],
    "prompt": "\x3Cprompt>",
    "size": "\x3Csize>",
    "extra_body": {
      "image": ["\x3Cinput_image_url>"],
      "response_format": "url"
    }
  }'

Parameters

Parameter Description Default
prompt Text description of the desired image (required)
size Image dimensions. Supported: 1024x1024, 1792x1024, 1024x1792 1024x1024
n Number of images to generate 1
extra_body.image Input image URL(s) for image-to-image or multi-image tasks
tags Task type tag, e.g. ["img2img"] for image-to-image

Recommended Prompt Structure

[Subject] + [Scene / Environment] + [Style] + [Lighting] + [Composition] + [Quality Requirements]

Example:

A luminous floating city above a misty canyon at sunrise, cinematic realism, wide-angle composition, rich architectural details, soft golden light, high visual density

For image-to-image, also describe what to change AND what to preserve:

Transform the scene into a rain-soaked cyberpunk night with neon reflections while preserving the original composition and main subject layout.

Response Handling

The API returns an OpenAI-compatible response:

{
  "data": [
    {
      "url": "https://..."
    }
  ],
  "usage": {
    "generated_images": 1
  }
}

The url field contains a temporary download link. Download the image with curl or wget and save locally. If b64_json is present, decode it with base64 -d to get the raw image bytes.

After saving the image file locally, deliver it to the user — display a preview if your platform supports it, or attach the file to your response. Tell the user where the file was saved.

Video Generation

Trigger: user asks to generate / create / make a video, clip, animation, or motion content with Agnes.

Call the API

Use the bundled script (scripts/generate.py in the same directory as this SKILL.md`):

python3 scripts/generate.py video \
  --prompt "\x3Cprompt>" \
  --duration \x3Cseconds> \
  --output "\x3Coutput_path>"

Or call the API directly with curl:

curl -s -X POST "https://apihub.agnes-ai.com/v1/video/generations" \
  -H "Authorization: Bearer $AGNES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "agnes-video-v2.0",
    "prompt": "\x3Cprompt>",
    "duration": \x3Cseconds>
  }'

Parameters

Parameter Description Default
prompt Text description of the desired video (required)
duration Video duration in seconds 5

Response Handling

Video generation is asynchronous. The API returns a task ID:

{
  "id": "task_abc123",
  "status": "processing"
}

Poll for completion:

curl -s "https://apihub.agnes-ai.com/v1/video/generations/\x3Ctask_id>" \
  -H "Authorization: Bearer $AGNES_API_KEY"

When status becomes completed, the response contains a url or output field with the video download link. Download it and deliver to the user.

The bundled scripts/generate.py script handles polling automatically — prefer using it over raw curl.

Supported Image Sizes

  • 1024x1024 — square (default)
  • 1792x1024 — landscape
  • 1024x1792 — portrait

Error Handling

If the API returns a non-200 status:

  1. Check that the API key is valid and has not expired
  2. Verify the prompt is not empty and does not violate content policy
  3. If the error persists, tell the user the error message and suggest checking their Agnes AI dashboard

After Generation

After successfully generating and saving an image or video file:

  1. Tell the user the file path and deliver/attach the file to them
  2. For images: show a preview or display the file if your platform supports inline rendering
  3. For videos: provide a way for the user to view or download the file
安全使用建议
Install only if you trust Agnes AI with your prompts and any images you choose to provide. Prefer setting AGNES_API_KEY as a session environment variable instead of pasting it into chat or saving it permanently; if you use ~/.agnes-ai/api_key, restrict file permissions and avoid using confidential images or private internal URLs unless you understand the provider’s handling and retention policies.
能力标签
requires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
The artifacts consistently describe and implement image/video generation through the Agnes AI API, including model selection, prompt submission, polling for video jobs, and saving returned media.
Instruction Scope
Instructions are scoped to Agnes generation tasks; prompts, image URLs, and selected local image files are sent to the Agnes service, which is expected for this purpose but should be clearer to users at the point of use.
Install Mechanism
The package contains documentation and a standard-library Python helper script, with no install hooks, dependency installation, background workers, or automatic execution during installation.
Credentials
Network access to apihub.agnes-ai.com and downloads of generated media are proportionate. Local image files supplied with --image are base64-encoded into the API request, and remote image URLs may be fetched by the provider.
Persistence & Privilege
The skill discloses persistence of the Agnes API key in ~/.agnes-ai/api_key as plain text and export into the current session. This is purpose-aligned but weaker than using a session-only environment variable or a protected credential store.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agnes-ai
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agnes-ai 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
**Adds support for Agnes AI's new high-density text-to-image model and image-to-image features.** - Introduced model selection for `agnes-image-2.1-flash` (optimized for high-information-density text-to-image) and clarified use cases for `agnes-image-2.0-flash` (image-to-image, multi-image composition). - Updated model usage guidance and API payload examples for text-to-image, image-to-image, and multi-image scenarios. - Documented recommended prompt structure and provided improved examples for both text-to-image and image-to-image tasks. - Expanded and clarified instructions on image generation, model selection logic, and parameter usage. - No functional or protocol/API changes; file structure unchanged.
v1.0.2
- Updated video model name from agnes-video-2.0 to agnes-video-v2.0 throughout documentation. - Refined formatting and minor technical descriptions for consistency and clarity. - No functional changes to code or API integration.
v1.0.1
fix the model name of video
v1.0.0
Initial release of agnes-ai skill for image and video generation. - Wraps the Agnes AI API to generate images or videos via simple commands. - Supports two models: agnes-image-2.0-flash (images) and agnes-video-2.0 (videos). - Uses an OpenAI-compatible protocol with authenticated API key. - Includes key management: prompts user for API key if not configured. - Bundled Python script (`scripts/generate.py`) automates API calls and handles polling for video generation. - Returns generated files, file paths, and previews where supported.
元数据
Slug agnes-ai
版本 1.0.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Agnes Ai 是什么?

Generate images or videos via Agnes AI API using user-provided prompts, handling API key setup, file download, and asynchronous video status polling. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 66 次。

如何安装 Agnes Ai?

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

Agnes Ai 是免费的吗?

是的,Agnes Ai 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Agnes Ai 支持哪些平台?

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

谁开发了 Agnes Ai?

由 Song Xianfeng(@songxf1024)开发并维护,当前版本 v1.0.3。

💬 留言讨论