返回顶部
c

clawdy-selfie爪迪自拍

Generate and send selfies of Clawdy across messaging platforms using xAI Grok Imagine via fal.ai

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
106
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

clawdy-selfie

Clawdy Selfie

使用Clawdy的参考图像生成自拍,并通过OpenClaw跨消息平台(WhatsApp、Telegram、Discord、Slack等)发送。使用xAI的Grok Imagine模型进行图像编辑。

参考图像

该技能使用托管在jsDelivr CDN上的固定参考图像:

https://cdn.jsdelivr.net/gh/X-RayLuan/Clawdy-YourBoyfriend@main/assets/clawdy.png

使用时机

  • - 用户说发张照片、给我发张照片、发张图片、发张自拍
  • 用户说发一张你的照片...、发一张你的自拍...
  • 用户问你在做什么?、你怎么样?、你在哪里?
  • 用户描述场景:发一张穿着...的照片、发一张在...的照片
  • 用户希望Clawdy以特定服装、地点或情境出现

快速参考

必需的环境变量

bash
FALKEY=yourfalapikey # 从 https://fal.ai/dashboard/keys 获取
OPENCLAWGATEWAYTOKEN=your_token # 来源:openclaw doctor --generate-gateway-token

工作流程

  1. 1. 获取用户提示,了解如何编辑图像
  2. 通过fal.ai Grok Imagine Edit API编辑图像,使用固定参考图像
  3. 从响应中提取图像URL
  4. 发送到OpenClaw,指定目标频道

分步说明

步骤1:收集用户输入

向用户询问:

  • - 用户场景:图像中的人物应该做什么/穿什么/在哪里?
  • 模式(可选):mirror(镜像)或direct(直接)自拍风格
  • 目标频道:发送到哪里?(例如:#general、@username、频道ID)
  • 平台(可选):哪个平台?(discord、telegram、whatsapp、slack)

提示模式

模式1:镜像自拍(默认)

最适合:服装展示、全身照、时尚内容

make a pic of this person, but [用户场景]. the person is taking a mirror selfie

示例:wearing a leather jacket →

make a pic of this person, but wearing a leather jacket. the person is taking a mirror selfie

模式2:直接自拍

最适合:特写肖像、地点照片、情感表达

a close-up selfie taken by himself at [用户场景], direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arms length, face fully visible

示例:a cozy cafe with warm lighting →

a close-up selfie taken by himself at a cozy cafe with warm lighting, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arms length, face fully visible

模式选择逻辑

请求中的关键词自动选择模式
outfit, wearing, clothes, jacket, suit, fashionmirror
cafe, restaurant, beach, park, city, location
direct | | close-up, portrait, face, eyes, smile | direct | | full-body, mirror, reflection | mirror |

步骤2:使用Grok Imagine编辑图像

使用fal.ai API编辑参考图像:

bash
REFERENCE_IMAGE=https://cdn.jsdelivr.net/gh/X-RayLuan/Clawdy-YourBoyfriend@main/assets/clawdy.png

模式1:镜像自拍

PROMPT=make a pic of this person, but <用户场景>. the person is taking a mirror selfie

模式2:直接自拍

PROMPT=a close-up selfie taken by himself at <用户场景>, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arms length, face fully visible

使用jq构建JSON负载(正确处理转义)

JSON_PAYLOAD=$(jq -n \ --arg imageurl $REFERENCEIMAGE \ --arg prompt $PROMPT \ {imageurl: $imageurl, prompt: $prompt, numimages: 1, outputformat: jpeg})

curl -X POST https://fal.run/xai/grok-imagine-image/edit \
-H Authorization: Key $FAL_KEY \
-H Content-Type: application/json \
-d $JSON_PAYLOAD

响应格式:
json
{
images: [
{
url: https://v3b.fal.media/files/...,
content_type: image/jpeg,
width: 1024,
height: 1024
}
],
revised_prompt: 增强的提示文本...
}

步骤3:通过OpenClaw发送图像

使用OpenClaw消息API发送编辑后的图像:

bash
openclaw message send \
--action send \
--channel <目标频道> \
--message <说明文字> \
--media <图像URL>

替代方案:直接API调用
bash
curl -X POST http://localhost:18789/message \
-H Authorization: Bearer $OPENCLAWGATEWAYTOKEN \
-H Content-Type: application/json \
-d {
action: send,
channel: <目标频道>,
message: <说明文字>,
media: <图像URL>
}

完整脚本示例

bash
#!/bin/bash

clawdy-selfie-send.sh

检查必需的环境变量

if [ -z $FAL_KEY ]; then echo 错误:未设置FAL_KEY环境变量 exit 1 fi

固定参考图像

REFERENCE_IMAGE=https://cdn.jsdelivr.net/gh/X-RayLuan/Clawdy-YourBoyfriend@main/assets/clawdy.png

USER_CONTEXT=$1
CHANNEL=$2
MODE=${3:-auto} # mirror、direct或auto
CAPTION=${4:-使用Grok Imagine编辑}

if [ -z $USER_CONTEXT ] || [ -z $CHANNEL ]; then
echo 用法:$0 <用户场景> <频道> [模式] [说明]
echo 模式:mirror、direct、auto(默认)
echo 示例:$0 wearing a leather jacket #general mirror
echo 示例:$0 a cozy cafe #general direct
exit 1
fi

根据关键词自动检测模式

if [ $MODE == auto ]; then if echo $USER_CONTEXT | grep -qiE outfit|wearing|clothes|jacket|suit|fashion|full-body|mirror; then MODE=mirror elif echo $USER_CONTEXT | grep -qiE cafe|restaurant|beach|park|city|close-up|portrait|face|eyes|smile; then MODE=direct else MODE=mirror # 默认 fi echo 自动检测模式:$MODE fi

根据模式构建提示

if [ $MODE == direct ]; then EDITPROMPT=a close-up selfie taken by himself at $USERCONTEXT, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arms length, face fully visible else EDITPROMPT=make a pic of this person, but $USERCONTEXT. the person is taking a mirror selfie fi

echo 模式:$MODE
echo 使用提示编辑参考图像:$EDIT_PROMPT

编辑图像(使用jq进行正确的JSON转义)

JSON_PAYLOAD=$(jq -n \ --arg imageurl $REFERENCEIMAGE \ --arg prompt $EDIT_PROMPT \ {imageurl: $imageurl, prompt: $prompt, numimages: 1, outputformat: jpeg})

RESPONSE=$(curl -s -X POST https://fal.run/xai/grok-imagine-image/edit \
-H Authorization: Key $FAL_KEY \
-H Content-Type: application/json \
-d $JSON_PAYLOAD)

提取图像URL

IMAGE_URL=$(echo $RESPONSE | jq -r .images[0].url)

if [ $IMAGEURL == null ] || [ -z $IMAGEURL ]; then
echo 错误:编辑图像失败
echo 响应:$RESPONSE
exit

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 clawdy-selfie-1775944543 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 clawdy-selfie-1775944543 技能

通过命令行安装

skillhub install clawdy-selfie-1775944543

下载

⬇ 下载 clawdy-selfie v1.0.0(免费)

文件大小: 8.32 KB | 发布时间: 2026-4-12 09:26

v1.0.0 最新 2026-4-12 09:26
Initial ClawHub publish: fixed-reference Clawdy selfie skill using fal/xAI image edit.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部