suhe Selfie
Edit a fixed reference image using Alibaba's Tongyi Wanxiang model and distribute it across messaging platforms (WhatsApp, Telegram, Discord, Slack, etc.) via OpenClaw.
Reference Image
The skill uses a fixed reference image hosted on jsDelivr CDN:
CODEBLOCK0
When to Use
- - User says "send a pic", "send me a pic", "send a photo", "send a selfie"
- User says "send a pic of you...", "send a selfie of you..."
- User asks "what are you doing?", "how are you doing?", "where are you?"
- User describes a context: "send a pic wearing...", "send a pic at..."
- User wants suhe to appear in a specific outfit, location, or situation
Quick Reference
Required Environment Variables
CODEBLOCK1
Workflow
- 1. Get user prompt for how to edit the image
- Edit image via DashScope Tongyi Wanxiang API with fixed reference
- Extract image URL from response
- Send to OpenClaw with target channel(s)
Step-by-Step Instructions
Step 1: Collect User Input
Ask the user for:
- - User context: What should the person in the image be doing/wearing/where?
- Mode (optional):
mirror or direct selfie style - Target channel(s): Where should it be sent? (e.g.,
#general, @username, channel ID) - Platform (optional): Which platform? (discord, telegram, whatsapp, slack)
Prompt Modes
Mode 1: Mirror Selfie (default)
Best for: outfit showcases, full-body shots, fashion content
CODEBLOCK2
Example (with Chinese cultural context): "wearing a traditional qipao" →
CODEBLOCK3
Example: "wearing a santa hat" →
CODEBLOCK4
Mode 2: Direct Selfie
Best for: close-up portraits, location shots, emotional expressions
CODEBLOCK5
Example: "a cozy cafe with warm lighting" →
CODEBLOCK6
Mode Selection Logic
| Keywords in Request | Auto-Select Mode |
|---|
| outfit, wearing, clothes, dress, suit, fashion | INLINECODE4 |
| cafe, restaurant, beach, park, city, location |
direct |
| close-up, portrait, face, eyes, smile |
direct |
| full-body, mirror, reflection |
mirror |
Step 2: Edit Image with Tongyi Wanxiang
Use the DashScope API to edit the reference image:
CODEBLOCK7
Response Format:
CODEBLOCK8
Step 3: Send Image via OpenClaw
Use the OpenClaw messaging API to send the edited image:
CODEBLOCK9
Alternative: Direct API call
CODEBLOCK10
Complete Script Example
CODEBLOCK11
Node.js/TypeScript Implementation
CODEBLOCK12
Supported Platforms
OpenClaw supports sending to:
| Platform | Channel Format | Example |
|---|
| Discord | INLINECODE8 or channel ID | INLINECODE9 , INLINECODE10 |
| Telegram |
@username or chat ID |
@mychannel,
-100123456 |
| WhatsApp | Phone number (JID format) |
1234567890@s.whatsapp.net |
| Slack |
#channel-name |
#random |
| Signal | Phone number |
+1234567890 |
| MS Teams | Channel reference | (varies) |
Tongyi Wanxiang Edit Parameters
| Parameter | Type | Default | Description |
|---|
| INLINECODE18 | string | "wanx-v1-edit" | Model to use: "wanx-v1" (generate) or "wanx-v1-edit" (edit) |
| INLINECODE19 |
string | required | Edit instruction |
|
input.reference_image_url | string | optional | URL of reference image for editing |
|
parameters.n | 1-4 | 1 | Number of images to generate |
|
parameters.size | string | "1024
1024" | Image size format: "widthheight" |
Setup Requirements
1. Get DashScope API Key
Visit
https://dashscope.console.aliyun.com/ to create your API key.
2. Configure Environment Variables
CODEBLOCK13
2. Install OpenClaw CLI
CODEBLOCK14
3. Configure OpenClaw Gateway
CODEBLOCK15
4. Start OpenClaw Gateway
CODEBLOCK16
Error Handling
- - DASHSCOPEAPIKEY missing: Ensure the API key is set in environment
- Image edit failed: Check prompt content and API quota at DashScope Console
- OpenClaw send failed: Verify gateway is running and channel exists
- Rate limits: DashScope has rate limits; implement retry logic if needed
Pricing Information
Tongyi Wanxiang offers:
Tips
- 1. Mirror mode context examples (outfit focus):
- "wearing a traditional qipao with golden embroidery"
- "in a hanfu with flowing sleeves"
- "wearing a modern cheongsam"
- "in traditional Chinese dress"
- 2. Direct mode context examples (location/portrait focus):
- "a traditional tea house in Hangzhou"
- "West Lake in spring with cherry blossoms"
- "a quiet bamboo garden"
- "an ancient Chinese temple"
- 3. Mode selection: Let auto-detect work, or explicitly specify for control
- Batch sending: Edit once, send to multiple channels
- Scheduling: Combine with OpenClaw scheduler for automated posts
Chinese Cultural Context
For best results with Tongyi Wanxiang, consider using prompts with:
- - Traditional clothing keywords: qipao (旗袍), hanfu (汉服), cheongsam
- Cultural settings: tea house (茶馆), garden (园林), temple (寺庙), West Lake (西湖)
- Traditional elements: lantern (灯笼), fan (扇子), brush pen (毛笔), guqin (古琴)
suhe 自拍
使用阿里巴巴的通义万相模型编辑固定参考图像,并通过 OpenClaw 将其分发到消息平台(WhatsApp、Telegram、Discord、Slack 等)。
参考图像
该技能使用托管在 jsDelivr CDN 上的固定参考图像:
http://pic.lilozkzy.top/reference/suhe-portrait.png
使用时机
- - 用户说“发张照片”、“给我发张照片”、“发张图片”、“发张自拍”
- 用户说“发一张你的照片……”、“发一张你的自拍……”
- 用户问“你在做什么?”、“你好吗?”、“你在哪里?”
- 用户描述场景:“发一张穿着……的照片”、“发一张在……的照片”
- 用户希望 suhe 出现在特定的服装、地点或情境中
快速参考
必需的环境变量
bash
DASHSCOPEAPIKEY=yourdashscopekey # 从 https://dashscope.console.aliyun.com/ 获取
OPENCLAWGATEWAYTOKEN=your_token # 来自:openclaw doctor --generate-gateway-token
工作流程
- 1. 获取用户提示,了解如何编辑图像
- 通过 DashScope 通义万相 API 编辑图像,使用固定参考
- 从响应中提取图像 URL
- 发送到 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
示例(中文文化背景):“穿着传统旗袍” →
make a pic of this person, but wearing a traditional qipao. the person is taking a mirror selfie
示例:“戴着圣诞帽” →
make a pic of this person, but wearing a santa hat. the person is taking a mirror selfie
模式 2:直接自拍
最适合:特写肖像、地点拍摄、情感表达
a close-up selfie taken by herself 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 close-up selfie taken by herself 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、dress、suit、fashion | mirror |
| cafe、restaurant、beach、park、city、location |
direct |
| close-up、portrait、face、eyes、smile | direct |
| full-body、mirror、reflection | mirror |
步骤 2:使用通义万相编辑图像
使用 DashScope API 编辑参考图像:
bash
REFERENCE_IMAGE=https://pic.lilozkzy.top/reference/suhe-portrait.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 herself 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
构建通义万相编辑的 JSON 负载
JSON_PAYLOAD=$(jq -n \
--arg prompt $PROMPT \
--arg ref
url $REFERENCEIMAGE \
{
model: wanx-v1-edit,
input: {
prompt: $prompt,
reference
imageurl: $ref_url
},
parameters: {
n: 1,
size: 1024*1024
}
})
curl -X POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image-generation/generation \
-H Authorization: Bearer $DASHSCOPEAPIKEY \
-H Content-Type: application/json \
-d $JSON_PAYLOAD
响应格式:
json
{
output: {
results: [
{
url: https://dashscope-result.oss-cn-shanghai.aliyuncs.com/...
}
]
},
usage: {
image_count: 1
},
request_id: ...
}
步骤 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
tongyi-wanxiang-edit-send.sh
检查必需的环境变量
if [ -z $DASHSCOPE
APIKEY ]; then
echo 错误:未设置 DASHSCOPE
APIKEY 环境变量
exit 1
fi
固定参考图像
REFERENCE_IMAGE=https://pic.lilozkzy.top/reference/suhe-portrait.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 戴着牛仔帽 #general mirror
echo 示例:$0 一个舒适的咖啡馆 #general direct
exit 1
fi
根据关键词自动检测模式
if [ $MODE == auto ]; then
if echo $USER_CONTEXT | grep -qiE outfit|wearing|clothes|dress|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
EDIT
PROMPT=a close-up selfie taken by herself 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
EDIT
PROMPT=make a pic of this person, but $USERCONTEXT. the person is taking a mirror selfie
fi
echo 模式:$MODE
echo 使用提示编辑参考图像:$EDIT_PROMPT
使用通义万相编辑 API 编辑图像
JSON_PAYLOAD=$(jq -n \
--arg prompt $EDIT_PROMPT \
--arg ref
url $REFERENCEIMAGE \
{
model: wanx-v1-edit,
input: {
prompt: $prompt,
reference
imageurl: $ref_url
},
parameters: {
n: 1,
size: 1024*1024
}
})
RESPONSE=$(curl -s -X POST https://dashscope.aliyuncs