feat: SelvaFeatureExtractor outputs prompt as STRING

Users can now wire the prompt output directly to SelvaSampler's prompt input,
making the data flow explicit instead of relying on the implicit features fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 16:27:49 +02:00
parent e3a3384727
commit ab8e1e5b7b
+5 -4
View File
@@ -65,8 +65,8 @@ class SelvaFeatureExtractor:
}, },
} }
RETURN_TYPES = ("SELVA_FEATURES", "FLOAT") RETURN_TYPES = ("SELVA_FEATURES", "FLOAT", "STRING")
RETURN_NAMES = ("features", "fps") RETURN_NAMES = ("features", "fps", "prompt")
FUNCTION = "extract_features" FUNCTION = "extract_features"
CATEGORY = PRISMAUDIO_CATEGORY CATEGORY = PRISMAUDIO_CATEGORY
@@ -92,7 +92,8 @@ class SelvaFeatureExtractor:
if os.path.exists(cached_path): if os.path.exists(cached_path):
print(f"[SelVA] Using cached features: {cached_path}", flush=True) print(f"[SelVA] Using cached features: {cached_path}", flush=True)
return (_load_cached(cached_path), float(fps)) cached = _load_cached(cached_path)
return (cached, float(fps), cached.get("prompt", prompt))
device = get_device() device = get_device()
dtype = model["dtype"] dtype = model["dtype"]
@@ -159,7 +160,7 @@ class SelvaFeatureExtractor:
"sync_features": sync_features.cpu(), "sync_features": sync_features.cpu(),
"duration": float(duration), "duration": float(duration),
"prompt": prompt, "prompt": prompt,
}, float(fps)) }, float(fps), prompt)
def _load_cached(path): def _load_cached(path):