Files
hermes-agent/skills/creative/comfyui/tests
SHL0MS 51b44b6e3f fix(skills/comfyui): correct hallucinated node names and registry slugs
Self-review caught several errors in the previous commit:

Frontmatter
- Replace non-standard `requires_runtime` / `requires_tooling` fields with
  the documented `compatibility:` field (parsed by tools/skills_tool.py).
- Drop the `audit-v5` author tag I added unnecessarily.

MODEL_LOADERS catalog
- Remove `IPAdapterUnifiedLoader` (input `preset` is an enum, not a file).
- Remove `IPAdapterInsightFaceLoader` and `InsightFaceLoader` (input
  `provider` is a GPU backend selector, not a model file). These would have
  flagged enum values like "STANDARD" or "CUDA" as missing model files.
- Add "NB:" comment explaining `BasicGuider` has no `cfg` input
  (the original PARAM_PATTERNS entry would never have matched).
- Remove `SamplerCustomAdvanced.noise_seed` from PARAM_PATTERNS — that
  node takes a NOISE input from RandomNoise, not a seed field directly.

NODE_TO_PACKAGE registry slugs
- Verified all 18 packages against api.comfy.org and fixed:
  - `comfyui-essentials` → `comfyui_essentials` (underscore, not hyphen)
  - `comfyui-gguf` → `ComfyUI-GGUF` (case-sensitive)
  - `comfyui-photomaker-plus` → `ComfyUI-PhotoMaker-Plus`
  - `comfyui-wanvideowrapper` → `ComfyUI-WanVideoWrapper`
- ComfyUI-HunyuanVideoWrapper isn't on the registry; surface a git-URL
  install hint via new NODE_TO_GIT_URL fallback so the user can install
  via ComfyUI-Manager's /manager/queue/install endpoint.

Wrong class names
- `Canny` → `CannyEdgePreprocessor` (controlnet-aux registers the latter,
  the former never appears in /object_info).
- Add `Zoe_DepthAnythingPreprocessor` and `AnimalPosePreprocessor` while
  fixing controlnet-aux.
- Remove `Reroute (rgthree)` (rgthree's Reroute is JS-only — no Python
  class, never appears in /object_info).
- Add `Display Int (rgthree)` (sibling of Display Any).
- Move `UltralyticsDetectorProvider` from `comfyui-impact-pack` to
  `comfyui-impact-subpack` (separate package, registered there).

Tests
- Update test_packages_are_safe_for_shell to accept case-mixed slugs (the
  registry uses both ComfyUI- and comfyui_ prefixes inconsistently). Replaced
  the lowercase-only assertion with a shell-safe regex check.
- 117 tests still pass (105 unit + 8 cloud + 4 cross-host).

Attribution
- Add `SHL0MS@users.noreply.github.com` mapping to scripts/release.py
  AUTHOR_MAP so check-attribution CI passes.
2026-04-29 20:48:01 -07:00
..

ComfyUI Skill Tests

Pytest suite covering the skill's scripts. Pure-stdlib unit tests run without any setup; cloud integration tests need a Comfy Cloud API key.

Running

# Unit tests only (no network required) — runs in <1s
python3 -m pytest tests/ -c tests/pytest.ini -o addopts="-p no:xdist"

# Including cloud integration tests
COMFY_CLOUD_API_KEY="comfyui-..." python3 -m pytest tests/ \
  -c tests/pytest.ini -o addopts="-p no:xdist"

# Just cloud tests
COMFY_CLOUD_API_KEY="comfyui-..." python3 -m pytest tests/test_cloud_integration.py \
  -c tests/pytest.ini -o addopts="-p no:xdist" -v

The -c and -o overrides isolate this suite from any parent pyproject.toml pytest config (e.g. the -n auto from a parent repo).

Test files

File Coverage
test_common.py Cloud detection, URL routing, format validation, embeddings, paths, seeds, model-list parsing, folder aliases
test_extract_schema.py Connection tracing, positive/negative prompt detection, dedup logic, embedding deps
test_run_workflow.py Param injection (incl. -1 seed, link refusal), output download walk, runner construction
test_check_deps.py Model-name fuzzy matching, install command suggestions
test_cloud_integration.py Live cloud API contract tests (auto-skipped without API key)

Adding tests

When you change a script:

  1. Add a unit test if the change is pure logic (cloud detection, parsing, etc.)
  2. Add a cloud integration test if the change depends on cloud API behavior (use pytestmark = pytest.mark.cloud so it auto-skips without a key)
  3. Workflow fixtures live in conftest.py (sd15_workflow, flux_workflow, video_workflow)

Why the explicit -c / -o?

The parent hermes-agent repo's pyproject.toml enables pytest-xdist by default (-n auto). This suite is small enough that parallelism isn't worth the complexity, and pytest-xdist isn't always installed in the user's environment. The -c tests/pytest.ini -o addopts="-p no:xdist" flags make the suite run identically regardless of the parent project's config.