eed7eefeac
Two ComfyUI nodes to reduce domain mismatch between custom training audio and the MMAudio VAE's expected spectral distribution: SelvaHfSmoother: blends a low-pass filtered copy (biquad) with the original at a configurable cutoff and blend ratio. Attenuates extreme HF content that BigVGANv2 handles poorly. RMS-preserving. SelvaSpectralMatcher: computes the log-mel energy profile of the clip, compares it per-band to the VAE's normalization means (DATA_MEAN_80D/128D), and applies a smooth STFT-domain gain correction to match the codec's training distribution. Configurable strength and max_gain_db clamp. RMS-preserving. Recommended workflow: SpectralMatcher → HfSmoother → feature extraction. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
1.7 KiB
Python
27 lines
1.7 KiB
Python
NODE_CLASS_MAPPINGS = {}
|
|
NODE_DISPLAY_NAME_MAPPINGS = {}
|
|
|
|
_NODES = {
|
|
"SelvaModelLoader": (".selva_model_loader", "SelvaModelLoader", "SelVA Model Loader"),
|
|
"SelvaFeatureExtractor": (".selva_feature_extractor", "SelvaFeatureExtractor", "SelVA Feature Extractor"),
|
|
"SelvaSampler": (".selva_sampler", "SelvaSampler", "SelVA Sampler"),
|
|
"SelvaLoraLoader": (".selva_lora_loader", "SelvaLoraLoader", "SelVA LoRA Loader"),
|
|
"SelvaLoraTrainer": (".selva_lora_trainer", "SelvaLoraTrainer", "SelVA LoRA Trainer"),
|
|
"SelvaLoraScheduler": (".selva_lora_scheduler", "SelvaLoraScheduler", "SelVA LoRA Scheduler"),
|
|
"SelvaDatasetBrowser": (".selva_dataset_browser", "SelvaDatasetBrowser", "SelVA Dataset Browser"),
|
|
"SelvaSkipExperiment": (".selva_skip_experiment", "SelvaSkipExperiment", "SelVA Skip Experiment"),
|
|
"SelvaLoraEvaluator": (".selva_lora_evaluator", "SelvaLoraEvaluator", "SelVA LoRA Evaluator"),
|
|
"SelvaVaeRoundtrip": (".selva_vae_roundtrip", "SelvaVaeRoundtrip", "SelVA VAE Roundtrip"),
|
|
"SelvaHfSmoother": (".selva_audio_preprocessors", "SelvaHfSmoother", "SelVA HF Smoother"),
|
|
"SelvaSpectralMatcher": (".selva_audio_preprocessors", "SelvaSpectralMatcher", "SelVA Spectral Matcher"),
|
|
}
|
|
|
|
for key, (module_path, class_name, display_name) in _NODES.items():
|
|
try:
|
|
import importlib
|
|
mod = importlib.import_module(module_path, package=__name__)
|
|
NODE_CLASS_MAPPINGS[key] = getattr(mod, class_name)
|
|
NODE_DISPLAY_NAME_MAPPINGS[key] = display_name
|
|
except (ImportError, AttributeError) as e:
|
|
print(f"[SelVA] Skipping {key}: {e}")
|