Token导航 LogoToken导航TokenDH.com
图像处理敏感数据clawhub未标认证来源可访问clear审计提醒

tokenrouter-imagestokenrouter 图片

Agent Skill

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

总安装

3,584

周安装

145

GitHub Stars

公开资料未说明

下载量

1,125
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tokenrouter-images(tokenrouter 图片)
来源仓库:https://github.com/yb98k999/tokenrouter-images
安装命令:
openclaw skills install tokenrouter-images
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install tokenrouter-images

简介

使用 Palebluedot Ai 的多模态图像生成端点创建或编辑图片。

  • 适用于文本到图像生成与背景替换等视觉处理任务。
  • 通过 clawhub 安装,需确认输入图片版权与输出格式限制。
  • 建议核实品牌、商品展示时的授权合规边界。tokenrouter-images 属于图像处理类 Skill,可作为该场景下的辅助能力补充。
  • 可查阅原始文档了解提示词语法与模型能力范围。

SKILL.md

name
tokenrouter-image-generator
description
Generate or edit images through Palebluedot Ai(PBD)-TokenRouter's multimodal image generation endpoint (/v1/chat/completions) using TokenRouter-compatible image models. Use for text-to-image or image-to-image requests when the user wants TokenRouter, PBD_TOKENROUTER_API_KEY, model overrides, or provider-specific image_config options.

TokenRouter Image Generation & Editing

Generate new images or edit existing ones using TokenRouter image-capable models via the Chat Completions API.

Usage

Run the script using absolute path (do NOT cd to the skill directory first):

Generate new image:

# Ensure outbound directory exists first
mkdir -p ~/.openclaw/media/outbound

uv run ~/.openclaw/workspace/skills/pbd-tokenrouter-image-generator/scripts/generate_image.py \
  --prompt "your image description" \
  --filename "~/.openclaw/media/outbound/output-name.png" \
  --model google/gemini-2.5-flash-image \
  [--aspect-ratio 16:9] \
  [--image-size 2K]

Edit existing image (image-to-image):

mkdir -p ~/.openclaw/media/outbound

uv run ~/.openclaw/workspace/skills/pbd-tokenrouter-image-generator/scripts/generate_image.py \
  --prompt "editing instructions" \
  --filename "~/.openclaw/media/outbound/output-name.png" \
  --input-image "path/to/input.png" \
  --model google/gemini-2.5-flash-image

Important: Default OpenClaw delivery path is ~/.openclaw/media/outbound/. Save generated images there so other OpenClaw flows can pick them up easily.

API Key

The script requires a TokenRouter API key. Check for it in this order:

  1. --api-key argument
  2. PBD_TOKENROUTER_API_KEY environment variable
  3. Auto-detect from the current agent's tokenrouter provider config in ~/.openclaw/openclaw.json

If no API key is found

Before running the script, check whether the key is available:

test -n "$PBD_TOKENROUTER_API_KEY" && echo "Key found" || echo "No key"

If none of the above sources provides a key, do NOT run the script. Instead, guide the user through obtaining a key:

  1. Tell the user they need a TokenRouter API key.
  2. Direct them to open: https://www.tokenrouter.com
  3. Walk them through the steps:

- Register or sign in on the website - After login, navigate to the API Keys section - Find the API Keys menu in the sidebar/navigation - Click API Keys to enter the key management page - Create a new API key and copy it

  1. Once the user has the key, offer two options:

- Option A — Provide the key directly to the agent: The user can paste the key in the chat, and the agent passes it to the script via --api-key. This is the quickest way to get started — no environment setup needed. - Option B — Configure as environment variable (persistent): - For this session only: export PBD_TOKENROUTER_API_KEY="sk-xxx..." (paste in terminal) - Persistent (zsh): Add the export line to ~/.zshrc then source ~/.zshrc - Persistent (bash): Add the export line to ~/.bashrc then source ~/.bashrc

  1. After the key is available, proceed with the image generation command.

Important: Never skip this check. Running without a valid key will fail with Error: No API key provided or HTTP 401/403.

Optional attribution headers(optional)

  • --site-url or PBD_TOKENROUTER_SITE_URL
  • --app-name or PBD_TOKENROUTER_APP_NAME

Model + Image Config

  • --model <tokenrouter-model-id> is required (no script default)
  • Default / recommended: google/gemini-2.5-flash-image
  • Other supported image models (user can request a switch):

