Fix safety inputs to use 'safety' in video inference API

This commit is contained in:
Sirshendu Ganguly
2025-10-29 11:06:59 -04:00
parent 843422e01c
commit 47696ff476
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -309,8 +309,14 @@ class txt2vid:
genConfig[0]["providerSettings"] = providerSettings
# Add safety inputs if provided
# Note: Video inference API only supports 'mode' key for safety
if safetyInputs is not None and isinstance(safetyInputs, dict) and len(safetyInputs) > 0:
genConfig[0]["safetyInputs"] = safetyInputs
# Filter to only include 'mode' (only allowed key for video inference)
filtered_safety = {}
if "mode" in safetyInputs:
filtered_safety["mode"] = safetyInputs["mode"]
if filtered_safety:
genConfig[0]["safety"] = filtered_safety
# Add video advanced feature inputs if provided
if videoAdvancedFeatureInputs is not None and isinstance(videoAdvancedFeatureInputs, dict) and len(videoAdvancedFeatureInputs) > 0:
File diff suppressed because one or more lines are too long