← 返回 Skills 市场
bortlesboat

ComfyUI Bridge

作者 Andrew Barnes · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
327
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install comfyui-bridge
功能描述
Generate images, faceswap, edit photos, animate expressions, and do style transfer via a self-hosted ComfyUI instance on your LAN. Your GPU, your models.
使用说明 (SKILL.md)

\r \r

ComfyUI Bridge\r

\r Generate images, faceswap, animate expressions, and do style transfer via a self-hosted ComfyUI instance running on your LAN. No cloud API — your GPU, your models.\r \r

Requirements\r

\r

  • ComfyUI Desktop (or server) running somewhere on your LAN\r
  • ComfyUI Bridge server running on the same machine as ComfyUI (see Setup)\r
  • uv installed on the machine running OpenClaw\r \r

Setup\r

\r

1. Install the bridge server (on your ComfyUI machine)\r

\r The bridge is a lightweight FastAPI server that wraps ComfyUI's API:\r \r

git clone https://github.com/Bortlesboat/comfyui-bridge\r
cd comfyui-bridge\r
pip install -r requirements.txt\r
python bridge_server.py\r
# Listening on http://0.0.0.0:8100\r
```\r
\r
### 2. Configure the skill\r
\r
Set the bridge URL as an environment variable on your OpenClaw machine:\r
\r
```bash\r
export COMFYUI_BRIDGE_URL=http://YOUR_COMFYUI_MACHINE_IP:8100\r
```\r
\r
Or add it to your LaunchAgent/systemd service environment.\r
\r
### 3. Required ComfyUI custom nodes (for all features)\r
\r
Install via ComfyUI Manager:\r
- **ReActor** — faceswap\r
- **ComfyUI-LivePortrait** — expression animation\r
- **ComfyUI_IPAdapter_plus** — style transfer\r
- **WAS Node Suite** — utilities\r
- **ComfyUI-GGUF** — GGUF model support (optional, for FLUX)\r
- **rgthree-comfy** — workflow utilities\r
\r
### 4. Recommended models\r
\r
| Model | Use |\r
|---|---|\r
| Juggernaut XL Ragnarok | Architecture, objects, general |\r
| RealVisXL V5.0 Lightning | People, portraits, fast |\r
| FLUX.1 Dev Q5 GGUF | Maximum photorealism (slow, VRAM-heavy) |\r
\r
---\r
\r
## Usage\r
\r
All commands use the `comfyui_generate.py` script via `uv run`. Replace `SKILL_SCRIPTS` with the path to this skill's `scripts/` directory.\r
\r
**Always use `--no-media`** — include one `MEDIA: /full/path/to/output.png` in your text response instead.\r
\r
### 1. Text to Image\r
\r
```bash\r
uv run $SKILL_SCRIPTS/comfyui_generate.py \\r
  --prompt "your description" \\r
  --filename ~/.openclaw/media/outbound/output.png \\r
  --no-media\r
```\r
\r
### 2. Image to Image\r
\r
```bash\r
uv run $SKILL_SCRIPTS/comfyui_generate.py \\r
  --prompt "make it sunset" \\r
  -i /path/to/input.png \\r
  --strength 0.5 \\r
  --filename ~/.openclaw/media/outbound/output.png \\r
  --no-media\r
```\r
\r
### 3. Faceswap (pipeline — best quality)\r
\r
Swaps a face then runs img2img cleanup for natural blending. ~30 seconds total.\r
\r
```bash\r
uv run $SKILL_SCRIPTS/comfyui_generate.py \\r
  --faceswap-pipeline \\r
  --source-face /path/to/source_face.png \\r
  -i /path/to/target.png \\r
  --cleanup-strength 0.40 \\r
  --filename ~/.openclaw/media/outbound/output.png \\r
  --no-media\r
```\r
\r
### 4. Faceswap (basic)\r
\r
```bash\r
uv run $SKILL_SCRIPTS/comfyui_generate.py \\r
  --faceswap \\r
  --source-face /path/to/source_face.png \\r
  -i /path/to/target.png \\r
  --filename ~/.openclaw/media/outbound/output.png \\r
  --no-media\r
```\r
\r
### 5. Targeted Faceswap (specific face in group photo)\r
\r
```bash\r
uv run $SKILL_SCRIPTS/comfyui_generate.py \\r
  --targeted-faceswap \\r
  --source-face /path/to/source_face.png \\r
  -i /path/to/group_photo.png \\r
  --target-face-index "1" \\r
  --filename ~/.openclaw/media/outbound/output.png \\r
  --no-media\r
```\r
\r
Face indices: `0` = leftmost, `1` = second from left, `"0,2"` = first and third.\r
\r
### 6. LivePortrait (expression animation)\r
\r
```bash\r
uv run $SKILL_SCRIPTS/comfyui_generate.py \\r
  --liveportrait \\r
  -i /path/to/portrait.png \\r
  --expression-preset smile \\r
  --filename ~/.openclaw/media/outbound/output.png \\r
  --no-media\r
