chore: vendor selva_core from jnwnlee/selva@d7d40a9

Pure PyTorch SelVA source for SelvaModelLoader/FeatureExtractor/Sampler nodes.
Imports rewritten from selva.* to selva_core.*. mel_converter.py: replaced
librosa.filters.mel with pure-numpy implementation to avoid librosa→numba→NumPy
version incompatibility in some ComfyUI environments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 15:18:09 +02:00
parent 762b19fd3a
commit 6bc3fd6443
106 changed files with 11323 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import torch
from selva_core.utils.misc import instantiate_from_config
from selva_core.model.networks_video_enc import TextSynch as TextSynchVideoEnc
from selva_core.model.networks_generator import MMAudio
_MODEL_ZOO = (TextSynchVideoEnc, MMAudio)
def create_model_from_factory(factory_path: str, name: str, **kwargs) -> torch.nn.Module:
"""
Dynamically imports and calls a model factory function.
"""
params = {'name': name, **kwargs}
model = instantiate_from_config(factory_path, params)
assert isinstance(model, _MODEL_ZOO), f"Model {type(model)} is not a valid model type."
return model