ComfyUI桥接器

comfyui-bridge

by bortlesboat

Generate images, faceswap, edit photos, animate expressions, and do style transfer via a self-hosted ComfyUI instance on your LAN. Your GPU, your models.

3.9k平台与服务未扫描2026年3月23日

安装

claude skill add --url github.com/openclaw/skills/tree/main/skills/bortlesboat/comfyui-bridge

文档

ComfyUI Bridge

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.

Requirements

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

Setup

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

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

bash
git clone https://github.com/Bortlesboat/comfyui-bridge
cd comfyui-bridge
pip install -r requirements.txt
python bridge_server.py
# Listening on http://0.0.0.0:8100

2. Configure the skill

Set the bridge URL as an environment variable on your OpenClaw machine:

bash
export COMFYUI_BRIDGE_URL=http://YOUR_COMFYUI_MACHINE_IP:8100

Or add it to your LaunchAgent/systemd service environment.

3. Required ComfyUI custom nodes (for all features)

Install via ComfyUI Manager:

  • ReActor — faceswap
  • ComfyUI-LivePortrait — expression animation
  • ComfyUI_IPAdapter_plus — style transfer
  • WAS Node Suite — utilities
  • ComfyUI-GGUF — GGUF model support (optional, for FLUX)
  • rgthree-comfy — workflow utilities

4. Recommended models

ModelUse
Juggernaut XL RagnarokArchitecture, objects, general
RealVisXL V5.0 LightningPeople, portraits, fast
FLUX.1 Dev Q5 GGUFMaximum photorealism (slow, VRAM-heavy)

Usage

All commands use the comfyui_generate.py script via uv run. Replace SKILL_SCRIPTS with the path to this skill's scripts/ directory.

Always use --no-media — include one MEDIA: /full/path/to/output.png in your text response instead.

1. Text to Image

bash
uv run $SKILL_SCRIPTS/comfyui_generate.py \
  --prompt "your description" \
  --filename ~/.openclaw/media/outbound/output.png \
  --no-media

2. Image to Image

bash
uv run $SKILL_SCRIPTS/comfyui_generate.py \
  --prompt "make it sunset" \
  -i /path/to/input.png \
  --strength 0.5 \
  --filename ~/.openclaw/media/outbound/output.png \
  --no-media

3. Faceswap (pipeline — best quality)

Swaps a face then runs img2img cleanup for natural blending. ~30 seconds total.

bash
uv run $SKILL_SCRIPTS/comfyui_generate.py \
  --faceswap-pipeline \
  --source-face /path/to/source_face.png \
  -i /path/to/target.png \
  --cleanup-strength 0.40 \
  --filename ~/.openclaw/media/outbound/output.png \
  --no-media

4. Faceswap (basic)

bash
uv run $SKILL_SCRIPTS/comfyui_generate.py \
  --faceswap \
  --source-face /path/to/source_face.png \
  -i /path/to/target.png \
  --filename ~/.openclaw/media/outbound/output.png \
  --no-media

5. Targeted Faceswap (specific face in group photo)

bash
uv run $SKILL_SCRIPTS/comfyui_generate.py \
  --targeted-faceswap \
  --source-face /path/to/source_face.png \
  -i /path/to/group_photo.png \
  --target-face-index "1" \
  --filename ~/.openclaw/media/outbound/output.png \
  --no-media

Face indices: 0 = leftmost, 1 = second from left, "0,2" = first and third.

6. LivePortrait (expression animation)

bash
uv run $SKILL_SCRIPTS/comfyui_generate.py \
  --liveportrait \
  -i /path/to/portrait.png \
  --expression-preset smile \
  --filename ~/.openclaw/media/outbound/output.png \
  --no-media

Presets: smile, surprised, wink, suspicious, derp, angry, sleepy

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).

7. Style Transfer

Generate a new image in the style of a reference:

bash
uv run $SKILL_SCRIPTS/comfyui_generate.py \
  --style-transfer \
  --style-ref /path/to/reference.png \
  --prompt "a portrait of a man" \
  --style-weight 0.85 \
  --filename ~/.openclaw/media/outbound/output.png \
  --no-media

8. Restyle

Apply a reference image's style to an existing photo:

bash
uv run $SKILL_SCRIPTS/comfyui_generate.py \
  --restyle \
  --style-ref /path/to/reference.png \
  -i /path/to/photo.png \
  --style-weight 0.85 \
  --strength 0.65 \
  --filename ~/.openclaw/media/outbound/output.png \
  --no-media

9. Enhanced mode

Add --enhanced to any command for FaceDetailer + 4x-UltraSharp upscale (net ~2x resolution). Works with txt2img and faceswap.


Quality Gates (built-in)

The script includes two automatic quality checks on faceswap outputs:

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.

Gate 2 — Vision QA: If you have Ollama 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).


Offline Queue

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.

Tell users: "Got it — the system is offline right now but your request is queued and will be sent automatically when it comes back."


Options Reference

FlagDefaultDescription
--prompt / -pText description
--filename / -frequiredOutput path (use ~/.openclaw/media/outbound/)
-i / --input-imageInput image (img2img target / faceswap target / portrait)
--source-faceSource face image (faceswap modes)
--faceswapfalseBasic faceswap
--faceswap-pipelinefalseFaceswap + cleanup (best quality)
--cleanup-strength0.40Pipeline cleanup denoise strength
--targeted-faceswapfalseSwap specific face in multi-face image
--target-face-index0Which face(s) to replace (comma-separated)
--liveportraitfalseExpression animation mode
--expression-presetsmile / surprised / wink / suspicious / derp / angry / sleepy
--style-transferfalseGenerate in reference style
--restylefalseApply reference style to existing photo
--style-refStyle reference image
--style-weight0.85Style influence (0.5–1.0)
--model / -mjuggernautjuggernaut, flux, realvis
--aspect-ratio / -a1:11:1, 4:5, 9:16, 16:9, 5:4
--strength / -s0.6img2img denoise strength
--seed-1Seed (-1 = random)
--enhanced / -efalseFaceDetailer + 4x upscale
--no-mediafalseSuppress MEDIA: stdout line (always use this)

Routing Guide

User saysMode
"generate an image of..."txt2img
"make this look like..." (with image)img2img
"put [person]'s face on this"--faceswap-pipeline
"swap the second face"--targeted-faceswap --target-face-index 1
"make him smile / look surprised"--liveportrait --expression-preset
"generate something that looks like this painting"--style-transfer
"make this photo look like a painting"--restyle
"high quality / best quality"add --enhanced

Timing Reference

ModeApproximate time
txt2img (realvis)~5 seconds
txt2img (juggernaut)~5 minutes
txt2img (flux)~10 minutes
faceswap pipeline~30 seconds
liveportrait~7 seconds (21s first run)
style transfer / restyle~5 minutes
+enhanced+10-30 seconds

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描111.8k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描111.8k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描9.8k

相关 MCP 服务

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.1k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.3k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
34.9k

评论