```\r
\r
Presets: `smile`, `surprised`, `wink`, `suspicious`, `derp`, `angry`, `sleepy`\r
\r
Fine-grained control: `--smile` (-0.3 to 1.3), `--blink-val` (-20 to 5), `--eyebrow-val` (-10 to 15), `--aaa` (-30 to 120, mouth open), `--pitch`/`--yaw`/`--roll` (-20 to 20, head rotation).\r
\r
### 7. Style Transfer\r
\r
Generate a new image in the style of a reference:\r
\r
```bash\r
uv run $SKILL_SCRIPTS/comfyui_generate.py \\r
  --style-transfer \\r
  --style-ref /path/to/reference.png \\r
  --prompt "a portrait of a man" \\r
  --style-weight 0.85 \\r
  --filename ~/.openclaw/media/outbound/output.png \\r
  --no-media\r
```\r
\r
### 8. Restyle\r
\r
Apply a reference image's style to an existing photo:\r
\r
```bash\r
uv run $SKILL_SCRIPTS/comfyui_generate.py \\r
  --restyle \\r
  --style-ref /path/to/reference.png \\r
  -i /path/to/photo.png \\r
  --style-weight 0.85 \\r
  --strength 0.65 \\r
  --filename ~/.openclaw/media/outbound/output.png \\r
  --no-media\r
