Files
alisson-anjos-ComfyUI-BFSNodes/__init__.py
T
alisson-anjosandClaude Opus 4.8 5ce4840242 Add LTX Identity CAN node: apply trained AdaLN identity modulation at inference
The ArcFace projector (appended text tokens) has ~0 impact (cross-attn can ignore them). CAN
injects identity into the self-attn AdaLN (shift+gate) of even blocks — a channel the model can't
ignore. Trained on top of the reference LoRA it lifts identity a lot (humo 0.52 -> 0.69) with no
first-frame leak. Node rebuilds CANModulation per even block from identity_adapters_*.safetensors
(can.<i>.*), extracts the reference ArcFace, and patches each even block's native forward with
shift_msa += dshift; gate_msa += tanh(dgate) — the exact training formula. Lazy imports; defensive
__init__. Weight-load + CAN forward validated headless; block patch untested in ComfyUI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 22:31:46 +00:00

47 lines
2.3 KiB
Python

from .nodes import NODE_CLASS_MAPPINGS as BFS_NODE_CLASS_MAPPINGS
from .nodes import NODE_DISPLAY_NAME_MAPPINGS as BFS_NODE_DISPLAY_NAME_MAPPINGS
from .ltxv_editanything import NODE_CLASS_MAPPINGS as LTXV_EA_NODE_CLASS_MAPPINGS
from .ltxv_editanything import NODE_DISPLAY_NAME_MAPPINGS as LTXV_EA_NODE_DISPLAY_NAME_MAPPINGS
from .headswap_node import NODE_CLASS_MAPPINGS as HEADSWAP_NODE_CLASS_MAPPINGS
from .headswap_node import NODE_DISPLAY_NAME_MAPPINGS as HEADSWAP_NODE_DISPLAY_NAME_MAPPINGS
from .anime2real_node import NODE_CLASS_MAPPINGS as A2R_NODE_CLASS_MAPPINGS
from .anime2real_node import NODE_DISPLAY_NAME_MAPPINGS as A2R_NODE_DISPLAY_NAME_MAPPINGS
from .amv_guide_node import NODE_CLASS_MAPPINGS as AMV_NODE_CLASS_MAPPINGS
from .amv_guide_node import NODE_DISPLAY_NAME_MAPPINGS as AMV_NODE_DISPLAY_NAME_MAPPINGS
from .ltx_identity_overlap import NODE_CLASS_MAPPINGS as IDT_NODE_CLASS_MAPPINGS
from .ltx_identity_overlap import NODE_DISPLAY_NAME_MAPPINGS as IDT_NODE_DISPLAY_NAME_MAPPINGS
try:
from .ltx_identity_gemma_vision import NODE_CLASS_MAPPINGS as GV_NODE_CLASS_MAPPINGS
from .ltx_identity_gemma_vision import NODE_DISPLAY_NAME_MAPPINGS as GV_NODE_DISPLAY_NAME_MAPPINGS
except Exception as _e: # noqa
print(f"[BFSNodes] LTX Identity Gemma-Vision node not loaded: {_e!r}")
GV_NODE_CLASS_MAPPINGS, GV_NODE_DISPLAY_NAME_MAPPINGS = {}, {}
try:
from .ltx_identity_can import NODE_CLASS_MAPPINGS as CAN_NODE_CLASS_MAPPINGS
from .ltx_identity_can import NODE_DISPLAY_NAME_MAPPINGS as CAN_NODE_DISPLAY_NAME_MAPPINGS
except Exception as _e: # noqa
print(f"[BFSNodes] LTX Identity CAN node not loaded: {_e!r}")
CAN_NODE_CLASS_MAPPINGS, CAN_NODE_DISPLAY_NAME_MAPPINGS = {}, {}
NODE_CLASS_MAPPINGS = {
**GV_NODE_CLASS_MAPPINGS,
**CAN_NODE_CLASS_MAPPINGS,
**BFS_NODE_CLASS_MAPPINGS,
**LTXV_EA_NODE_CLASS_MAPPINGS,
**HEADSWAP_NODE_CLASS_MAPPINGS,
**A2R_NODE_CLASS_MAPPINGS,
**AMV_NODE_CLASS_MAPPINGS,
**IDT_NODE_CLASS_MAPPINGS,
}
NODE_DISPLAY_NAME_MAPPINGS = {
**GV_NODE_DISPLAY_NAME_MAPPINGS,
**CAN_NODE_DISPLAY_NAME_MAPPINGS,
**BFS_NODE_DISPLAY_NAME_MAPPINGS,
**LTXV_EA_NODE_DISPLAY_NAME_MAPPINGS,
**HEADSWAP_NODE_DISPLAY_NAME_MAPPINGS,
**A2R_NODE_DISPLAY_NAME_MAPPINGS,
**AMV_NODE_DISPLAY_NAME_MAPPINGS,
**IDT_NODE_DISPLAY_NAME_MAPPINGS,
}