Commit Graph
5 Commits
Author SHA1 Message Date
Jason Hoku 490cec842f refactor: delete network_utils.py (~60 lines)
The CivitAI function moved to the ComfyUI-USCG-CivitAI companion in this
phase. After Phase 1 (HF VAE) and Phase 2 (Distribution), this was the
only function left. Now the file is empty and removable.

network_utils.py shrunk: 281 (original) -> 189 (Phase 1) -> 60 (Phase 2)
-> 0 (Phase 3, deleted).

Also tidies any dead network_utils references in tests/conftest.py.
2026-05-19 18:56:30 -07:00
Jason Hoku 5bf3a56e27 fix: detect missing checkpoint file and surface clear error
User report on a different machine: 'AttributeError: NoneType has no attribute
lower' at comfy/utils.py:126 inside load_torch_file. Root cause: manifest's
meta.model references a checkpoint that isn't installed on this machine —
folder_paths.get_full_path returns None, that None propagates through
load_checkpoint_guess_config to load_torch_file, crashes cryptically.

Two defensive checks:

1. upscale_runner._run_upscale_thread: validates the session checkpoint
   resolves to a real file BEFORE calling load_checkpoint. If not, sets
   job['error'] with a clear actionable message ('Copy the .safetensors
   file over, or regenerate the images on this machine') and exits early.

2. florence2_hires._get_or_load_checkpoint_lora: same check before the
   fresh-load path (different per-item model). On missing file, falls back
   to the session base with a one-line log so the upscale still completes
   instead of crashing the whole job.

Tests: added folder_paths.get_full_path to the root conftest stub returning
a synthetic path so mocked-loader tests don't trip the new file-check.
96/96 still passing.
2026-05-18 16:00:34 -07:00
Jason Hoku 712ec83253 feat: florence2_hires — pure-Python crop_image_by_mask + tests
Also: conftests now try to load real torch before installing the torch stub,
so tests that genuinely need real torch tensors (crop/paste, integration)
work when the Comfy embedded Python is used. Other tests are unaffected.
2026-05-18 01:20:29 -07:00
Jason HokuandClaude Opus 4.7 d07657c85b refactor: extract state_to_configs_json as single transformer
Eliminates the JS<->Python drift bug class by making one Python function
the source of truth for state -> configs_json. Both the runtime
(generate_config) and the new preview endpoint (next commit) call it.
Adds golden test for the lora-strength-arrays bracket case that just
broke (regression guard).

Also loads the real config_builder_node module in conftest.py (instead
of a bare stub) so that tests against UltimateConfigBuilder methods work
correctly. Stubs network_utils before loading to satisfy the relative
import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 09:44:12 -07:00
Jason Hoku 1ea4d7892d feat: ltx sigma string parser with tests 2026-04-25 16:34:19 -07:00