在 OpenClaw 中使用 Recraft。
Recraft 提供清晰的神经网络图像超分,可在无伪影的情况下恢复精细细节,并提供精确的背景移除,保留发丝和透明边缘。OpenClaw agent 通过与聊天相同的 RunAPI 密钥调用这两个端点——发送源图像 URL,选择超分或背景移除,然后轮询获取处理后的结果。
使用 RunAPI 通过 Recraft crisp upscale 放大图像。
要求:
- 使用 RUNAPI_API_KEY 环境变量进行身份验证。
- 调用位于 https://runapi.ai/api/v1/recraft/upscale_image 的 RunAPI upscale_image 端点。
- 将 model 设置为 "recraft-crisp-upscale"。
- 在 source_image_url 中传入源图像 URL。
- 响应会返回一个 task_id。轮询任务状态端点直到任务完成,然后从结果中获取放大后的图像 URL。
- 如需背景移除,请改为调用 /api/v1/recraft/remove_background 并将 model 设为 "recraft-remove-background"。
curl -X POST https://runapi.ai/api/v1/recraft/upscale_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "recraft-crisp-upscale",
"source_image_url": "https://example.com/product-photo.jpg"
}'
{
"task_id": "tsk_abc123",
"status": "pending",
"model": "recraft-crisp-upscale"
}
三步在 OpenClaw 中使用 Recraft
Configure RunAPI
If you have not set up RunAPI in OpenClaw yet, follow the OpenClaw setup guide. Set the RUNAPI_API_KEY environment variable and add RunAPI as an OpenAI-compatible provider with baseUrl https://runapi.ai/v1.
export RUNAPI_API_KEY=runapi_xxx
Call Recraft upscale or remove background
Send a POST request to the upscale_image endpoint with model set to recraft-crisp-upscale and provide the source_image_url. For background removal, POST to the remove_background endpoint with model recraft-remove-background instead. Both require only source_image_url.
POST /api/v1/recraft/upscale_image
Poll for the result
Both endpoints return a task_id with status pending. Poll the task status endpoint until the status changes to completed, then retrieve the processed image URL from the response. RunAPI SDKs and the CLI handle polling automatically.
GET /api/v1/recraft/upscale_image/tsk_abc123
Recraft API 参数
| 参数 | 类型 | 说明 |
|---|---|---|
model |
string |
Required. recraft-crisp-upscale for upscaling, recraft-remove-background for background removal. |
source_image_url |
string |
Required. URL of the source image to process. |
callback_url |
string |
Optional. Webhook URL for async completion notification. |
OpenClaw 上的 Recraft 是什么?
Recraft 在 RunAPI 上提供两种后期处理能力——能恢复精细细节的清晰神经放大,以及能干净处理发丝和透明边缘的背景去除功能。OpenClaw agent 通过同一个 RunAPI key 调用两个端点。
Recraft 使用场景
设计资产的神经放大
对产品图片、标志和设计资产进行放大处理,恢复精细细节,成本低于 Topaz——适合对价格敏感的后期制作工作流。
电商产品的背景去除
去除产品照片的背景,用于白底电商列表或合成应用。Recraft 处理细微边缘,包括发丝、透明材质和细小物件。
批量图像后期处理
在 OpenClaw agent 工作流中串联 Recraft 与生成步骤,自动完成大批量产品图像的放大和背景去除。
Recraft + OpenClaw 常见问题
Yes. Both endpoints are stateless and accept standard image URLs. Instruct the OpenClaw agent to first call remove_background with the original image, then pass the output URL to upscale_image. The same RUNAPI_API_KEY handles both calls.
Recraft accepts JPEG, PNG, and WebP inputs. Background removal outputs PNG with alpha transparency. Upscale output matches the input format.
Both use neural networks, but Recraft crisp upscale is optimized for clean edge recovery on design assets and product photos with lower per-task cost. Topaz offers configurable 2x/4x/8x scale factors and is better suited for photographic detail at extreme enlargements. Both are async and share the same RunAPI key.
Both Recraft endpoints are async. The API returns a task_id immediately. Poll the task status endpoint until the result is ready. RunAPI SDKs and the CLI handle polling automatically.
Recraft uses per-task billing — upscaling and background removal are priced separately per image processed. Check the RunAPI pricing page for current rates. No subscription or minimum spend required.