一键导入
tools
Agentic tools system for ComfyUI interaction. Use when implementing tools, function calling, or enabling LLM-driven actions in ComfyUI workflows.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Agentic tools system for ComfyUI interaction. Use when implementing tools, function calling, or enabling LLM-driven actions in ComfyUI workflows.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Install ComfyUI Assistant as a ComfyUI custom node. Use when performing or troubleshooting installation (clone, Python deps, frontend build, restart).
For complex user requests — evaluate, investigate, ask questions, propose a plan, accept modifications, then execute. Use when the request is multi-step, ambiguous, or high-impact.
Workflow execution and complete workflow generation tools (executeWorkflow, applyWorkflowJson). Use when the user wants to run a workflow or build a complete workflow from a description.
Python backend modules, chat request lifecycle, SSE format, and API endpoints
System prompt assembly from system_context, user_context, and environment sources
Generate a Product Requirements Document (PRD) for a new feature. Use when planning a feature, starting a new project, or when asked to create a PRD. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out.
| name | tools |
| description | Agentic tools system for ComfyUI interaction. Use when implementing tools, function calling, or enabling LLM-driven actions in ComfyUI workflows. |
| version | 0.0.1 |
| license | MIT |
Enable AI assistant to interact with ComfyUI workflows through tools/function calling.
The agentic tools system allows the AI assistant to:
Frontend (TypeScript) Backend (Python)
┌─────────────────────┐ ┌──────────────────┐
│ useLocalRuntime │ │ OpenAI-compatible provider API │
│ ┌───────────────┐ │ │ ┌────────────┐ │
│ │ createTools() │ │ │ │ tools=TOOLS│ │
│ └───────────────┘ │ │ └────────────┘ │
│ ↓ │ │ ↓ │
│ ┌───────────────┐ │ │ ┌────────────┐ │
│ │ Executes │◄─┼───────┼──│ Declares │ │
│ │ Actions │ │ │ │ Tools │ │
│ └───────────────┘ │ │ └────────────┘ │
│ ↓ │ │ │
│ ┌───────────────┐ │ │ │
│ │ window.app │ │ │ │
│ │ (ComfyUI) │ │ │ │
│ └───────────────┘ │ │ │
└─────────────────────┘ └──────────────────┘
// App.tsx
import { useLocalRuntime } from "@assistant-ui/react";
import { AssistantChatTransport } from "@assistant-ui/react-ai-sdk";
import { createTools } from "@/tools";
function App() {
const runtime = useLocalRuntime({
adapter: new AssistantChatTransport({ api: "/api/chat" }),
tools: window.app ? createTools({ app: window.app }) : {},
});
return (
<AssistantRuntimeProvider runtime={runtime}>
<Thread />
</AssistantRuntimeProvider>
);
}
# __init__.py
from tools_definitions import TOOLS
stream = await client.chat.completions.create(
model=OPENAI_MODEL,
messages=openai_messages,
tools=TOOLS, # Enable function calling
stream=True,
)
| Tool | Description | Status |
|---|---|---|
addNode | Add node to workflow | ✅ Implemented |
removeNode | Remove node from workflow | ✅ Implemented |
connectNodes | Connect two nodes | ✅ Implemented |
getWorkflowInfo | Get workflow information (with widget data) | ✅ Implemented |
setNodeWidgetValue | Set any widget value on a node | ✅ Implemented |
fillPromptNode | Set prompt text on CLIPTextEncode | ✅ Implemented |
refreshEnvironment | Rescan installed nodes, packages, models | ✅ Implemented |
searchInstalledNodes | Search installed node types | ✅ Implemented |
readDocumentation | Fetch documentation for a topic | ✅ Implemented |
createSkill | Create a persistent user skill | ✅ Implemented |
deleteSkill | Delete a user skill by slug | ✅ Implemented |
updateSkill | Update a user skill by slug (name, description, instructions) | ✅ Implemented |
ui/src/tools/
├── types.ts # Shared types
├── index.ts # Tool registry
├── definitions/ # Zod schemas & metadata
│ ├── add-node.ts
│ ├── remove-node.ts
│ ├── connect-nodes.ts
│ ├── get-workflow-info.ts
│ ├── set-node-widget-value.ts
│ ├── fill-prompt-node.ts
│ ├── create-skill.ts
│ ├── delete-skill.ts
│ ├── update-skill.ts
│ ├── refresh-environment.ts
│ ├── search-installed-nodes.ts
│ └── read-documentation.ts
└── implementations/ # Execution logic
├── add-node.ts
├── remove-node.ts
├── connect-nodes.ts
├── get-workflow-info.ts
├── set-node-widget-value.ts
├── fill-prompt-node.ts
├── create-skill.ts
├── delete-skill.ts
├── update-skill.ts
├── refresh-environment.ts
├── search-installed-nodes.ts
└── read-documentation.ts
tools_definitions.py # Backend tool declarations (single source of truth)
All tools receive a ToolContext with access to ComfyUI:
interface ToolContext {
app: ComfyApp;
}
Tools return a standardized result:
interface ToolResult<T = unknown> {
success: boolean;
data?: T;
error?: string;
}
addNode tool// tools/definitions/my-tool.ts
import { z } from 'zod';
export const myToolSchema = z.object({
param: z.string().describe("Parameter description")
});
export const myToolDefinition = {
name: "myTool",
description: "What the tool does",
parameters: myToolSchema,
};
// tools/implementations/my-tool.ts
export async function executeMyTool(
params: MyToolParams,
context: ToolContext
): Promise<ToolResult> {
const { app } = context;
try {
// Tool logic
return { success: true, data: { /* result */ } };
} catch (error) {
return {
success: false,
error: error instanceof Error ? error.message : "Unknown error"
};
}
}
// tools/index.ts
export function createTools(context: ToolContext) {
return {
[myToolDefinition.name]: {
description: myToolDefinition.description,
parameters: myToolDefinition.parameters,
execute: async (params) => executeMyTool(params, context)
}
};
}
# tools_definitions.py
TOOLS.append({
"type": "function",
"function": {
"name": "myTool",
"description": "What the tool does",
"parameters": {
"type": "object",
"properties": {
"param": {"type": "string"}
}
}
}
})
app and app.graph existToolResultapp.graph.setDirtyCanvas(true, true)window.app is availableuseLocalRuntime is used (not useChatRuntime)tools=TOOLS to backend API callgetWorkflowInfo)