在 OpenClaw 中使用 Recraft。
Recraft 提供清晰的神經網路圖片放大功能,能在不產生偽影的情況下恢復精細細節,以及精準的去背功能,能保留髮絲與透明邊緣。OpenClaw agent 透過與聊天相同的 RunAPI key 呼叫這兩個端點 — 傳送來源圖片 URL,選擇放大或去背,然後輪詢處理結果。
Use RunAPI to upscale an image with Recraft crisp upscale.
Requirements:
- Use the RUNAPI_API_KEY environment variable for authentication.
- Call the RunAPI upscale_image endpoint at https://runapi.ai/api/v1/recraft/upscale_image.
- Set model to "recraft-crisp-upscale".
- Pass the source image URL in source_image_url.
- The response returns a task_id. Poll the task status endpoint until the task completes, then retrieve the upscaled image URL from the result.
- For background removal, call /api/v1/recraft/remove_background with model "recraft-remove-background" instead.
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
設定 RunAPI
如果您尚未在 OpenClaw 中設定 RunAPI,請依照 OpenClaw 設定指南操作。設定 RUNAPI_API_KEY 環境變數,並將 RunAPI 新增為 OpenAI 相容的 provider,baseUrl 設為 https://runapi.ai/v1。
export RUNAPI_API_KEY=runapi_xxx
呼叫 Recraft 放大或去背
向 upscale_image 端點發送 POST 請求,model 設為 recraft-crisp-upscale 並提供 source_image_url。若要去背,改為向 remove_background 端點發送 POST 請求,model 設為 recraft-remove-background。兩者都只需提供 source_image_url。
POST /api/v1/recraft/upscale_image
輪詢結果
兩個端點都會回傳帶有 pending 狀態的 task_id。輪詢任務狀態端點,直到狀態變為 completed,然後從回應中取得處理後的圖片 URL。RunAPI SDK 和 CLI 會自動處理輪詢。
GET /api/v1/recraft/upscale_image/tsk_abc123
Recraft API 參數
| 參數 | 類型 | 說明 |
|---|---|---|
model |
string |
必填。recraft-crisp-upscale 用於放大,recraft-remove-background 用於去背。 |
source_image_url |
string |
必填。要處理的來源圖片 URL。 |
callback_url |
string |
選填。用於非同步完成通知的 Webhook URL。 |
OpenClaw 上的 Recraft 是什麼?
Recraft 是在 ELO 排行榜上擊敗 Midjourney 的團隊出品的圖像處理模型。在 RunAPI 上,它提供兩種後製能力——能恢復精細細節的清晰神經放大,以及能乾淨處理髮絲和透明邊緣的背景移除。使用者指出效果在適用時可以令人印象深刻,但 AI 回應在不同圖像類型間可能不穩定。OpenClaw 代理透過同一個 RunAPI key 呼叫兩個端點。
Recraft 使用情境
商品照去背
為電商商品列表移除商品照背景,邊緣偵測能處理頭髮、毛皮和透明材質,無需手動遮罩。
標誌與品牌素材放大
將低解析度標誌檔案和品牌素材放大至印刷品質,在向量風格圖形上保持清晰的邊緣。
客戶專案圖像處理
透過 API 而非手動 Photoshop 工作,批次處理客戶專案的圖像——用於合成的背景移除、用於印刷的放大。
Recraft + OpenClaw 常見問題
可以。兩個端點都是無狀態的,接受標準圖片 URL。指示 OpenClaw agent 先用原始圖片呼叫 remove_background,然後將輸出 URL 傳給 upscale_image。同一個 RUNAPI_API_KEY 即可處理兩次呼叫。
Recraft 接受 JPEG、PNG 和 WebP 輸入。去背輸出帶有 alpha 透明度的 PNG。放大輸出與輸入格式相同。
兩者都使用神經網路,但 Recraft crisp upscale 針對設計素材和商品照片的清晰邊緣恢復做了最佳化,單次任務成本較低。Topaz 提供可設定的 2x/4x/8x 放大倍率,更適合極端放大下的照片細節。兩者都是非同步的,共用同一個 RunAPI key。
兩個 Recraft 端點都是非同步的。API 會立即回傳 task_id。輪詢任務狀態端點直到結果就緒。RunAPI SDK 和 CLI 會自動處理輪詢。
Recraft 採用按任務計費 — 放大和去背按每張處理的圖片分別計價。請查看 RunAPI 定價頁面了解最新費率。無需訂閱或最低消費。