```\r
\r
### 9. Enhanced mode\r
\r
Add `--enhanced` to any command for FaceDetailer + 4x-UltraSharp upscale (net ~2x resolution). Works with txt2img and faceswap.\r
\r
---\r
\r
## Quality Gates (built-in)\r
\r
The script includes two automatic quality checks on faceswap outputs:\r
\r
**Gate 1 — Size check:** ReActor blank outputs when no face is detected (~2KB). Any faceswap output under 10KB automatically retries once. If still blank, exits with `FACESWAP_BLANK:` error — no garbage delivered.\r
\r
**Gate 2 — Vision QA:** If you have [Ollama](https://ollama.ai) running locally with `gemma3:12b`, faceswap outputs are checked with vision QA before delivery. PASS → deliver normally. FAIL → file renamed `_qa_flagged` and still delivered. Add ~10-20s but catches glitchy outputs. Disable by not having Ollama/gemma3 installed (fails open).\r
\r
---\r
\r
## Offline Queue\r
\r
When the bridge is unreachable, requests are automatically queued to `~/.openclaw/faceswap-queue/`. A companion daemon (`queue_processor.py`) polls every 5 minutes and delivers via iMessage when the bridge comes back online.\r
\r
Tell users: "Got it — the system is offline right now but your request is queued and will be sent automatically when it comes back."\r
\r
---\r
\r
## Options Reference\r
\r
| Flag | Default | Description |\r
|---|---|---|\r
| `--prompt` / `-p` | — | Text description |\r
| `--filename` / `-f` | required | Output path (use `~/.openclaw/media/outbound/`) |\r
| `-i` / `--input-image` | — | Input image (img2img target / faceswap target / portrait) |\r
| `--source-face` | — | Source face image (faceswap modes) |\r
| `--faceswap` | false | Basic faceswap |\r
| `--faceswap-pipeline` | false | Faceswap + cleanup (best quality) |\r
| `--cleanup-strength` | `0.40` | Pipeline cleanup denoise strength |\r
| `--targeted-faceswap` | false | Swap specific face in multi-face image |\r
| `--target-face-index` | `0` | Which face(s) to replace (comma-separated) |\r
| `--liveportrait` | false | Expression animation mode |\r
| `--expression-preset` | — | smile / surprised / wink / suspicious / derp / angry / sleepy |\r
| `--style-transfer` | false | Generate in reference style |\r
| `--restyle` | false | Apply reference style to existing photo |\r
| `--style-ref` | — | Style reference image |\r
| `--style-weight` | `0.85` | Style influence (0.5–1.0) |\r
| `--model` / `-m` | `juggernaut` | `juggernaut`, `flux`, `realvis` |\r
| `--aspect-ratio` / `-a` | `1:1` | `1:1`, `4:5`, `9:16`, `16:9`, `5:4` |\r
| `--strength` / `-s` | `0.6` | img2img denoise strength |\r
| `--seed` | `-1` | Seed (-1 = random) |\r
| `--enhanced` / `-e` | false | FaceDetailer + 4x upscale |\r
| `--no-media` | false | Suppress MEDIA: stdout line (always use this) |\r
\r
---\r
\r
## Routing Guide\r
\r
| User says | Mode |\r
|---|---|\r
| "generate an image of..." | txt2img |\r
| "make this look like..." (with image) | img2img |\r
| "put [person]'s face on this" | --faceswap-pipeline |\r
| "swap the second face" | --targeted-faceswap --target-face-index 1 |\r
| "make him smile / look surprised" | --liveportrait --expression-preset |\r
| "generate something that looks like this painting" | --style-transfer |\r
| "make this photo look like a painting" | --restyle |\r
| "high quality / best quality" | add --enhanced |\r
\r
---\r
\r
## Timing Reference\r
\r
| Mode | Approximate time |\r
|---|---|\r
| txt2img (realvis) | ~5 seconds |\r
| txt2img (juggernaut) | ~5 minutes |\r
| txt2img (flux) | ~10 minutes |\r
| faceswap pipeline | ~30 seconds |\r
| liveportrait | ~7 seconds (21s first run) |\r
| style transfer / restyle | ~5 minutes |\r
| +enhanced | +10-30 seconds |\r
安全使用建议
This skill appears to implement a legitimate local bridge to your ComfyUI instance, but pay attention before installing/running the included queue processor: it will attempt to deliver queued outputs via the imsg CLI (iMessage) by default and uses a hard-coded imsg path (/opt/homebrew/bin/imsg) and a default chat ID. If you do not want automatic delivery, do not run queue_processor.py as a daemon, and inspect queued JSON files in ~/.openclaw/faceswap-queue before processing. Ensure you have the imsg binary and Homebrew binaries only if you intend message delivery. Be cautious about the shell fallback the processor uses (it runs a shell if the direct imsg invocation fails) — this increases command-injection risk if files in the queue dir are modified by an attacker. Finally, set COMFYUI_BRIDGE_URL explicitly and only run the bridge on trusted LAN hosts. If you want lower risk, use comfyui_generate.py interactively and handle delivery yourself rather than using the automatic queue processor.
功能分析
Type: OpenClaw Skill Name: comfyui-bridge Version: 0.1.0 The comfyui-bridge skill is a well-structured tool for interacting with a self-hosted ComfyUI instance. It includes scripts for image generation (comfyui_generate.py) and a background queue processor (queue_processor.py) that handles offline requests and delivers results via the macOS imsg CLI. The code follows security best practices by using parameterized subprocess calls to prevent shell injection, limits file operations to the skill's own data directory (~/.openclaw/), and includes legitimate local features like vision-based quality checks via Ollama.
能力评估
Purpose & Capability
The skill's main purpose (drive a local ComfyUI bridge) matches the code. However, the queue processor includes iMessage delivery (imsg CLI) and macOS-specific conversion via sips; neither imsg nor sips are declared in required binaries or install metadata. Automatic messaging/delivery is not an obvious part of 'image generation' in the skill metadata and could surprise users.
Instruction Scope
SKILL.md instructs the agent to run the provided scripts and write media under ~/.openclaw — that is expected. But the included queue_processor.py will automatically send queued outputs via the imsg CLI to a default chat ID unless configured otherwise. The SKILL.md and metadata do not prominently warn that queued jobs may be posted to iMessage, and the processor constructs a shell fallback command (shell=True) for imsg which increases injection risk if fields are tampered with.
Install Mechanism
Install metadata only requests a brew formula for 'uv', which is sensible for running the scripts. There are no remote downloads or extracted archives. However, additional runtime dependencies (imsg CLI, optional Ollama, Homebrew path assumptions) are required but not declared as install-time requirements.
Credentials
The skill does not request secrets, which is good, but it expects a COMFYUI_BRIDGE_URL env var (documented in SKILL.md but not listed as required). More importantly, the queue processor interacts with the user's iMessage system (via imsg) and will read/write to the user's local message DB indirectly — this is a sensitive capability and is not represented in the declared env/permission model. Default chat target ("7") and automatic delivery are surprising and potentially an exfiltration channel.
Persistence & Privilege
The skill does not set always:true and does not modify other skills. It creates and uses local directories under ~/.openclaw for queued requests and media (normal for this purpose). The queue_processor can be run as a daemon, which would give it continuing background activity — acceptable for a queue processor but the combination of background processing + automatic iMessage delivery raises the blast radius.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install comfyui-bridge
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /comfyui-bridge 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release — txt2img, img2img, faceswap, LivePortrait, style transfer, offline queue, vision QA
元数据
Slug comfyui-bridge
版本 0.1.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

ComfyUI Bridge 是什么?

Generate images, faceswap, edit photos, animate expressions, and do style transfer via a self-hosted ComfyUI instance on your LAN. Your GPU, your models. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 327 次。

如何安装 ComfyUI Bridge?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install comfyui-bridge」即可一键安装,无需额外配置。

ComfyUI Bridge 是免费的吗?

是的,ComfyUI Bridge 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

ComfyUI Bridge 支持哪些平台?

ComfyUI Bridge 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 ComfyUI Bridge?

由 Andrew Barnes(@bortlesboat)开发并维护,当前版本 v0.1.0。

💬 留言讨论