Commit Graph
33 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 23c857353b feat(civitai): add facade for ComfyUI-USCG-CivitAI companion
Adds is_civitai_available() and civitai_fetch_by_hash() with SILENT
fallback (returns None) when companion missing. No RuntimeError because
CivitAI lookup is an optional convenience — the LoRA workflow works
without auto-trigger detection.

Pre-existing callers already handle None on network failure, so this
facade is drop-in compatible.

Also updates tests/conftest.py to importlib-load the real civitai.py
(matches Phase 1/2 patterns for remote_vae + distribution).

Callers (config_builder_node.py + lora_utils.py) still import from
.network_utils as of this commit; the swap lands in the next commit.
2026-05-19 18:43:33 -07:00
Jason Hoku 4593802db8 test: add facade tests for upcoming CivitAI companion-plugin refactor 2026-05-19 18:40:10 -07:00
Jason Hoku 13149ff5f9 feat(distribution): add facade for ComfyUI-USCG-Distributed companion
Adds is_distribution_available(), _require_companion(), create_manager(),
set_active_manager(), clear_active_manager(), notify_workers_to_start(),
stop_all_workers(), get_master_url() plus INSTALL_INSTRUCTIONS.

create_manager passes three callbacks through to the companion's
DistributionManager (job_completed_check required, build_prompt_with_triggers
and get_model_cache_key optional) — avoids bidirectional imports back into
main USCG that the original distribution_manager.py had at line 91 (and 419).

Lazy try-import of the companion returns a clear error if not installed.
Defensive minimum-version check (>= 0.1.0). clear_active_manager is silent
when companion missing so cleanup paths are safe even if companion gets
uninstalled mid-run.

