← 返回 Skills 市场
zeron-g

ComfyUI Painter

作者 Rongze Gao · GitHub ↗ · v2.0.0
cross-platform ⚠ suspicious
778
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install comfyui-painter
功能描述
本地 ComfyUI 画图工作流 + CivitAI 集成。通过 API 控制本地 ComfyUI 生成图片(文生图/图生视频),支持 CivitAI 模型搜索/下载/更新检查/自动调参。Use when: 用户说画图、生成图片、generate image、comfyui、换模型、调参数、出图、搜模型、下载模型...
使用说明 (SKILL.md)

ComfyUI Painter v2.0

通过 ComfyUI API 在本地 RTX 5090 上生成图片,集成 CivitAI 模型管理。

工作流程

  1. 检查 ComfyUI 是否运行,未运行则自动启动
  2. 解析用户需求:提示词、模型、参数
  3. 自动调参:根据模型从 CivitAI 获取推荐参数(或使用 config 缓存)
  4. 调用 generate.py 生成图片
  5. 将图片发送到 Discord
  6. 心跳时调用 auto_shutdown.py 检查空闲关闭

脚本路径

所有脚本相对于此 skill 目录:

  • scripts/comfyui_manager.py — 启动/关闭/状态
  • scripts/generate.py — 生成图片(Python API 调用)
  • scripts/auto_shutdown.py — 空闲自动关闭检查
  • scripts/civitai.pyCivitAI 集成(搜索/详情/下载/更新检查/推荐参数)
  • scripts/auto_tune.py自动调参(从 CivitAI 样图元数据提取推荐设置)
  • config.json — 配置文件(模型别名、默认参数、路径、CivitAI 关联)

使用方式

启动 ComfyUI

import scripts.comfyui_manager as mgr
mgr.start()  # 自动从 WSL 启动 Windows ComfyUI 进程

生成图片

from scripts.generate import generate
result = generate(
    positive="your prompt here",
    model="noobv6",        # 见下方模型别名
    batch_size=4,
    width=1024,
    height=1536,
    steps=20,
    cfg=5,
)
# result = {"ok": True, "images": ["/mnt/d/.../sdi_00201_.png", ...]}

带自动调参生成

from scripts.auto_tune import get_tuned_params
from scripts.generate import generate

params = get_tuned_params("janku")  # 从 CivitAI 获取推荐参数
result = generate(
    positive="your prompt",
    model="janku",
    steps=params["steps"],
    cfg=params["cfg"],
    width=params["width"],
    height=params["height"],
)

CivitAI 搜索模型

python3 scripts/civitai.py search "anime checkpoint" --limit 5

CivitAI 查看模型详情

python3 scripts/civitai.py info 140272

CivitAI 获取推荐参数

python3 scripts/civitai.py params 140272

CivitAI 检查本地模型更新

python3 scripts/civitai.py check-updates

⚠️ 需要计算 SHA256,每个文件约 30 秒

CivitAI 下载模型

python3 scripts/civitai.py download "https://civitai.com/api/download/models/XXXXX" --filename model_name.safetensors

更新所有模型的推荐参数到 config

python3 scripts/auto_tune.py update-all

发送图片到 Discord

生成完成后,将图片 cp 到 workspace 临时目录,用 message tool 发送到 #🎨-画图 频道(channel:1476675131404193823)。

关闭 ComfyUI

import scripts.comfyui_manager as mgr
mgr.stop()

模型别名

别名 Checkpoint CivitAI ID 版本 风格
hassaku hassakuXLIllustrious_v34 140272 v3.4 Illustrious 动漫
noobv6 pornmasterPro_noobV6 1045588 noob-V6 NoobAI 动漫(默认)
noobv4 pornmasterPro_noobV4 1045588 noob-V4 NoobAI 动漫(旧版)
sdxlv8 pornmaster_proSDXLV8 82543 Pro-SDXL-V8 SDXL 写实
janku JANKUTrainedNoobaiRouwei_v69 1277670 v6.9 NoobAI+RouWei 混合
nova3d nova3DCGXL_ilV80 715287 IL v8.0 3DCG/2.5D
unholy unholyDesireMixSinister_v70 1307857 v7.0 暗黑美学
flux flux1-dev-bnb-nf4-v2 638187 BNB NF4 v2 Flux 写实

自动调参(model_params)

每个模型在 config.json 中有 CivitAI 推荐的最佳参数。生成时:

  1. 用户指定的参数优先
  2. 未指定则使用 config.json → model_params[alias] 的推荐值
  3. model_params 也没有则使用 defaults 全局默认
模型 Steps CFG 采样器
hassaku 20 7 euler_a
janku 20 7 euler_a
noobv6 20 7 euler_a
sdxlv8 25 5 dpmpp_2m
nova3d 20 7 euler_a
unholy 20 7 euler_a
flux 20 1 euler

CivitAI 配置

API Key 存于 ~/.openclaw/workspace/credentials/civitai.md,格式:

# CivitAI API Key
Token: your_api_key_here

提示词优化指南

用户给自然语言描述时,转换为专业 Stable Diffusion 提示词:

  • 质量标签在前:masterpiece, best quality, absurdres, highres
  • BREAK 分隔不同语义段
  • 动作/姿势用专业标签:mating press, pov, from below, spread legs
  • 细节标签:detailed skin, sweat, wet skin, motion blur, dynamic angle
  • 负面提示词加入:censored, mosaic censoring, bar censor

