write_node_file
Write a file into a custom-node pack under custom_nodes/, with options to overwrite existing files and create parent directories. Use for creating or replacing whole files in ComfyUI custom nodes.
Instructions
Create or overwrite one file inside a custom-node pack under custom_nodes/. Refuses to clobber an existing file unless overwrite is true, and creates parent directories by default. Use for whole-file edits or new files; for surgical edits prefer apply_node_patch. After writing, run verify_custom_node and restart_comfyui to load the change. LOCAL-ONLY (requires COMFYUI_PATH); the path is jailed to custom_nodes/.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Pack-relative path under custom_nodes/, e.g. 'MyPack/nodes.py'. | |
| content | Yes | Full file contents to write. | |
| overwrite | No | Overwrite an existing file instead of refusing (default false). | |
| create_dirs | No | Create missing parent directories (default true). |