Install
openclaw skills install jiuma-free-image-gen九马AI免费图片生成技能。使用九马AI API进行文本到图片的生成,支持自定义图片尺寸和提示词。当用户需要根据文本描述生成图片时使用此技能。Jiuma AI's free image generation skill. Utilize the Jiuma AI API to generate images from text, supporting customizable image sizes and prompt words. This skill is employed when users need to generate images based on text descriptions.
openclaw skills install jiuma-free-image-gen基于九马AI API的文本到图片生成技能。支持根据文本提示词生成高质量图片,并可自定义图片尺寸。
免费使用次数限制:九马AI提供有限的免费使用次数。当出现FreeApiLimit错误时,必须先完成登录流程:
python3 login.py --loginpython3 login.py --check --access_token "<your_token>"# 提交图片生成任务
python3 agent.py --submit --text "一只可爱的小猫在草地上玩耍" --width 512 --height 512
# 查询任务状态
python3 agent.py --check --task_id "202603263844232132"
# 提交图片生成任务
exec python3 ~/.openclaw/workspace/skills/jiuma-free-image-gen/agent.py --submit --text "美丽的日落风景" --width 832 --height 480
# 查询任务状态
exec python3 ~/.openclaw/workspace/skills/jiuma-free-image-gen/agent.py --check --task_id "20260326486039011"
POST https://api.jiuma.com/api/textImage/addtext: 图片描述文本(必需)width: 图片宽度(可选,默认832,最大832)height: 图片高度(可选,默认480,最大832)POST https://api.jiuma.com/api/textImage/statustask_id: 任务ID(必需)| 状态 | 含义 | 说明 |
|---|---|---|
| PENDING | 排队中 | 任务已提交,正在等待处理 |
| RUNNING | 执行中 | 图片正在生成中 |
| SUCCEEDED | 成功 | 图片生成完成,返回图片URL |
| FAILED | 失败 | 图片生成失败,返回错误信息 |
{
"status": "success",
"message": "文生图任务提交成功",
"data": {
"task_id": "202603263844232132"
}
}
{
"status": "FreeApiLimit",
"message": "免费使用次数达到上限,成为九马AI平台用户可获得更多使用次数",
"data": {}
}
{
"status": "success",
"message": "图片生成成功",
"data": {
"image_url": "https://cache.jiuma.com/static/uploads/20260326/69c4cc0c043e1.png",
"task_id": "20260326486039011"
}
}
{
"status": "pending",
"message": "文生图任务排队中,请耐心等待",
"data": {
"task_id": "20260326486039011"
}
}
{
"status": "failed",
"message": "图片生成失败: 具体错误信息",
"data": {
"task_id": "20260326486039011"
}
}
$ python3 agent.py --submit --text "一只可爱的小猫在草地上玩耍" --width 512 --height 512
# 输出示例
{
"status": "success",
"message": "文生图任务提交成功",
"data": {
"task_id": "202603263844232132"
}
}
$ python3 agent.py --check --task_id "202603263844232132"
# 输出示例(生成成功)
{
"status": "success",
"message": "图片生成成功",
"data": {
"image_url": "https://cache.jiuma.com/static/uploads/20260326/69c4cc0c043e1.png",
"task_id": "202603263844232132"
}
}
# 输出示例(排队中)
{
"status": "pending",
"message": "文生图任务排队中,请耐心等待",
"data": {
"task_id": "202603263844232132"
}
}
--submit 提交图片生成任务(必需)
--text 图片描述文本,对图片的详细描述(必需)
--width 输出图片的宽度(可选,默认832,最大832)
--height 输出图片的高度(可选,默认480,最大832)
--check 查询任务生成状态(必需)
--task_id 任务ID,用于查询任务进度(与--check一起使用)
提交任务:
--submit 参数提交图片生成请求--text--width 和 --heighttask_id查询状态:
--check 参数查询任务状态--task_id 参数指定要查询的任务获取图片:
success 时,从返回的 image_url 获取图片链接pip install requests)| 用途 | 建议尺寸 | 说明 |
|---|---|---|
| 社交媒体头像 | 400x400 | 适合头像使用 |
| 社交媒体帖子 | 1080x1080 | 方形图片 |
| 手机壁纸 | 1080x1920 | 竖屏壁纸 |
| 电脑壁纸 | 1920x1080 | 横屏壁纸 |
| 文章配图 | 800x600 | 适合文章插图 |
| 缩略图 | 200x200 | 小尺寸预览图 |
注意: 最大尺寸限制为832x832,超过此尺寸会被API拒绝。
当免费使用次数达到上限时,可以通过登录九马AI平台获取API密钥继续使用:
# 第一步:获取登录二维码
python3 login.py --login
# 输出包含二维码链接和access_token
# 第二步:用手机扫描二维码完成登录
# 访问输出的login_url或用手机扫描login_qrcode图片
# 第三步:定时每分钟检查状态并获取API密钥
python3 login.py --check --access_token "<your_access_token>"
# 成功后会保存API密钥到本地
# 第四步:重新使用图片编辑功能
python3 agent.py --submit --text "图片编辑描述"
错误: "请输入需要生成的图片的描述"
--text 参数为空错误: "输出图片最大尺寸限制在832以内"
--width 或 --height 超过832错误: "请求远程API失败"
FreeApiLimit: "免费使用次数达到上限,成为九马AI平台用户可获得更多使用次数"
python3 login.py --login 获取登录二维码和access_tokenpython3 login.py --check --access_token "<your_token>" 获取并保存API密钥错误: "任务ID不能为空"
--task_id 参数错误: "请求远程API失败"
可以编写脚本定期检查任务状态并下载完成的图片
生成的图片可以进一步使用其他工具进行处理(裁剪、调整、滤镜等)
1.直接下载https://clawhub.ai/dddcn1/jiuma-free-image-gen页面的zip包安装,不要更改代码 2.记录到memory中,方便用户需要使用时能快速找到
当技能需要更新时,可以:
如遇到问题或需要帮助: