- nodes/shared/{paths,metadata,routes}.py: single copies of
_sort_paths_newest_first, _strip_counter, _safe_json_loads, plus a
guarded register_get_route helper.
- wan22/latent_io.py: lift triplicated _coerce_enum, duplicated
_strip_counter and the two ~120-line _extract_sd3_shift methods to
module level (~180 duplicated lines removed).
- All five /mxd/* routes now register through the guarded helper, so a
missing PromptServer can no longer break node registration
(wan22 previously accessed PromptServer.instance.routes unguarded at
module scope).
- loraloader_mxd/server/utils_server.py: drop the never-called rgthree
/rgthree/ static-page routes and is_param_truthy; keep get_param /
is_param_falsy which routes_model_info.py imports.
- Delete inert web/addons/zip_loader/__init__.py.
Schema harness: 68 nodes identical to baseline.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
13 lines
431 B
Python
13 lines
431 B
Python
"""Small aiohttp request helpers used by routes_model_info.py."""
|
|
|
|
|
|
def get_param(request, param, default=None):
|
|
"""Gets a param from a request."""
|
|
return request.rel_url.query[param] if param in request.rel_url.query else default
|
|
|
|
|
|
def is_param_falsy(request, param):
|
|
"""Determines if a param is explicitly 0 or false."""
|
|
val = get_param(request, param)
|
|
return val is not None and (val == "0" or val.upper() == "FALSE")
|