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

openrouter-image-genopenrouter 图像生成器

Agent Skill

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

总安装

18,393

周安装

782

GitHub Stars

公开资料未说明

下载量

6,444
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install openrouter-image-gen

简介

通过 OpenRouter API 调用 Google Gemini 模型生成图像,支持文本到图像和参考图引导生成。

  • 适用于需要根据文字描述创建图片、编辑视觉内容或整合图像工具流的场景。
  • 使用时需提供清晰提示词,并注意输出格式与模型能力限制。
  • 涉及人物、品牌等素材时需确认版权授权和内容合规性。
  • 安装命令:openclaw skills install openrouter-image-gen

SKILL.md

name
gemini-image-gen
description
Generate images using Google Gemini via OpenRouter API. Supports text-to-image and reference-image-guided generation. Use when the user asks to generate, create, draw, or design images/illustrations/covers/avatars.

Gemini Image Generation

Generate images via google/gemini-3.1-flash-image-preview on OpenRouter. Cheap ($0.25/M in, $1.5/M out), fast, good quality.

Quick Start

python3 scripts/generate.py "a watercolor illustration of a cozy café" -o output.png

With reference image (style/character guidance):

python3 scripts/generate.py "same character but waving hello" -o wave.png --ref reference.png

Script path: skills/gemini-image-gen/scripts/generate.py

Requirements

  • OPENROUTER_API_KEY environment variable (or --api-key flag)
  • Python 3.10+ (stdlib only, no pip installs needed)

How It Works

  1. Calls OpenRouter /chat/completions with modalities: ["text", "image"]
  2. Optionally encodes a reference image as base64 in the message
  3. Extracts generated image from choices[0].message.images[0].image_url.url (data:image/png;base64,...)
  4. Decodes and saves to output path

Prompt Engineering Tips (from experience)

Aspect Ratio & Composition

  • Gemini respects aspect ratio instructions in the prompt
  • For vertical (e.g. phone wallpaper, Xiaohongshu cover): add "vertical composition, 3:4 aspect ratio"
  • For horizontal (e.g. banner): add "horizontal composition, 16:9 aspect ratio"
  • For square: add "square composition, 1:1 aspect ratio"
  • Always specify — without it, Gemini defaults to roughly square and may crop awkwardly

Character Consistency

  • When using --ref, describe the character features explicitly in the prompt AND provide the reference image
  • Key details to specify: hair color/style, eye color, clothing, accessories, expression
  • Example: "same character from reference: silver-to-ice-blue gradient shoulder-length hair, ice-blue eyes, cream cardigan over light blue shirt, snowflake earring"
  • Gemini is decent at maintaining consistency but drifts on small details — always re-specify distinguishing features

Style Control

  • Name the art style explicitly: "soft watercolor illustration", "anime cel-shading", "photorealistic", "flat vector", "oil painting"
  • For warm/cozy tone: "warm color palette, cream and peach gradient background, bokeh light spots"
  • For dark/moody: "dark gradient background, deep navy to black, subtle glow effects"
  • Mentioning a well-known art style works: "in the style of Studio Ghibli", "Makoto Shinkai lighting"

Text in Images

  • Gemini can render short text in images but it's unreliable for CJK characters
  • For English text: works reasonably well if you specify font style ("bold sans-serif", "handwritten script")
  • For Chinese/Japanese: avoid — it usually garbles characters. Add text overlays with a separate tool (e.g. ImageMagick, Pillow) instead

Common Pitfalls

  • Body proportions: Gemini sometimes compresses/distorts figures. Add "natural human body proportions, do not squash or stretch" for character art
  • Hands: Still a weak spot. Minimize visible hands or describe hand pose explicitly
  • Multiple subjects: More than 2-3 subjects increases inconsistency. Keep scenes focused
  • Batch generation: For generating multiple variations, run the script multiple times — each call is independent. Do NOT ask for "4 options" in one prompt

Sending Images on Feishu

⚠️ Critical: Images must be saved to a path within localRoots (typically your OpenClaw workspace dir). /tmp is NOT whitelisted on Feishu.

# Save to workspace, not /tmp
output_path = "my_image.png"  # relative to workspace

# Send via message tool:
#   media: "file://<workspace_path>/my_image.png"
#   (use 'media' parameter, NOT 'filePath')

After sending, clean up temporary images to avoid workspace clutter.

Advanced: Calling from Python (without CLI)

import os, sys
sys.path.insert(0, "skills/gemini-image-gen/scripts")
from generate import generate

generate(
    prompt="a cute robot reading a philosophy book",
    output="robot.png",
    ref_image=None,  # or path to reference image
)

Model Alternatives

ModelCostNotes
google/gemini-3.1-flash-image-preview$0.25/$1.5 per M tokensDefault. Best balance of cost and quality
google/gemini-3.1-pro-preview$2/$12 per M tokensHigher quality but 8x more expensive
openai/gpt-image-1variesOpenAI's image model, different API format — not supported by this script

Troubleshooting

  • "No image in response": Check .debug.json file created alongside output. Usually means the prompt triggered safety filters or the model returned text-only.
  • Garbled/distorted output: Try rephrasing. Add "high quality, detailed" and be more specific about composition.
  • API error 429: Rate limited. Wait 30s and retry.
  • API error 402: Insufficient credits on OpenRouter.

适合场景

01

文本生成图片

02

图片风格化

03

产品图和创意图

04

需要 FLUX 模型时

能力概览

能力 1

调用 FLUX 图像模型

能力 2

支持文本生图和图像改写

能力 3

覆盖 LoRA 或风格适配

能力 4

适合创意视觉生成

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

平台分布

OpenClaw

75.67%
按下载量换算4,876

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills