Token导航 LogoToken导航TokenDH.com
图像处理只读clawhub未标认证来源可访问clear审计通过

text-to-image文本到图像

Agent Skill

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

总安装

13,758

周安装

562

GitHub Stars

公开资料未说明

下载量

4,406
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install text-to-image

简介

将纯文本渲染为图像并返回本地图像文件路径,支持样式控制。

  • 适用于需要从文字生成视觉素材的 Agent 工作流,如插图、背景图等。
  • 输入文本提示后可获取临时图像路径或数据 URI,便于后续处理。
  • 安装命令:openclaw skills install text-to-image,需确认模型限制与输出格式。
  • 涉及人物、品牌或商品图像时,应额外核对授权与真实性边界。

SKILL.md

name
text-to-image
description
Render text into an image and return a temporary local image file path, with optional data URI. Use when Clawhub or Codex needs to convert plain text, styled text, colored text, multilingual text, slogans, posters, captions, or text snippets into an image with controllable width, height, format, font size, full-text color, or partial text colors. Support svg, png, jpg, and jpeg output, return a real temp file path under the skill tmp folder, and work across Windows and macOS with built-in font fallback. Also use for 文本转图片、文字转图片、生成文字海报、彩色文字图片、指定尺寸文字图、局部文字颜色、高亮部分文字、输出临时图片地址、返回本地图片路径、返回 image 文件路径、指定 svg/png/jpg 格式、Mac 兼容、Windows 兼容、return temp file path, local image path, or data URI output.

Text to Image

Use scripts/render_text_image.py to generate an image and return a local file path. The script can also include a data: image URL when needed.

Prefer the script over hand-writing image payloads. The script already handles:

  • fixed image width and height
  • output format: svg, png, jpg, jpeg
  • temp file output by default under tmp/
  • absolute and relative file paths in the response
  • file path, file name, and file size in the response
  • whole-text color
  • partial text colors through friendly highlight fields or raw segments
  • explicit font size
  • automatic font-size fitting when font_size is omitted
  • newline-aware wrapping
  • transparent or solid backgrounds
  • Windows and macOS font fallback

Input Shape

Pass a JSON spec through --spec-json or --spec-file.

Supported fields:

{
  "text": "Hello\
World",
  "highlight_ranges": [
    { "start": 0, "end": 5, "color": "#111111" },
    { "start": 6, "end": 11, "color": "#ff4d4f" }
  ],
  "highlight_texts": [
    { "match": "World", "color": "#1677ff", "occurrence": "all", "case_sensitive": true }
  ],
  "segments": [
    { "text": "Hello ", "color": "#111111" },
    { "text": "World", "color": "#ff4d4f" }
  ],
  "width": 1200,
  "height": 630,
  "format": "png",
  "font_size": 72,
  "min_font_size": 12,
  "default_color": "#111111",
  "background": "#ffffff",
  "padding": 48,
  "line_height": 1.2,
  "align": "center",
  "valign": "middle",
  "font_family": "Microsoft YaHei, PingFang SC, Arial, sans-serif"
}

Rules:

  • Provide either text or segments. If both are present, segments wins.
  • Prefer text + highlight_texts for simple "make this word red" requests.
  • Use highlight_ranges when the caller knows character positions.
  • Use segments only when the caller already has exact pieces split out.
  • Keep `\

` when a hard line break is required.

  • Omit font_size to make the script auto-fit the whole text inside the image.
  • If font_size is provided, the script keeps that size and still wraps lines as needed.
  • svg is the default format.
  • Prefer png over jpg for text-heavy images.
  • If format is jpg or jpeg, transparent background is converted to white.

Priority:

  1. segments
  2. text + highlight_ranges / highlight_texts
  3. text only

Friendly highlight format:

{
  "text": "ClawHub makes text visible",
  "highlight_texts": [
    { "match": "ClawHub", "color": "#1677ff" },
    { "match": "visible", "color": "#fa541c" }
  ]
}

Range format:

{
  "text": "Hello World",
  "highlight_ranges": [
    { "start": 6, "end": 11, "color": "#ff4d4f" }
  ]
}

Recommended Workflow

  1. Build the JSON spec from the user's request.
  2. Run the script.
  3. Return file_path to the caller when the next step is file upload.
  4. Use image_url only when the caller explicitly needs a data URI.

Example:

@'
{
  "segments": [
    { "text": "Claw", "color": "#111111" },
    { "text": "Hub", "color": "#1677ff" }
  ],
  "width": 1024,
  "height": 512,
  "format": "png",
  "background": "#ffffff",
  "padding": 40
}
'@ | Set-Content spec.json

python scripts/render_text_image.py --spec-file spec.json --no-data-url

Output Contract

The script prints JSON:

{
  "file_path": "E:\\clawhub\\	ext-to-image\\	mp\\
endered-0000.png",
  "relative_file_path": "tmp/rendered-0000.png",
  "file_name": "rendered-0000.png",
  "file_size": 21550,
  "mime_type": "image/png",
  "format": "png",
  "width": 1024,
  "height": 512,
  "font_size": 96.0,
  "line_count": 1,
  "resolved_segments": [
    { "text": "Claw", "color": "#111111" },
    { "text": "Hub", "color": "#1677ff" }
  ]
}

Notes

  • svg is lightweight, crisp, and ideal for text rendering.
  • png is the best general-purpose bitmap choice for text images.
  • jpg is supported for compatibility, but it is usually not the best default for text.
  • Auto-fit uses width-aware wrapping and a font-size search; it is approximate but reliable for mixed Chinese and Latin text.
  • The script writes files to the skill's own tmp/ folder by default.
  • Pass --output path.ext to control where the file is written.
  • Pass --no-data-url when the caller only needs upload-ready file metadata.
  • On macOS the script tries system fonts such as PingFang and STHeiti before falling back.
  • On Windows the script tries fonts such as Microsoft YaHei, SimHei, and Arial.
  • Reusable sample specs live in testcases/, including 13-wrap-example.json for fixed-size wrapping.

适合场景

01

文本生成图片

02

图片风格化

03

产品图和创意图

04

需要 FLUX 模型时

能力概览

能力 1

调用 FLUX 图像模型

能力 2

支持文本生图和图像改写

能力 3

覆盖 LoRA 或风格适配

能力 4

适合创意视觉生成

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

平台分布

OpenClaw

80.21%
按下载量换算3,534

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

来源信息

继续浏览同类 Skills