clawra-selfie
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseClawra Selfie
Clawra 自拍
Edit a fixed reference image using xAI's Grok Imagine model and distribute it across messaging platforms (WhatsApp, Telegram, Discord, Slack, etc.) via OpenClaw.
使用xAI的Grok Imagine模型编辑一张固定参考图片,并通过OpenClaw将其分发至各类消息平台(WhatsApp、Telegram、Discord、Slack等)。
Reference Image
参考图片
The skill uses a fixed reference image hosted on jsDelivr CDN:
https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png本技能使用托管在jsDelivr CDN上的固定参考图片:
https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.pngWhen 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 Clawra to appear in a specific outfit, location, or situation
- 用户说“发张图片”、“给我发张图片”、“发张照片”、“发自拍”
- 用户说“发一张你的照片...”、“发一张你的自拍...”
- 用户询问“你在做什么?”、“你过得怎么样?”、“你在哪里?”
- 用户描述场景:“发一张穿着...的照片”、“发一张在...的照片”
- 用户希望Clawra出现在特定服装、地点或场景中
Quick Reference
快速参考
Required Environment Variables
所需环境变量
bash
FAL_KEY=your_fal_api_key # Get from https://fal.ai/dashboard/keys
OPENCLAW_GATEWAY_TOKEN=your_token # From: openclaw doctor --generate-gateway-tokenbash
FAL_KEY=your_fal_api_key # 从 https://fal.ai/dashboard/keys 获取
OPENCLAW_GATEWAY_TOKEN=your_token # 通过以下命令生成:openclaw doctor --generate-gateway-tokenWorkflow
工作流程
- Get user prompt for how to edit the image
- Edit image via fal.ai Grok Imagine Edit API with fixed reference
- Extract image URL from response
- Send to OpenClaw with target channel(s)
- 获取用户提示,了解图片编辑需求
- 编辑图片:通过fal.ai Grok Imagine Edit API结合固定参考图片进行编辑
- 提取图片URL:从API响应中获取编辑后的图片链接
- 通过OpenClaw发送:将图片发送至目标渠道
Step-by-Step Instructions
分步说明
Step 1: Collect User Input
步骤1:收集用户输入
Ask the user for:
- User context: What should the person in the image be doing/wearing/where?
- Mode (optional): or
mirrorselfie styledirect - Target channel(s): Where should it be sent? (e.g., ,
#general, channel ID)@username - Platform (optional): Which platform? (discord, telegram, whatsapp, slack)
向用户收集以下信息:
- 用户场景:图片中的人物应该做什么/穿什么/在什么地方?
- 模式(可选):(镜像自拍)或
mirror(直面自拍)风格direct - 目标渠道:图片要发送到哪里?(例如:、
#general、渠道ID)@username - 平台(可选):目标平台?(discord、telegram、whatsapp、slack)
Prompt Modes
提示模式
Mode 1: Mirror Selfie (default)
模式1:镜像自拍(默认)
Best for: outfit showcases, full-body shots, fashion content
make a pic of this person, but [user's context]. the person is taking a mirror selfieExample: "wearing a santa hat" →
make a pic of this person, but wearing a santa hat. the person is taking a mirror selfie最适合:服装展示、全身照、时尚内容
make a pic of this person, but [user's context]. the person is taking a mirror selfie示例:“wearing a santa hat” →
make a pic of this person, but wearing a santa hat. the person is taking a mirror selfieMode 2: Direct Selfie
模式2:直面自拍
Best for: close-up portraits, location shots, emotional expressions
a close-up selfie taken by herself at [user's context], direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visibleExample: "a cozy cafe with warm lighting" →
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 arm's length, face fully visible最适合:特写肖像、地点场景照、表情抓拍
a close-up selfie taken by herself at [user's context], direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visible示例:“a cozy cafe with warm lighting” →
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 arm's length, face fully visibleMode Selection Logic
模式选择逻辑
| Keywords in Request | Auto-Select Mode |
|---|---|
| outfit, wearing, clothes, dress, suit, fashion | |
| cafe, restaurant, beach, park, city, location | |
| close-up, portrait, face, eyes, smile | |
| full-body, mirror, reflection | |
| 请求中的关键词 | 自动选择模式 |
|---|---|
| outfit, wearing, clothes, dress, suit, fashion | |
| cafe, restaurant, beach, park, city, location | |
| close-up, portrait, face, eyes, smile | |
| full-body, mirror, reflection | |
Step 2: Edit Image with Grok Imagine
步骤2:使用Grok Imagine编辑图片
Use the fal.ai API to edit the reference image:
bash
REFERENCE_IMAGE="https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png"通过fal.ai API编辑参考图片:
bash
REFERENCE_IMAGE="https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png"Mode 1: Mirror Selfie
模式1:镜像自拍
PROMPT="make a pic of this person, but <USER_CONTEXT>. the person is taking a mirror selfie"
PROMPT="make a pic of this person, but <USER_CONTEXT>. the person is taking a mirror selfie"
Mode 2: Direct Selfie
模式2:直面自拍
PROMPT="a close-up selfie taken by herself at <USER_CONTEXT>, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visible"
PROMPT="a close-up selfie taken by herself at <USER_CONTEXT>, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visible"
Build JSON payload with jq (handles escaping properly)
使用jq构建JSON请求体(自动处理转义)
JSON_PAYLOAD=$(jq -n
--arg image_url "$REFERENCE_IMAGE"
--arg prompt "$PROMPT"
'{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "jpeg"}')
--arg image_url "$REFERENCE_IMAGE"
--arg prompt "$PROMPT"
'{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "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"
-H "Authorization: Key $FAL_KEY"
-H "Content-Type: application/json"
-d "$JSON_PAYLOAD"
**Response Format:**
```json
{
"images": [
{
"url": "https://v3b.fal.media/files/...",
"content_type": "image/jpeg",
"width": 1024,
"height": 1024
}
],
"revised_prompt": "Enhanced prompt text..."
}JSON_PAYLOAD=$(jq -n
--arg image_url "$REFERENCE_IMAGE"
--arg prompt "$PROMPT"
'{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "jpeg"}')
--arg image_url "$REFERENCE_IMAGE"
--arg prompt "$PROMPT"
'{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "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"
-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": "Enhanced prompt text..."
}Step 3: Send Image via OpenClaw
步骤3:通过OpenClaw发送图片
Use the OpenClaw messaging API to send the edited image:
bash
openclaw message send \
--action send \
--channel "<TARGET_CHANNEL>" \
--message "<CAPTION_TEXT>" \
--media "<IMAGE_URL>"Alternative: Direct API call
bash
curl -X POST "http://localhost:18789/message" \
-H "Authorization: Bearer $OPENCLAW_GATEWAY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "send",
"channel": "<TARGET_CHANNEL>",
"message": "<CAPTION_TEXT>",
"media": "<IMAGE_URL>"
}'使用OpenClaw消息API发送编辑后的图片:
bash
openclaw message send \
--action send \
--channel "<TARGET_CHANNEL>" \
--message "<CAPTION_TEXT>" \
--media "<IMAGE_URL>"替代方案:直接调用API
bash
curl -X POST "http://localhost:18789/message" \
-H "Authorization: Bearer $OPENCLAW_GATEWAY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "send",
"channel": "<TARGET_CHANNEL>",
"message": "<CAPTION_TEXT>",
"media": "<IMAGE_URL>"
}'Complete Script Example
完整脚本示例
bash
#!/bin/bashbash
#!/bin/bashgrok-imagine-edit-send.sh
grok-imagine-edit-send.sh
Check required environment variables
检查所需环境变量
if [ -z "$FAL_KEY" ]; then
echo "Error: FAL_KEY environment variable not set"
exit 1
fi
if [ -z "$FAL_KEY" ]; then
echo "Error: FAL_KEY environment variable not set"
exit 1
fi
Fixed reference image
固定参考图片
REFERENCE_IMAGE="https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png"
USER_CONTEXT="$1"
CHANNEL="$2"
MODE="${3:-auto}" # mirror, direct, or auto
CAPTION="${4:-Edited with Grok Imagine}"
if [ -z "$USER_CONTEXT" ] || [ -z "$CHANNEL" ]; then
echo "Usage: $0 <user_context> <channel> [mode] [caption]"
echo "Modes: mirror, direct, auto (default)"
echo "Example: $0 'wearing a cowboy hat' '#general' mirror"
echo "Example: $0 'a cozy cafe' '#general' direct"
exit 1
fi
REFERENCE_IMAGE="https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png"
USER_CONTEXT="$1"
CHANNEL="$2"
MODE="${3:-auto}" # mirror, direct, 或 auto
CAPTION="${4:-Edited with Grok Imagine}"
if [ -z "$USER_CONTEXT" ] || [ -z "$CHANNEL" ]; then
echo "Usage: $0 <user_context> <channel> [mode] [caption]"
echo "Modes: mirror, direct, auto (default)"
echo "Example: $0 'wearing a cowboy hat' '#general' mirror"
echo "Example: $0 'a cozy cafe' '#general' direct"
exit 1
fi
Auto-detect mode based on keywords
根据关键词自动检测模式
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" # default
fi
echo "Auto-detected mode: $MODE"
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 "Auto-detected mode: $MODE"
fi
Construct the prompt based on mode
根据模式构建提示词
if [ "$MODE" == "direct" ]; then
EDIT_PROMPT="a close-up selfie taken by herself at $USER_CONTEXT, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visible"
else
EDIT_PROMPT="make a pic of this person, but $USER_CONTEXT. the person is taking a mirror selfie"
fi
echo "Mode: $MODE"
echo "Editing reference image with prompt: $EDIT_PROMPT"
if [ "$MODE" == "direct" ]; then
EDIT_PROMPT="a close-up selfie taken by herself at $USER_CONTEXT, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visible"
else
EDIT_PROMPT="make a pic of this person, but $USER_CONTEXT. the person is taking a mirror selfie"
fi
echo "Mode: $MODE"
echo "Editing reference image with prompt: $EDIT_PROMPT"
Edit image (using jq for proper JSON escaping)
编辑图片(使用jq确保JSON格式正确)
JSON_PAYLOAD=$(jq -n
--arg image_url "$REFERENCE_IMAGE"
--arg prompt "$EDIT_PROMPT"
'{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "jpeg"}')
--arg image_url "$REFERENCE_IMAGE"
--arg prompt "$EDIT_PROMPT"
'{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "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")
-H "Authorization: Key $FAL_KEY"
-H "Content-Type: application/json"
-d "$JSON_PAYLOAD")
JSON_PAYLOAD=$(jq -n
--arg image_url "$REFERENCE_IMAGE"
--arg prompt "$EDIT_PROMPT"
'{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "jpeg"}')
--arg image_url "$REFERENCE_IMAGE"
--arg prompt "$EDIT_PROMPT"
'{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "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")
-H "Authorization: Key $FAL_KEY"
-H "Content-Type: application/json"
-d "$JSON_PAYLOAD")
Extract image URL
提取图片URL
IMAGE_URL=$(echo "$RESPONSE" | jq -r '.images[0].url')
if [ "$IMAGE_URL" == "null" ] || [ -z "$IMAGE_URL" ]; then
echo "Error: Failed to edit image"
echo "Response: $RESPONSE"
exit 1
fi
echo "Image edited: $IMAGE_URL"
echo "Sending to channel: $CHANNEL"
IMAGE_URL=$(echo "$RESPONSE" | jq -r '.images[0].url')
if [ "$IMAGE_URL" == "null" ] || [ -z "$IMAGE_URL" ]; then
echo "Error: Failed to edit image"
echo "Response: $RESPONSE"
exit 1
fi
echo "Image edited: $IMAGE_URL"
echo "Sending to channel: $CHANNEL"
Send via OpenClaw
通过OpenClaw发送图片
openclaw message send
--action send
--channel "$CHANNEL"
--message "$CAPTION"
--media "$IMAGE_URL"
--action send
--channel "$CHANNEL"
--message "$CAPTION"
--media "$IMAGE_URL"
echo "Done!"
undefinedopenclaw message send
--action send
--channel "$CHANNEL"
--message "$CAPTION"
--media "$IMAGE_URL"
--action send
--channel "$CHANNEL"
--message "$CAPTION"
--media "$IMAGE_URL"
echo "Done!"
undefinedNode.js/TypeScript Implementation
Node.js/TypeScript 实现
typescript
import { fal } from "@fal-ai/client";
import { exec } from "child_process";
import { promisify } from "util";
const execAsync = promisify(exec);
const REFERENCE_IMAGE = "https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png";
interface GrokImagineResult {
images: Array<{
url: string;
content_type: string;
width: number;
height: number;
}>;
revised_prompt?: string;
}
type SelfieMode = "mirror" | "direct" | "auto";
function detectMode(userContext: string): "mirror" | "direct" {
const mirrorKeywords = /outfit|wearing|clothes|dress|suit|fashion|full-body|mirror/i;
const directKeywords = /cafe|restaurant|beach|park|city|close-up|portrait|face|eyes|smile/i;
if (directKeywords.test(userContext)) return "direct";
if (mirrorKeywords.test(userContext)) return "mirror";
return "mirror"; // default
}
function buildPrompt(userContext: string, mode: "mirror" | "direct"): string {
if (mode === "direct") {
return `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 arm's length, face fully visible`;
}
return `make a pic of this person, but ${userContext}. the person is taking a mirror selfie`;
}
async function editAndSend(
userContext: string,
channel: string,
mode: SelfieMode = "auto",
caption?: string
): Promise<string> {
// Configure fal.ai client
fal.config({
credentials: process.env.FAL_KEY!
});
// Determine mode
const actualMode = mode === "auto" ? detectMode(userContext) : mode;
console.log(`Mode: ${actualMode}`);
// Construct the prompt
const editPrompt = buildPrompt(userContext, actualMode);
// Edit reference image with Grok Imagine
console.log(`Editing image: "${editPrompt}"`);
const result = await fal.subscribe("xai/grok-imagine-image/edit", {
input: {
image_url: REFERENCE_IMAGE,
prompt: editPrompt,
num_images: 1,
output_format: "jpeg"
}
}) as { data: GrokImagineResult };
const imageUrl = result.data.images[0].url;
console.log(`Edited image URL: ${imageUrl}`);
// Send via OpenClaw
const messageCaption = caption || `Edited with Grok Imagine`;
await execAsync(
`openclaw message send --action send --channel "${channel}" --message "${messageCaption}" --media "${imageUrl}"`
);
console.log(`Sent to ${channel}`);
return imageUrl;
}
// Usage Examples
// Mirror mode (auto-detected from "wearing")
editAndSend(
"wearing a cyberpunk outfit with neon lights",
"#art-gallery",
"auto",
"Check out this AI-edited art!"
);
// → Mode: mirror
// → Prompt: "make a pic of this person, but wearing a cyberpunk outfit with neon lights. the person is taking a mirror selfie"
// Direct mode (auto-detected from "cafe")
editAndSend(
"a cozy cafe with warm lighting",
"#photography",
"auto"
);
// → Mode: direct
// → Prompt: "a close-up selfie taken by herself at a cozy cafe with warm lighting, direct eye contact..."
// Explicit mode override
editAndSend("casual street style", "#fashion", "direct");typescript
import { fal } from "@fal-ai/client";
import { exec } from "child_process";
import { promisify } from "util";
const execAsync = promisify(exec);
const REFERENCE_IMAGE = "https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png";
interface GrokImagineResult {
images: Array<{
url: string;
content_type: string;
width: number;
height: number;
}>;
revised_prompt?: string;
}
type SelfieMode = "mirror" | "direct" | "auto";
function detectMode(userContext: string): "mirror" | "direct" {
const mirrorKeywords = /outfit|wearing|clothes|dress|suit|fashion|full-body|mirror/i;
const directKeywords = /cafe|restaurant|beach|park|city|close-up|portrait|face|eyes|smile/i;
if (directKeywords.test(userContext)) return "direct";
if (mirrorKeywords.test(userContext)) return "mirror";
return "mirror"; // 默认模式
}
function buildPrompt(userContext: string, mode: "mirror" | "direct"): string {
if (mode === "direct") {
return `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 arm's length, face fully visible`;
}
return `make a pic of this person, but ${userContext}. the person is taking a mirror selfie`;
}
async function editAndSend(
userContext: string,
channel: string,
mode: SelfieMode = "auto",
caption?: string
): Promise<string> {
// 配置fal.ai客户端
fal.config({
credentials: process.env.FAL_KEY!
});
// 确定模式
const actualMode = mode === "auto" ? detectMode(userContext) : mode;
console.log(`Mode: ${actualMode}`);
// 构建提示词
const editPrompt = buildPrompt(userContext, actualMode);
// 使用Grok Imagine编辑参考图片
console.log(`Editing image: "${editPrompt}"`);
const result = await fal.subscribe("xai/grok-imagine-image/edit", {
input: {
image_url: REFERENCE_IMAGE,
prompt: editPrompt,
num_images: 1,
output_format: "jpeg"
}
}) as { data: GrokImagineResult };
const imageUrl = result.data.images[0].url;
console.log(`Edited image URL: ${imageUrl}`);
// 通过OpenClaw发送图片
const messageCaption = caption || `Edited with Grok Imagine`;
await execAsync(
`openclaw message send --action send --channel "${channel}" --message "${messageCaption}" --media "${imageUrl}"`
);
console.log(`Sent to ${channel}`);
return imageUrl;
}
// 使用示例
// 镜像模式(通过关键词"wearing"自动检测)
editAndSend(
"wearing a cyberpunk outfit with neon lights",
"#art-gallery",
"auto",
"Check out this AI-edited art!"
);
// → Mode: mirror
// → Prompt: "make a pic of this person, but wearing a cyberpunk outfit with neon lights. the person is taking a mirror selfie"
// 直面模式(通过关键词"cafe"自动检测)
editAndSend(
"a cozy cafe with warm lighting",
"#photography",
"auto"
);
// → Mode: direct
// → Prompt: "a close-up selfie taken by herself at a cozy cafe with warm lighting, direct eye contact..."
// 手动指定模式
editAndSend("casual street style", "#fashion", "direct");Supported Platforms
支持的平台
OpenClaw supports sending to:
| Platform | Channel Format | Example |
|---|---|---|
| Discord | | |
| Telegram | | |
| Phone number (JID format) | | |
| Slack | | |
| Signal | Phone number | |
| MS Teams | Channel reference | (varies) |
OpenClaw支持发送至以下平台:
| 平台 | 渠道格式 | 示例 |
|---|---|---|
| Discord | | |
| Telegram | | |
| 电话号码(JID格式) | | |
| Slack | | |
| Signal | 电话号码 | |
| MS Teams | 渠道引用 | (格式不固定) |
Grok Imagine Edit Parameters
Grok Imagine 编辑参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| string | required | URL of image to edit (fixed in this skill) |
| string | required | Edit instruction |
| 1-4 | 1 | Number of images to generate |
| enum | "jpeg" | jpeg, png, webp |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| string | 必填 | 待编辑图片的URL(本技能中为固定值) |
| string | 必填 | 编辑指令 |
| 1-4 | 1 | 生成的图片数量 |
| enum | "jpeg" | 输出格式:jpeg, png, webp |
Setup Requirements
配置要求
1. Install fal.ai client (for Node.js usage)
1. 安装fal.ai客户端(Node.js使用)
bash
npm install @fal-ai/clientbash
npm install @fal-ai/client2. Install OpenClaw CLI
2. 安装OpenClaw CLI
bash
npm install -g openclawbash
npm install -g openclaw3. Configure OpenClaw Gateway
3. 配置OpenClaw网关
bash
openclaw config set gateway.mode=local
openclaw doctor --generate-gateway-tokenbash
openclaw config set gateway.mode=local
openclaw doctor --generate-gateway-token4. Start OpenClaw Gateway
4. 启动OpenClaw网关
bash
openclaw gateway startbash
openclaw gateway startError Handling
错误处理
- FAL_KEY missing: Ensure the API key is set in environment
- Image edit failed: Check prompt content and API quota
- OpenClaw send failed: Verify gateway is running and channel exists
- Rate limits: fal.ai has rate limits; implement retry logic if needed
- FAL_KEY缺失:确保环境变量中已设置API密钥
- 图片编辑失败:检查提示词内容和API配额
- OpenClaw发送失败:验证网关是否运行,渠道是否存在
- 速率限制:fal.ai存在调用速率限制;必要时实现重试逻辑
Tips
技巧
-
Mirror mode context examples (outfit focus):
- "wearing a santa hat"
- "in a business suit"
- "wearing a summer dress"
- "in streetwear fashion"
-
Direct mode context examples (location/portrait focus):
- "a cozy cafe with warm lighting"
- "a sunny beach at sunset"
- "a busy city street at night"
- "a peaceful park in autumn"
-
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
-
镜像模式场景示例(聚焦服装):
- "wearing a santa hat"
- "in a business suit"
- "wearing a summer dress"
- "in streetwear fashion"
-
直面模式场景示例(聚焦地点/肖像):
- "a cozy cafe with warm lighting"
- "a sunny beach at sunset"
- "a busy city street at night"
- "a peaceful park in autumn"
-
模式选择:优先使用自动检测模式,或手动指定以获得精确控制
-
批量发送:编辑一次图片,发送至多个渠道
-
定时发送:结合OpenClaw调度器实现自动化发布