comfyui-mcp 0.52.122 → 0.52.123

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -175,16 +175,22 @@ So SSH + Jupyter + nginx come from the base; **our hook adds everything else**.
175
175
  volume.
176
176
  * **`--input-directory` / `--output-directory`** — inputs and generated images on
177
177
  the volume.
178
+ * **`--models-directory /workspace/models`** — makes ComfyUI's
179
+ `folder_paths.models_dir` the persistent volume root. This is required for
180
+ ComfyUI-Manager's explicit relative `save_path` values; `is_default` only
181
+ changes the ordering of category search paths.
178
182
  * **`--extra-model-paths-config`** — points every model category at
179
183
  `/workspace/models` (see below). MODELS persist on the volume.
180
184
  * **We deliberately do NOT use `--base-directory`.** It would relocate
181
185
  `custom_nodes` (and temp) onto the volume too — but we want `custom_nodes` to
182
- stay **in the image**. The per-dir flags + `extra_model_paths.yaml` give us
183
- exactly the split we want (data on the volume, software in the image).
186
+ stay **in the image**. The per-dir flags, explicit `--models-directory`, and
187
+ `extra_model_paths.yaml` give us exactly the split we want (data on the
188
+ volume, software in the image).
184
189
 
185
190
  > **Flag verification.** These flag names were verified against ComfyUI `master`
186
- > (`comfy/cli_args.py`): `--user-directory`, `--input-directory`,
187
- > `--output-directory`, `--base-directory`, and `--extra-model-paths-config` all
191
+ > (`comfy/cli_args.py`): `--user-directory`, `--models-directory`,
192
+ > `--input-directory`, `--output-directory`, `--base-directory`, and
193
+ > `--extra-model-paths-config` all
188
194
  > exist with these exact spellings, and `--base-directory`'s own help text states
189
195
  > it sets the base for "models, custom_nodes, input, output, temp, and user
190
196
  > directories" — confirming why we avoid it. **Assumption to confirm at build:**
@@ -198,10 +204,10 @@ So SSH + Jupyter + nginx come from the base; **our hook adds everything else**.
198
204
  ## Model paths (`extra_model_paths.yaml`)
199
205
 
200
206
  `extra_model_paths.yaml` is baked at `/opt/ComfyUI/extra_model_paths.yaml` and
201
- loaded via `--extra-model-paths-config`. It maps **every** model category to a
202
- subfolder under `/workspace/models`, with `is_default: true` so the volume is the
203
- **primary** (download) location — i.e. Manager's install-model writes there and
204
- the files persist.
207
+ loaded via `--extra-model-paths-config`. It maps every model category **this
208
+ image knows about** to a subfolder under `/workspace/models`, with
209
+ `is_default: true` so the volume is the **primary** (download) location — i.e.
210
+ Manager's install-model writes there and the files persist.
205
211
 
206
212
  ```yaml
207
213
  comfyui_mcp_volume:
@@ -239,15 +245,22 @@ comfyui_mcp_volume:
239
245
  geometry_estimation: models/geometry_estimation/
240
246
  optical_flow: models/optical_flow/
241
247
  detection: models/detection/
248
+
249
+ # registered by the node packs themselves, not by ComfyUI core:
250
+ ultralytics: models/ultralytics/ # Impact Subpack
251
+ ultralytics_bbox: models/ultralytics/bbox/
252
+ ultralytics_segm: models/ultralytics/segm/
253
+ sams: models/sams/ # Impact Pack (SAMLoader)
242
254
  ```
243
255
 
244
256
  Notes:
245
257
 
246
- * **`is_default: true`** is the load-bearing line. ComfyUI's
258
+ * **`is_default: true`** keeps the volume category paths first for lookup. ComfyUI's
247
259
  `add_model_folder_path(..., is_default=True)` **inserts** the path at the front
248
- of each category's list, so `/workspace/models/<cat>` becomes the default
249
- download target. Without it, the image's `/opt/ComfyUI/models/<cat>` (ephemeral)
250
- would stay first and Manager downloads would **not** persist.
260
+ of each category's list, so `/workspace/models/<cat>` is preferred for lookup.
261
+ The launch's explicit `--models-directory /workspace/models` is the separate
262
+ guarantee that Manager's explicit relative `save_path` writes also land on the
263
+ volume; `is_default` alone cannot change `folder_paths.models_dir`.
251
264
  * **No `custom_nodes:` key** — on purpose. Mapping `custom_nodes` to the volume