心跳集成

每次心跳时运行 auto_shutdown.py 检查空闲时间,超过 15 分钟无使用自动关闭 ComfyUI 释放显存。

安全使用建议
This skill is internally consistent with a local ComfyUI + CivitAI workflow, but review and consider the following before installing: - Credentials: The skill reads a CivitAI API key from ~/.openclaw/workspace/credentials/civitai.md or the CIVITAI_API_KEY env var. If you want it to post to Discord you will need agent tooling or a bot token; DESIGN.md mentions ~/.openclaw/openclaw.json but the scripts do not automatically post. Only give API keys you trust this skill to use and store credentials with least privilege. - Downloads & file writes: The civitai.download functionality will fetch model files and write them into your checkpoints directory (large files). The download routine will accept arbitrary URLs and an optional filename; avoid passing untrusted URLs or filenames (risk of writing unwanted files or path traversal if filename is not sanitized). - External commands: Scripts call external binaries (curl, sha256sum, PowerShell). Ensure these tools are present and understand that the skill will execute them on your machine (used for downloads, hashing, and starting ComfyUI via WSL). Hashing many large model files is slow (noted in SKILL.md). - Content: The provided model aliases include adult/explicit models; ensure you are comfortable hosting and using such models and that this complies with your local policies and laws. - Review & limit scope: Because the code can update its local config.json and write into your ComfyUI model directories, run the scripts in a controlled environment first (or inspect/modify download_model to validate hosts and sanitize filenames). If you are not comfortable, request a version that restricts allowed download hosts to civitai.com and enforces safe filename handling.
功能分析
Type: OpenClaw Skill Name: comfyui-painter Version: 2.0.0 The skill is suspicious due to a critical path traversal vulnerability in `scripts/civitai.py`. The `download_model` function uses `os.path.join` with a user-controlled `filename` parameter without sanitization, allowing an attacker to write arbitrary files to arbitrary locations on the filesystem (e.g., `../../../../tmp/malicious.sh`). If the download URL can also be controlled by the agent based on user input, this constitutes a Remote Code Execution (RCE) risk. Other shell executions via PowerShell and `curl` are present but appear to be used for legitimate purposes, though they could be exploited if `config.json` were compromised via another vulnerability.
能力评估
Purpose & Capability
The name/description (ComfyUI + CivitAI) align with the included scripts: process manager, generation, CivitAI integration, auto-tune, and auto-shutdown. Config paths, model aliases and workflows are consistent with a local ComfyUI workflow.
Instruction Scope
Runtime instructions and scripts operate within the expected scope: check/start local ComfyUI, build prompts, call local ComfyUI API, fetch metadata from CivitAI, compute model hashes, download model files, update local config, and write generated images to the ComfyUI output directory. The SKILL.md references sending images to a Discord channel via the agent's message tool (channel ID provided), but the included scripts only produce files — they do not themselves perform Discord API calls (DESIGN.md mentions a Discord bot token location though no code directly uses it). The civitai integration reads credentials from ~/.openclaw/workspace/credentials/civitai.md or the CIVITAI_API_KEY env var.
Install Mechanism
No install spec — instruction-only plus included Python scripts. Nothing is downloaded at install time by the skill bundle itself.
Credentials
The skill expects a CivitAI API key (via credentials file or CIVITAI_API_KEY) and write access to the local ComfyUI models/checkpoints and output directories — these are proportionate to its purpose. Caveats: (1) DESIGN.md references reading a Discord bot token from ~/.openclaw/openclaw.json (not directly present in code) — be aware posting to Discord requires appropriate credentials/agent tooling. (2) download_model accepts arbitrary download URLs and an optional filename; the implementation does not strictly validate hostnames or sanitize filename input, so a user-supplied URL/filename could write arbitrary files into the configured checkpoints directory if misused.
Persistence & Privilege
always:false and the skill does not request system-wide privileges. It writes/updates its own config.json and .last_used files and may update model_params in the local config. It does invoke PowerShell to start/stop a Windows ComfyUI process via WSL, which requires appropriate OS permissions but is consistent with its purpose.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install comfyui-painter
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /comfyui-painter 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.0
v2.0.0: CivitAI integration (search/download/update-check/recommended-params), auto-tune from sample metadata, 4 models updated (Hassaku v3.4, JANKU v6.9, PornMaster noob V6, Nova 3DCG v8.0), 8 model aliases, per-model tuned params
元数据
Slug comfyui-painter
版本 2.0.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

ComfyUI Painter 是什么?

本地 ComfyUI 画图工作流 + CivitAI 集成。通过 API 控制本地 ComfyUI 生成图片(文生图/图生视频),支持 CivitAI 模型搜索/下载/更新检查/自动调参。Use when: 用户说画图、生成图片、generate image、comfyui、换模型、调参数、出图、搜模型、下载模型... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 778 次。

如何安装 ComfyUI Painter?

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

ComfyUI Painter 是免费的吗?

是的,ComfyUI Painter 完全免费(开源免费),可自由下载、安装和使用。

ComfyUI Painter 支持哪些平台?

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

谁开发了 ComfyUI Painter?

由 Rongze Gao(@zeron-g)开发并维护,当前版本 v2.0.0。

💬 留言讨论