Files
ausboss-ComfyUI-AusBoss/__init__.py
T
ausboss c15c6c9317 Implement the pack audit batch: on-node pad editors, feature gaps, removals
The audit compared every node against ComfyUI core and the major packs;
this lands its outcomes in one branch.

On-node visual editing (the old Codex-pack interaction, rebuilt):
- New Load Image + Pad: image loader with whole-edge pad dragging on the
  node canvas, align-to-multiple rounding, and a megapixel target that
  rescales the source before padding so the mask seam stays binary.
- Pad Image gains the same handle canvas, fed by an execution-time
  snapshot of its input; wireframe with diagnostic empty states before
  the first run. Widgets, outputs, and saved workflows unchanged.
- Image Crop + Rotate + Pad's compact panel is now a live stage - crop,
  pad, and rotate handles on the node, one shared implementation with
  the full-screen editor so the two surfaces cannot drift.

Feature gaps closed against the ecosystem:
- Crop For Inpaint: target_megapixels, selectable rescale_algorithm
  (recorded in the stitcher for the paste-back), and extend_* inputs
  that grow the frame itself for outpainting.
- Save Video: format choice - mp4 h264, mp4 h265, webm vp9 with Opus
  (resampled to 48 kHz); CRF drives all three.
- Load Video: every_nth thinning (fps output divides to match) and a
  max_frames cap that ends the decode early.
- LoRA Loader: saved stack templates behind a bar button, and a console
  warning when a LoRA's base-model family disagrees with the checkpoint.
- LM Studio Chat: history in/out for multi-turn chains and a json_schema
  widget for structured replies.
- Drop Shadow: multiply blend and a shadow_mask output. Align Image:
  offset outputs for un-aligning after sampling. Color Match:
  first_frame reference mode as a one-node video flicker fix.

Removed (backed up in git history): Select Frame Range and the Video
Bundle family - core ImageFromBatch and the core VIDEO wire now cover
both jobs. Dead NODE_ID module variables cleaned out of every node file.

455 Python tests, 216 JS tests, validate_nodes.py green on 19 node files.
2026-08-17 10:49:55 -05:00

95 lines
2.9 KiB
Python

"""ComfyUI-AusBoss entry point.
Every node lives in its own file under nodes/ and exports its own
NODE_CLASS_MAPPINGS / NODE_DISPLAY_NAME_MAPPINGS. This file merges them
and hands the result to ComfyUI. To register a new node, add its module
name to NODE_MODULES below — nothing else to wire up.
A module that fails to import is skipped with a console warning instead
of taking the whole pack down, so one broken node never hides the rest.
"""
import importlib
import os
import re
import traceback
# One entry per file in nodes/. Keep alphabetical-ish; order only affects
# nothing functional.
NODE_MODULES = [
"node_align_image",
"node_color_match",
"node_compare",
"node_drop_shadow",
"node_frame_chooser",
"node_frame_interpolate",
"node_image_crop_rotate_pad",
"node_image_size",
"node_inpaint_crop_stitch",
"node_lama_inpaint",
"node_lmstudio_chat",
"node_load_image_pad",
"node_load_video",
"node_lora_loader",
"node_pad_image",
"node_refine_mask",
"node_save_video",
"node_select_frame",
"node_video_crop_rotate_pad",
]
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
_failed_modules = []
for _module_name in NODE_MODULES:
try:
_module = importlib.import_module(f".nodes.{_module_name}", __name__)
NODE_CLASS_MAPPINGS.update(getattr(_module, "NODE_CLASS_MAPPINGS", {}))
NODE_DISPLAY_NAME_MAPPINGS.update(
getattr(_module, "NODE_DISPLAY_NAME_MAPPINGS", {})
)
except Exception:
_failed_modules.append(_module_name)
traceback.print_exc()
# Folder ComfyUI serves to the browser; every .js file in it is loaded as a
# frontend extension. Shared modules use .mjs so they are import-only.
WEB_DIRECTORY = "./js"
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
def _read_version():
"""Version straight from pyproject.toml so it is never duplicated."""
try:
pyproject = os.path.join(os.path.dirname(__file__), "pyproject.toml")
with open(pyproject, "r", encoding="utf-8") as f:
match = re.search(r'^version\s*=\s*"([^"]+)"', f.read(), re.MULTILINE)
return match.group(1) if match else "unknown"
except Exception:
return "unknown"
def _print_banner():
# ASCII only in here: ComfyUI on Windows often runs with a cp1252
# console, and a UnicodeEncodeError at import time kills the whole pack.
teal = "\033[38;2;0;180;170m"
grey = "\033[0;37m"
red = "\033[0;31m"
reset = "\033[0m"
bar = f"{teal}{'-' * 70}{reset}"
print(bar)
print(
f" {teal}AusBoss{reset} v{_read_version()} | "
f"{len(NODE_CLASS_MAPPINGS)} nodes loaded"
)
if _failed_modules:
print(f" {red}Failed to load: {', '.join(_failed_modules)}{reset}")
print(f" {grey}https://github.com/ausboss/ComfyUI-AusBoss{reset}")
print(bar)
_print_banner()