# Claude Code ComfyUI Nodes Requirements # Core dependencies for Claude Code SDK integration (API version) claude-code-sdk aiofiles>=23.0.0 # Standard library modules that should be available # asyncio is part of Python standard library since 3.4 # Optional dependencies for development # pytest>=8.0.0 # mypy>=1.0.0 # ruff>=0.1.0 # pre-commit>=3.5.0
ComfyUI nodes for integrating Claude Code SDK – enables AI-powered code generation, analysis, and assistance within ComfyUI workflows.
This node pack provides a stateless, command-based interface to Claude Code within ComfyUI. Unlike traditional chat interfaces, these nodes operate as single-shot commands, making them perfect for automation workflows similar to n8n, Zapier, or Make.
${PROJECT_NAME})The main execution node that runs Claude Code commands.
Inputs:
command_source: Choose between “file” (dropdown) or “text” (custom)command_file: Dropdown of commands from /commands foldercommand: Custom command text (when not using file)model: Choose between “default”, “sonnet” or “opus” modelsmax_turns: Maximum iterations Claude can take (1-512)memory: Optional context from Memory Builder nodearguments: Arguments from Arguments Builder nodetools: Tool configuration from Tools Config nodeprevious_output: Output from previous executionmcp_config: MCP configuration from MCP ManagerOutputs:
output: CLAUDE_OUTPUT for chainingresponse: Claude’s final response textmetadata: JSON metadata about the executionInspect and read files from Claude Code output folders.
Inputs:
output_folder: Folder name from a ClaudeCodeCommandfile_pattern: Glob pattern for files (e.g., “*.py”)read_mode: “list_files”, “read_all”, or “read_specific”specific_file: File to read in “read_specific” modemax_files: Maximum files to readOutputs:
file_contents: The actual file contentsfile_list: JSON list of files with metadatametadata: Execution metadata from the folderConvert output folders into memory/context for chaining commands.
Inputs:
output_folder: Folder to build context fromcontext_mode: How to build context (“full_content”, “file_list”, “summary”, “custom”)base_memory: Existing memory to append tofile_filter: File extensions to includecustom_template: Custom context templatemax_file_size_kb: Max file size to includeOutputs:
memory: Formatted memory/context stringBuild memory/context from various sources including dropdown selection.
Inputs:
memory_type: “text”, “file”, “memory_file”, “claude_md”, or “combined”memory_file: Dropdown of files from /memories foldertext_memory: Direct text inputfile_path: Path to any fileclaude_md_content: CLAUDE.md formatted contentappend_to: Previous memory to append toOutputs:
memory: CLAUDE_MEMORY for chainingmemory_text: Plain text versionBuild arguments for variable substitution in commands.
Inputs:
arguments: JSON object with key-value pairsappend_to: Previous arguments to merge withOutputs:
arguments: CLAUDE_ARGUMENTS for chainingarguments_json: JSON stringConfigure which tools Claude can use.
Inputs:
preset: Tool presets (all, read_only, file_ops, code_dev, web, minimal, none)custom_tools: Additional tools to addremove_tools: Tools to remove from presetskip_permissions: Skip permission promptsOutputs:
tools: CLAUDE_TOOLS configurationtools_list: Comma-separated tool listskip_permissions: Boolean flagConfigure Model Context Protocol servers.
Inputs:
action: list, enable, disable, or configmcp_name: Name of MCP servermcp_config: JSON configurationlist_format: Output format for listingOutputs:
mcp_info: Status informationmcp_config: MCP_CONFIG for chainingmcp_data: Raw MCP dataScrape Reddit posts and comments using Playwright MCP.
Inputs:
source_type: url, subreddit, search, or usersource: Reddit URL or search termscrape_mode: comments, posts, both, or metadatamax_items: Maximum items to scrapesort_by: Sort order for postsinclude_metadata: Include detailed metadatamax_comment_depth: Thread depth to scrapeOutputs:
output: CLAUDE_OUTPUT for chainingscraped_data: JSON datasummary: Text summaryitem_count: Number of items scrapedComfyUI/custom_nodes directoryIf you have a Claude Code Max Plan subscription:
If you want to use the Anthropic API directly:
pip install claude-code-sdk aiofilesANTHROPIC_API_KEY environment variablecommand_source to “file” and select a command from dropdownOR set to “text” and enter custom command:
“`markdown
Create a Python script that generates fibonacci numbers.
Include error handling and type hints.
“`
/commands folder (.md or .txt)/memories folderSet arguments as JSON:
{
"PROJECT_NAME": "MyAwesomeProject",
"LANGUAGE": "Python"
}
Then use in your command:
Create a ${LANGUAGE} project structure for ${PROJECT_NAME}.
Include README, tests, and proper package structure.
claude-code-comfyui-nodes/
├── commands/ # Command library (dropdown in Execute node)
│ ├── reddit-video-script-simple.md
│ └── your-custom-command.md
├── memories/ # Memory templates (dropdown in Memory node)
│ ├── reddit-video-context.md
│ └── your-project-context.md
├── claude_code_outputs/ # All execution outputs
│ ├── output_20240615_143022/
│ └── reddit_scrape_20240615/
└── src/ # Node implementations
All outputs are stored in claude_code_outputs/ with timestamped folders:
output_YYYYMMDD_HHMMSS_[id]reddit_scrape_YYYYMMDD_HHMMSS_[id]_claude_code_metadata.jsonGNU General Public License v3