Also updates tests/conftest.py to importlib-load the real distribution.py
so facade tests exercise actual code (matches Phase 1's remote_vae pattern).

Old code paths in generation_orchestrator/distribution_routes/etc still
active; the swap lands in the next commits.
2026-05-19 15:03:28 -07:00
Jason Hoku b9cb87043f test: add facade tests for upcoming Distribution companion-plugin refactor 2026-05-19 14:57:28 -07:00
Jason Hoku f20a17d6ea refactor(orchestrator): drop HF_ENDPOINTS import; pass endpoint name to worker
The companion plugin (ComfyUI-USCG-RemoteVAE) resolves endpoint names to
URLs internally. Main USCG no longer needs the URL allowlist - it only
passes the endpoint NAME (e.g. 'SDXL') through the worker.
2026-05-19 13:19:19 -07:00
Jason Hoku e5f690eae5 feat(remote_vae): add facade for ComfyUI-USCG-RemoteVAE companion
Adds is_remote_vae_available(), get_endpoint_names(), _companion_decode()
plus INSTALL_INSTRUCTIONS constant. Lazy try-import of the companion module
returns a clear error if not installed. Old code paths still active; the
remote_decode_hf -> _companion_decode swap lands in the next task.

Also updates tests/conftest.py to load the real remote_vae module (via
importlib.util) so facade tests exercise actual code rather than a stub.
Adds network_utils real-load and diffusers/diffusers.image_processor stubs
to satisfy the remote_vae.py import chain in the test environment.
2026-05-19 13:08:27 -07:00
Jason Hoku 3b26bb0d14 test: add facade tests for upcoming remote_vae companion-plugin refactor 2026-05-19 12:55:23 -07:00
Jason Hoku 37a7b6aecf test: florence2_hires — regression test for state_to_configs_json passthrough 2026-05-18 01:34:05 -07:00
Jason Hoku 49b1406cff feat: upscale_runner — florence2_hires mode dispatch + manifest entry builders
Adds an elif block to _run_upscale_thread that handles mode='florence2_hires',
delegating per-image work to florence2_hires.run_florence2_step() and using
two new pure-Python helpers (build_florence2_manifest_entry,
build_florence2_no_detection_entry) to construct manifest entries.

The pure-Python helpers are unit-tested in test_florence2_manifest_entry.py;
the wiring itself relies on the user's smoke test (mirroring the LTX pattern).
2026-05-18 01:33:11 -07:00
Jason Hoku 78d6f7d966 feat: florence2_hires — run_florence2_step skeleton + no-detection path 2026-05-18 01:27:22 -07:00
Jason Hoku 115e093dcf feat: florence2_hires — per-image checkpoint+lora cache for from_manifest 2026-05-18 01:26:07 -07:00
Jason Hoku d8713fc4cc feat: florence2_hires — model loading with module-level cache 2026-05-18 01:24:59 -07:00
Jason Hoku a0fbe14272 feat: florence2_hires — preflight + node lookup + tests 2026-05-18 01:24:00 -07:00
Jason Hoku afe37cc21c feat: florence2_hires — pure-Python paste_into_image + round-trip tests 2026-05-18 01:23:06 -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 Hoku 3cb946927e feat: florence2_hires — mask-select index parser + tests 2026-05-18 01:12:01 -07:00
Jason Hoku f8822bc0b5 feat: florence2_hires — megapixel scaling math + tests 2026-05-18 01:11:25 -07:00
Jason HokuandClaude Opus 4.7 4fb4fea5ed fix: lock Compare Strengths to single-bracket form (no Cartesian)
When the user types '0.5, 1.0' they want 2 outputs (lora at 0.5, lora
at 1.0 — both model and clip mirroring), not 4 outputs (Cartesian
m×c). The bug was that we wrote both _model AND _clip side-channel
arrays, so Python emitted 'name:[m]:[c]' which the orchestrator
correctly interpreted as Cartesian.

JS: collapse the two-input compare section to a single 'Strengths:'
input. Never write _clip to lora_weight_arrays.

Python: process_lora_array now emits 'name:[m_arr]' (no clip part)
when only _model array is present. The generator's existing
parse_lora_definition defaults clip=model when the third segment
is missing, giving N configs with locked semantics.

Drops the Cartesian path entirely. Backward compat retained: if a
saved workflow has both arrays (legacy), the dual-bracket form is
still emitted so the orchestrator can Cartesian-expand as before.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 11:27:39 -07:00
Jason HokuandClaude Opus 4.7 3e9f9316c9 test: add 6 golden regression tests for state_to_configs_json
Covers single-lora pass-through, multi-lora combine with ' + ',
folder ref un-expansion, folder+brackets excluded from combine,
bypassed lora exclusion, and ltx_video model_type propagation.
Also tightens the existing bracket-array test from substring match
to exact string equality and removes the unused pytest import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 09:54:12 -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 0f8c25a588 feat: input_image folder expansion for ltx i2v sweeps 2026-04-25 20:23:11 -07:00
Jason Hoku 16b792601e test: update manifest entry test for image_path mirror 2026-04-25 20:13:39 -07:00
Jason Hoku d58f00a4d0 feat: ltx manifest entry builder, video media_type (manifest_utils.py untouched) 2026-04-25 17:53:30 -07:00
Jason Hoku 166ca832b2 feat: ltx-aware sort order for cache locality 2026-04-25 17:51:42 -07:00
Jason Hoku 2ccef19837 feat: ltx two-stage video generation pipeline (t2v, audio always-on) 2026-04-25 16:59:39 -07:00
Jason Hoku b90aa1b893 feat: ltx dual-clip prompt encoding with LTXVConditioning wrapping 2026-04-25 16:57:27 -07:00
Jason Hoku 94694ec07a feat: ltx model loading with per-file caching 2026-04-25 16:56:15 -07:00
Jason Hoku 6afd31602f feat: ltx preflight validation (nodes, ffmpeg, model files, sigmas) 2026-04-25 16:52:04 -07:00
Jason Hoku dca70cb90f feat: cache key for ltx_video model_type 2026-04-25 16:48:32 -07:00
Jason Hoku ef866b50db feat: cartesian expansion for ltx fields with audio_mode 'both' normalization 2026-04-25 16:43:08 -07:00
Jason Hoku 69830a3aef fix: parse_sigmas rejects trailing/leading/double commas 2026-04-25 16:39:34 -07:00
Jason Hoku 1ea4d7892d feat: ltx sigma string parser with tests 2026-04-25 16:34:19 -07:00