Jimeng-Image
When to use this skill
Use this skill when user express "You need generate a image".
How to use this skill
- 1. You need putAccess Key and Secret Key via either environment variable:
Jimeng_Secret_Key and Jimeng_Access_Key=..., or~/.openclaw/.env line: Jimeng_Secret_Key=... and Jimeng_Access_Key=... on your environment variable.
- 2. You need to execute scripts/main.py
- When the response is arrive, the script will save the png file on ~/.openclaw/workspace/images. (The script will create images dir if the images dir is not exist)
- Finally, you need send the new image to user by same channel,such as qqbot etc. from ~/.openclaw/workspace/images
Requirement
- - argparse
- datetime
- volcengine-python-sdk
- base64
- os
If not exits ,you need pip it.
Tips:
- - the baseDir is your workspace /skills/Jimeng-Image
- If the user does not specify the output path,the output dir is ~/.openclaw/workspace/images
Command example
user:
i need a image by prompt:"A girl in an anime style"
You:
Run from the OpenClaw workspace:
CODEBLOCK0
user:
i need a image by prompt:"A girl in an anime style and width is 512 and height is 512"
You:
Run from the OpenClaw workspace:
CODEBLOCK1
The Script command line parameter
| 参数 | 类型 | 默认值 | 说明 |
|---|
| INLINECODE5 | INLINECODE6 | INLINECODE7 | Path of the prompt file |
| INLINECODE8 |
str |
'~/.openclaw/workspace/images' | The saving path of the output file |
|
--use_pre_llm |
bool |
False | Whether to use a pre-trained language model |
|
--seed |
int |
-1 | Random seed (
-1 indicates random ) |
|
--scale |
float |
1.0 | The scaling ratio of the output image |
|
--width |
int |
1920 | The width (in pixels) of the output image |
|
--height |
int |
1080 | The height (in pixels) of the output image |
Jimeng-Image
何时使用此技能
当用户表达你需要生成一张图片时,使用此技能。
如何使用此技能
- 1. 您需要通过环境变量设置访问密钥和秘密密钥:JimengSecretKey 和 JimengAccessKey=...,或在 ~/.openclaw/.env 文件中添加以下行:JimengSecretKey=... 和 JimengAccessKey=...。
- 2. 您需要执行 scripts/main.py 脚本
- 当响应到达时,脚本会将 PNG 文件保存到 ~/.openclaw/workspace/images 目录下。(如果 images 目录不存在,脚本会自动创建)
- 最后,您需要通过相同的渠道(如 QQ 机器人等)将新生成的图片从 ~/.openclaw/workspace/images 发送给用户
依赖要求
- - argparse
- datetime
- volcengine-python-sdk
- base64
- os
如果缺少依赖,请使用 pip 安装。
提示:
- - 基础目录为您的工作空间 /skills/Jimeng-Image
- 如果用户未指定输出路径,默认输出目录为 ~/.openclaw/workspace/images
命令示例
用户:
我需要一张图片,提示词为:一个动漫风格的女孩子
您:
在 OpenClaw 工作空间中运行:
sh
python3 {baseDir}/scripts/main.py --prompt 一个动漫风格的女孩子
用户:
我需要一张图片,提示词为:一个动漫风格的女孩子,宽度为512,高度为512
您:
在 OpenClaw 工作空间中运行:
python3 {baseDir}/scripts/main.py --prompt 一个动漫风格的女孩子 --width 512 --height 512
脚本命令行参数
| 参数 | 类型 | 默认值 | 说明 |
|---|
| --prompt | str | none | 提示词文件路径 |
| --output_path |
str | ~/.openclaw/workspace/images | 输出文件的保存路径 |
| --use
prellm | bool | False | 是否使用预训练语言模型 |
| --seed | int | -1 | 随机种子(-1 表示随机) |
| --scale | float | 1.0 | 输出图像的缩放比例 |
| --width | int | 1920 | 输出图像的宽度(像素) |
| --height | int | 1080 | 输出图像的高度(像素) |