ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

Tvdr Comfyui Gen

Skill by admirobot

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/admirobot/tvdr-comfyui-gen
Or

ComfyUI Generator

概述

提供可靠的 ComfyUI 图像生成功能,内置错误预防机制。

核心约束

1. 提示词字段强制验证

  • 必须使用 inputs['text']
  • 禁止使用 inputs['prompt']
  • 自动检查节点类型为 CLIPTextEncode

2. 避免重复生成

  • 不使用 spawn 执行生成任务
  • 同步执行,确保任务完成
  • 任务失败时重试机制

3. 工作流验证

  • 加载时检查文件存在性
  • 验证必需节点存在
  • 自动跳过负面提示词节点

使用方法

基础生成

from skills.comfyui_generator import generate

# 生成图片
result = generate(
    prompt="古代剑客,黑色短发,眼神坚毅,正面特写",
    workflow_path="/path/to/workflow.json",
    output_path="/home/node/projects/demo/characters/hero/front.png"
)

if result['success']:
    print(f"✓ 生成成功: {result['file_path']}")
else:
    print(f"✗ 生成失败: {result['error']}")

高级选项

result = generate(
    prompt="古代剑客,正面特写",
    workflow_path="/path/to/workflow.json",
    output_path="/output.png",
    filename_prefix="sword_hero_front",
    node_id="45",  # 指定修改哪个节点
    negative_prompt_node_id="7",  # 跳过负面提示词节点
    timeout=300,  # 超时时间(秒)
    retry=2  # 重试次数
)

返回结果

{
    'success': True/False,
    'file_path': '/path/to/output.png',
    'file_size_mb': 2.47,
    'prompt_id': 'uuid',
    'duration_seconds': 45,
    'error': None  # 失败时包含错误信息
}

工作流要求

工作流必须包含以下节点:

  • CLIPTextEncode: 提示词编码节点(必须有)
  • SaveImage: 保存图片节点(必须有一个)

错误处理

内置错误处理机制:

错误类型处理方式
工作流文件不存在立即失败,返回错误
找不到 CLIPTextEncode立即失败,返回错误
字段名错误自动修正,使用 text
ComfyUI 连接失败重试 3 次
生成超时放弃并返回错误
下载失败重试 2 次

常见错误预防

错误 1: 字段名错误

# ❌ 错误方式(历史错误)
node['inputs']['prompt'] = new_prompt  # 字段不存在

# ✅ Skill 自动使用正确方式
node['inputs']['text'] = new_prompt  # 正确

错误 2: 重复生成

# ❌ 错误方式(历史错误)
spawn("generate_image", ...)  # 可能重复执行

# ✅ Skill 不使用 spawn
result = generate_image(...)  # 同步执行

错误 3: 没有检查节点类型

# ❌ 错误方式(历史错误)
for node_id, node in workflow.items():
    node['inputs']['text'] = new_prompt  # 可能修改错误节点

# ✅ Skill 自动检查
if node.get('class_type') == 'CLIPTextEncode':
    node['inputs']['text'] = new_prompt

测试

# 测试 ComfyUI 连接
python -c "from skills.comfyui_generator import test_connection; test_connection()"

# 测试生成一张图片
python << 'EOF'
from skills.comfyui_generator import generate

result = generate(
    prompt="古代剑客,黑色短发,眼神坚毅,正面特写",
    workflow_path="/mnt/share2win/comfyui_work/comfyui_workflows/image_z_image_turbo(可用 写实).json",
    output_path="/tmp/test_output.png"
)

print(result)
EOF

配置

默认服务器地址

COMFYUI_SERVER = "http://192.168.18.15:8188"

默认工作流路径

DEFAULT_WORKFLOW = "/mnt/share2win/comfyui_work/comfyui_workflows/image_z_image_turbo(可用 写实).json"

历史错误记录

以下错误已通过本 skill 预防:

  1. 提示词字段错误 (2026-03-16 12:05)

    • 问题: 代码使用 inputs['prompt'] 但实际字段是 inputs['text']
    • 影响: 提示词修改失败,生成默认图片
    • 预防: Skill 强制使用 inputs['text']
  2. 重复生成问题 (2026-03-16 11:46)

    • 问题: 使用 spawn 子 agent 导致重复执行
    • 影响: 生成多个相同文件
    • 预防: Skill 不使用 spawn,同步执行

Metadata

Author@admirobot
Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-admirobot-tvdr-comfyui-gen": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.

Related Skills

video-script-creator

Short video script generator. 短视频脚本生成器、视频脚本、抖音文案、抖音脚本、快手脚本、口播稿、视频拍摄脚本、YouTube脚本、YouTube Shorts脚本、B站脚本、bilibili脚本、分镜脚本、视频大纲、视频文案、短视频创作、Reels脚本、TikTok脚本、vlog脚本、带货脚本、种草视频脚本、系列视频规划、视频数据复盘、完播率分析、前3秒钩子。Generate complete video scripts with hooks, outlines, titles, tags, CTA, storyboards, series planning, and data review. Use when: (1) creating short video scripts for any platform, (2) writing口播稿/talking-head scripts, (3) generating viral video titles, (4) planning video outlines and storyboards, (5) writing opening hooks (first 3 seconds), (6) generating CTA/ending prompts, (7) planning video series, (8) reviewing video performance data. 适用场景:写短视频脚本、拍摄脚本、口播文案、视频策划、爆款标题、开场钩子、结尾引导、完整分镜、系列规划、数据复盘。 Triggers on: video script creator.

admirobot 4473

Tvdr Obsidian Kb

Skill by admirobot

admirobot 4473

agent-team-orchestration

Orchestrate multi-agent teams with defined roles, task lifecycles, handoff protocols, and review workflows. Use when: (1) Setting up a team of 2+ agents with different specializations, (2) Defining task routing and lifecycle (inbox → spec → build → review → done), (3) Creating handoff protocols between agents, (4) Establishing review and quality gates, (5) Managing async communication and artifact sharing between agents.

admirobot 4473

autoresearch

Autonomous experiment loop for AI agents. Use when the user wants to run systematic experiments — optimizing hyperparameters, searching for better configurations, ablation studies, or any task where an agent should iteratively try changes, measure results, and keep or discard based on a metric. Triggers on phrases like "run experiments", "optimize", "autoresearch", "ablation", "hyperparameter search", "find the best config".

admirobot 4473

writer

Fix AI writing patterns that create repetitive and robotic content

admirobot 4473