- Deletes the urllib-based remote_decode_hf() function (moved to companion).
- Deletes the 'from .network_utils import huggingface_vae_decode...' import.
- RemoteVAEDecodeWorker._worker() now calls _companion_decode() instead.
The worker class (threading, manifest writing, dashboard events) is unchanged.
Only the network atom is forwarded to 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.
Commit 490c519 added a webp/png/jpg dropdown but only flush_batch_with_vae
honored it. Three other save sites still hardcoded WEBP:
- flush_batch_with_remote_vae (image_generation.py)
- upscale_runner.py (3 sites in inline + deferred upscale paths)
- distribution_worker.py (PIL bytes shipped back to master)
Now all save sites read image_format from session_settings (orchestrator)
or the job spec (distributed) and match the format/extension.
Changes:
- remote_vae.py: RemoteVAEDecodeWorker accepts image_format kwarg; _worker
uses it to pick format/extension at save time (the real save site for the
remote VAE path — flush_batch_with_remote_vae only queues to the worker)
- generation_orchestrator.py: passes image_format to all RemoteVAEDecodeWorker
constructors (initialize_remote_vae + 3 per-config sites); adds image_format
to all 8 existing_data["meta"] writes so upscale_runner can read it from disk
- upscale_runner.py: reads image_format from manifest meta at thread start;
uses _fmt/_ext locals at all 3 save sites (seedvr2, latent-decode, PIL)
- distribution_manager.py: injects _session_image_format into worker job
config alongside existing _session_cooldown passthrough
- distribution_worker.py: reads _session_image_format from config; encodes
bytes in the chosen format; stamps _image_ext on meta so master uses it
- distribution_routes.py: pops _image_ext from meta to build filename with
correct extension before writing bytes to disk
Default behavior unchanged: all paths fall back to webp if image_format
is absent or unrecognised.
Code review found this in 490c519.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
HF_ENDPOINTS now imported from network_utils as single source of truth.
Tensor serialization and query string construction moved to gateway.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove diffusers from requirements.txt to avoid conflicts with other
custom nodes that may pin older versions. Wrap the import in remote_vae.py
with try/except so the node loads fully even without diffusers — only
Remote VAE features are unavailable, with a clear error message guiding
users on how to fix it.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>