252
265
  would break the fast-restart contract.
253
266
  * `base_path: /workspace` with `models/...` relative subpaths mirrors ComfyUI's
@@ -255,8 +268,28 @@ Notes:
255
268
  * The category **keys** match ComfyUI's `folder_names_and_paths` keys (verified
256
269
  against `master`'s `folder_paths.py`). The category list mirrors the example's
257
270
  full set; harmless if a future ComfyUI renames one.
271
+ * **Custom node packs register their own categories, and those are NOT in ComfyUI's
272
+ example.** A category absent from this file has no `/workspace` entry at all, so
273
+ `/opt/ComfyUI/models/<cat>` stays its only path and downloads land on the ephemeral
274
+ image layer - no error, just gone after the next rebuild (#2302). Adding the key is
275
+ sufficient and order-independent: packs register via a helper that calls
276
+ `add_model_folder_path` **without** `is_default`, i.e. it appends behind whatever this
277
+ file already put at the front. Impact Pack also registers `onnx` (read from its
278
+ source, deliberately left out of #2302's fix as it is a deprecated provider);
279
+ `insightface`, `facerestore_models` and `rembg` are the same shape but have NOT
280
+ been audited — do that before adding them.
258
281
  * `/post_start.sh` pre-creates the matching subfolders under `/workspace/models`
259
282
  so they exist on a cold volume.
283
+ * **This file does not reach a node pack's OWN installer.** It adds *search* paths;
284
+ it does not move `folder_paths.models_dir`, which is what Impact Pack's and Impact
285
+ Subpack's `install.py` derive their download directory from (Subpack has no
286
+ `folder_paths` fallback at all). So `post_start.sh` also exports
287
+ `COMFYUI_MODEL_PATH=/workspace/models` before launching ComfyUI - pack installers
288
+ read that first, and Manager runs them as children of the ComfyUI process, so they
289
+ inherit it. Without it, installing Impact Subpack drops `face_yolov8m.pt` into
290
+ `/opt/ComfyUI/models/ultralytics/bbox` and Impact Pack drops `sam_vit_b_01ec64.pth`
291
+ into `/opt/ComfyUI/models/sams`, both on the ephemeral layer. ComfyUI core never
292
+ reads `COMFYUI_MODEL_PATH`, so this redirects only the packs' installers.
260
293
 
261
294
  ### Warm model volume (skip the cold HF pull)
262
295
 
@@ -59,3 +59,19 @@ comfyui_mcp_volume:
59
59
  geometry_estimation: models/geometry_estimation/
60
60
  optical_flow: models/optical_flow/
61
61
  detection: models/detection/
62
+
63
+ # Impact Pack / Impact Subpack register these categories THEMSELVES at import
64
+ # time (Subpack: ultralytics, ultralytics_bbox, ultralytics_segm — Pack: sams),
65
+ # so without the entries below the categories exist only as the in-image
66
+ # /opt/ComfyUI/models/<cat> and a FaceDetailer user's YOLO/SAM weights land on
67
+ # the ephemeral layer and vanish on the next rebuild (#2302).
68
+ #
69
+ # Order is safe either way round: both packs register via a helper that calls
70
+ # folder_paths.add_model_folder_path WITHOUT is_default, i.e. it APPENDS. So if
71
+ # this file loads first the volume path is already index 0 and the pack appends
72
+ # behind it; if the pack loads first, `is_default: true` above inserts the
73
+ # volume path at the FRONT. Either way /workspace stays the download target.
74
+ ultralytics: models/ultralytics/
75
+ ultralytics_bbox: models/ultralytics/bbox/
76
+ ultralytics_segm: models/ultralytics/segm/
77
+ sams: models/sams/
@@ -141,7 +141,8 @@ for sub in checkpoints configs loras vae text_encoders clip diffusion_models \
141
141
  controlnet t2i_adapter gligen upscale_models latent_upscale_models \
142
142
  hypernetworks photomaker classifiers model_patches audio_encoders \
143
143
  background_removal frame_interpolation geometry_estimation \
144
- optical_flow detection; do
144
+ optical_flow detection \
145
+ sams ultralytics ultralytics/bbox ultralytics/segm; do
145
146
  mkdir -p "${MODELS_DIR}/${sub}"
146
147
  done
147
148
 
@@ -442,6 +443,17 @@ CN_VOL="${WORKSPACE}/custom_nodes"
442
443
  CN_LINK="${COMFY_HOME}/custom_nodes"
443
444
  CN_SEED="${COMFY_HOME}/custom_nodes_seed"
444
445
  export PIP_CACHE_DIR="${WORKSPACE}/.cache/pip"
446
+ # Pack install scripts resolve their OWN download dir from $COMFYUI_MODEL_PATH and
447
+ # fall back to the IMAGE's models dir when it is unset. extra_model_paths.yaml cannot
448
+ # reach them: it adds SEARCH paths, it does not move folder_paths.models_dir. So
449
+ # Impact Subpack's installer drops face_yolov8m.pt into
450
+ # /opt/ComfyUI/models/ultralytics/bbox (it has no folder_paths fallback at all) and
451
+ # Impact Pack's drops sam_vit_b_01ec64.pth into /opt/ComfyUI/models/sams - both on the
452
+ # ephemeral layer, both gone on the next rebuild (#2302). ComfyUI core never reads this
453
+ # variable (models_dir comes from --models-directory or base_path), so setting it
454
+ # redirects ONLY the node packs' own installers, and onto the same dirs
455
+ # extra_model_paths.yaml already maps.
456
+ export COMFYUI_MODEL_PATH="${MODELS_DIR}"
445
457
  mkdir -p "${CN_VOL}" "${PIP_CACHE_DIR}"
446
458
 
447
459
  # (a) Point the image's custom_nodes at the volume. Replace whatever is there — a
@@ -569,10 +581,12 @@ fi
569
581
  # -----------------------------------------------------------------------------
570
582
  # 5. Launch ComfyUI from the BAKED venv (image), pointed at the volume dirs.
571
583
  # Invoke the venv python by ABSOLUTE PATH (no `activate` needed).
572
- # Per-directory flags keep user/input/output on /workspace; models come from
573
- # extra_model_paths.yaml (is_default volume is primary). custom_nodes are
574
- # symlinked onto the volume in §4.5 above (so runtime installs persist); we do
575
- # NOT use --base-directory (it would relocate the whole tree, incl. the venv).
584
+ # Per-directory flags keep user/input/output on /workspace. --models-directory
585
+ # makes ComfyUI's folder_paths.models_dir the persistent volume root, which is
586
+ # required for Manager's explicit relative save_path values; the extra path map
587
+ # still puts every category's volume subfolder first. custom_nodes are symlinked
588
+ # onto the volume in §4.5 above (so runtime installs persist); we do NOT use
589
+ # --base-directory (it would relocate the whole tree, incl. the venv).
576
590
  # -----------------------------------------------------------------------------
577
591
  VPY="${COMFY_HOME}/venv/bin/python"
578
592
  if [ ! -x "${VPY}" ]; then
@@ -612,6 +626,7 @@ ARGS=(--listen 0.0.0.0 --port "${COMFY_PORT}"
612
626
  --enable-manager --enable-cors-header
613
627
  "${ATTN_ARGS[@]}"
614
628
  --user-directory "${USER_DIR}"
629
+ --models-directory "${MODELS_DIR}"
615
630
  --input-directory "${INPUT_DIR}"
616
631
  --output-directory "${OUTPUT_DIR}")
617
632
  # Load the volume model map only if the file exists (it's baked, but be defensive).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comfyui-mcp",
3
- "version": "0.52.122",
3
+ "version": "0.52.123",
4
4
  "mcpName": "io.github.artokun/comfyui-mcp",
5
5
  "description": "Local-first, agent-native control plane for ComfyUI — MCP server + autonomous sidebar agent that drives your live graph in natural language on ANY LLM: Claude/ChatGPT/Gemini on your subscription (no API key), free local models via Ollama (fully offline), or any hosted model via an OpenAI-compatible endpoint (DeepSeek, GLM, MiMo, OpenRouter). Generate images, video & audio, author and run workflows, manage models and custom nodes; a compact tool-router mode keeps even 4B models effective, and a built-in LLM Arena benchmarks them on real ComfyUI tasks. Also a Claude Code plugin with skills, slash commands, and installer packs. Local, LAN, VPS, or Comfy Cloud.",
6
6
  "homepage": "https://comfyui-mcp.artokun.io/docs",