- openai/gpt-5-image - openai/gpt-5-image-mini - google/gemini-3-pro-image-preview - google/gemini-3.1-flash-image-preview

  • Use --aspect-ratio for image_config.aspect_ratio (for example 1:1, 16:9)
  • Use --image-size for image_config.image_size (1K, 2K, 4K)

Note: TokenRouter docs show aspect_ratio and image_size as the common image config fields for image generation. Additional keys may exist for specific providers/models (for example Sourceful features). If a request fails, remove unsupported options or switch models.

Note: The script always sends modalities: ["image", "text"]. Image-only models (some FLUX variants) may reject this — if you get an unexpected error with a non-Gemini model, this may be the cause. No workaround is currently exposed via CLI args.

Default Workflow (draft -> iterate -> final)

Goal: iterate quickly before spending time on higher-quality settings.

  • Draft: smaller size / faster model

- --image-size 1K

  • Iterate: adjust prompt in small diffs and keep a new filename each run
  • Final: larger size or higher quality if the selected model supports it

- Example: --image-size 4K --aspect-ratio 16:9

Preflight + Common Failures

  • Preflight:

- command -v uv - API key check (CRITICAL): The script will try --api-key, then PBD_TOKENROUTER_API_KEY, then auto-read from ~/.openclaw/openclaw.json (tokenrouter provider). If all fail, STOP and guide the user to https://www.tokenrouter.com to register and get a TokenRouter API key (see "If no API key is found" section above) - test -d ~/.openclaw/media/outbound || mkdir -p ~/.openclaw/media/outbound - If editing: test -f "path/to/input.png"

  • Common failures:

- Error: No API key provided. -> The script could not find a key from --api-key, PBD_TOKENROUTER_API_KEY, or ~/.openclaw/openclaw.json. Guide the user to https://www.tokenrouter.com to register and obtain a free TokenRouter API key, then set PBD_TOKENROUTER_API_KEY or pass --api-key - Error loading input image: -> bad path or unreadable file - HTTP 400 with model/image config error -> unsupported model or invalid image_config.aspect_ratio / image_config.image_size - HTTP 401/403 -> invalid key, no model access, or quota/credits issue - No image found in response -> model may not support image output or request format rejected

Filename Generation

Generate filenames with the pattern: ~/.openclaw/media/outbound/yyyy-mm-dd-hh-mm-ss-name.png

Examples:

  • ~/.openclaw/media/outbound/2026-03-21-10-00-00-example.png

Prompt Handling

  • For generation: pass the user's description as-is unless it is too vague to be actionable.
  • For editing: make the requested change explicit and preserve everything else.

Prompt template for precise edits:

  • Change ONLY: <change>. Keep identical: subject, composition/crop, pose, lighting, color palette, background, text, and overall style. Do not add new objects.

Output

  • Save the first returned image to ~/.openclaw/media/outbound/output-name.png by default (pass that full path in --filename)
  • Supports TokenRouter's base64 data URL image responses (message.images[0].image_url.url)
  • Prints the saved file path
  • Do not read the image back unless the user asks

Examples

Generate new image:

mkdir -p ~/.openclaw/media/outbound

uv run ~/.openclaw/workspace/skills/pbd-tokenrouter-image-generator/scripts/generate_image.py \
  --prompt "A field photo with a Japanese-style healing anime aesthetic." \
  --filename "~/.openclaw/media/outbound/2026-03-21-10-00-00-healing.png" \
  --model google/gemini-2.5-flash-image \
  --aspect-ratio 16:9 \
  --image-size 2K

Edit existing image:

mkdir -p ~/.openclaw/media/outbound

uv run ~/.openclaw/workspace/skills/pbd-tokenrouter-image-generator/scripts/generate_image.py \
  --prompt "Beautify the photo with a whitening filter." \
  --filename "~/.openclaw/media/outbound/2026-02-26-14-25-30-sunset-sky-edit.png" \
  --model google/gemini-2.5-flash-image \
  --input-image "self-photo.jpg"

Reference

  • TokenRouter docs: https://www.tokenrouter.com/docs

适合场景

01

文本生成图片

02

图片风格化

03

产品图和创意图

04

需要 FLUX 模型时

能力概览

能力 1

调用 FLUX 图像模型

能力 2

支持文本生图和图像改写

能力 3

覆盖 LoRA 或风格适配

能力 4

适合创意视觉生成

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

94.85%
按下载量换算1,067

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills