Utilities for maintaining a ComfyUI install and related repos. The scripts can live anywhere, but placing this repo near your ComfyUI folder keeps paths tidy.
update_comfy_repos.pyupdates the main ComfyUI repo and every repo incustom_nodes(skips disabled folders), and writes a detailed change log with commit messages and file diffs.update_workflow_repos.pyupdates all Git repos underuser/default/workflows/githuband reports skipped non-repo folders.comfyui_pip_update_audit.pyscansrequirements.txtin the ComfyUI root and top-level custom nodes, compares installed vs latest versions, and prints update commands.run_comfyui.batlaunches ComfyUI with venv selection and custom-nodes presets via junctions.custom_nodes_link_manager.pymanages custom nodes junction links (compare repo vs custom_nodes, add/remove).partial_repo_sync.pysyncs selected files/folders from a git repo into a target folder.requirements_checker/provides a richer requirements audit with config-driven environment selection (venv/conda), custom paths, and per-package status reporting.clone-workflow_repos.pyclones workflow repos fromclone-workflow_repos.txtinto the workflowsgithubfolder (prompts for target path).make_tmp_custom_nodes.pygeneratestmp_custom_nodes.jsonwith loaded/disabled nodes and their repo URLs, useful for collecting all plugins into a single list/repository.png_to_json.pyscans a folder of.png/.jpegimages, reads ComfyUIworkflowmetadata, and writes a matching.jsonfile next to each image that contains a workflow.comfyui_root.pyresolves the ComfyUI root using config, validation, and upward search.
- Scripts not assume a fixed folder layout.
comfyui_root.pyvalidates a root by checkingcustom_nodes,models,main.py, andextra_model_paths.yaml.example.- If
Comfyui_rootis missing or invalid, the scripts search upward and save it toconfig.json.
Example with comments (JSONC). Remove comments in a real config.json.
- Windows:
*.batfiles. - Linux:
*.shequivalents (same names, run withbashor./file.sh).
Core idea: keep all real nodes in a single custom_nodes_repo folder, while
custom_nodes contains only junction links. This gives one source of truth,
easier maintenance, and fast enable/disable of node sets without moving files.
- Shows two columns: folders in
custom_nodes_repoand active junctions incustom_nodes. - Commands:
a <n>add link,r <n>remove link,ssync,qquit. - Sync adds missing links and removes extra junctions.
custom_nodes_repo_pathcomes fromconfig.jsonor is requested.custom_nodes_path/custom_nodes_pathsdefines the targetcustom_nodes.
- Syncs only selected files/directories from a git repo (not the full repo).
- Uses a local cache and git sparse-checkout, then copies selected paths into
target. - Jobs:
partial_repo_sync_config.json(repo, branch, target, paths). pathscan use regex patterns:re:^styles/.*\\.json$orregex:^styles/(git paths use/).- Launcher:
partial_repo_sync_run.bat.
- Reads ComfyUI root from
config.json(Comfyui_root/comfyui_root/COMFYUI_ROOT) or searches upward. - Lists
.venv*folders and launches the selectedpython.exe. - Applies custom nodes presets by creating junctions into
custom_nodesfromcustom_nodes_repo. - Cleans only junction folders; real directories are left intact.
- Presets are defined in
run_comfyui_presets_config.json(whitelist/blacklist+nodeslist). - The
currentpreset is a no-op. - Creates a default
run_comfyui_presets_config.jsonon first run if missing. - Updates ComfyUI frontend packages before launch.
- Scans
requirements.txtonly (root and top-level custom nodes). - Merges duplicate constraints and reports max allowed versions.
- Filters out pre-release and dev releases from suggested upgrades.
- Classifies updates as safe/risky/unknown and prints reasons for risky items.
- Checks reverse dependencies of already installed packages to flag conflicts before install.
- Treats inline comments in
requirements.txtcorrectly (e.g.pkg # comment).
- Hold: exclude packages from updates for the current env.
- Pin: lock packages to a specific version for the current env.
- Risky: dependency conflicts detected by reverse-check or
pip --dry-run. - Unknown: network/timeout/other non-dependency errors during dry-run.
Commands:
python comfyui_pip_update_audit.py --hold pkg1 pkg2
python comfyui_pip_update_audit.py --unhold pkg1 pkg2
python comfyui_pip_update_audit.py --pin pkg1==1.2.3 pkg2
python comfyui_pip_update_audit.py --unpin pkg1 pkg2Warning
Tested on Windows and venv environment.
{ // ComfyUI root (auto-detected, but can be pinned) "Comfyui_root": "C:/ComfyUI/ComfyUI", // Alternative keys for the same value "comfyui_root": "C:/ComfyUI/ComfyUI", "COMFYUI_ROOT": "C:/ComfyUI/ComfyUI", // Single custom_nodes path (legacy, still supported) "custom_nodes_path": "C:/ComfyUI/ComfyUI/custom_nodes", // Multiple custom_nodes paths (new). Duplicates/junctions are de-duped. "custom_nodes_paths": [ "D:/ComfyUI/custom_nodes", "E:/ComfyUI_nodes" ], // Environment type: "venv" or "conda" "env_type": "venv", // Venv: active path + known paths "venv_path": "C:/ComfyUI/venv", "venv_paths": [ "C:/ComfyUI/venv", "D:/ComfyUI_envs/venv" ], // Conda: conda.exe path and environment name/folder "conda_path": "C:/Users/USER/miniconda3/Scripts/conda.exe", "conda_env": "comfyui", "conda_env_folder": "C:/Users/USER/miniconda3/envs/comfyui", // Optional project path (used by requirements_checker) "project_path": "C:/ComfyUI", // Path to custom nodes repository folder for run_comfyui.bat "custom_nodes_repo_path": "D:/ComfyUI/custom_nodes_repo", // Hold/Pin per environment (env_key = venv_path | conda_env_folder | conda_env | "default") "holds": { "C:/ComfyUI/venv": { "hold_packages": ["torch", "torchvision"], "pin_packages": { "numpy": "1.26.4" } }, "conda:comfyui": { "hold_packages": ["xformers"], "pin_packages": {} } }, // Legacy: no per-env scoping (still supported, but prefer "holds") "hold_packages": ["pkg1", "pkg2"], "pin_packages": { "pkg3": "1.2.3" } }