Centralize negative prompt hygiene

This commit is contained in:
2026-06-27 14:01:10 +02:00
parent 333fa5eae6
commit 4fdef3875b
7 changed files with 38 additions and 9 deletions
+3 -4
View File
@@ -38,7 +38,7 @@ try:
pov_labels_from_value as _pov_labels_from_value,
)
from .krea_pov_actions import pov_action_phrase as _pov_action_phrase
from .prompt_hygiene import sanitize_negative_text, sanitize_prose_text
from .prompt_hygiene import combine_negative_text, sanitize_negative_text, sanitize_prose_text
except ImportError: # Allows local smoke tests with `python -c`.
import formatter_input as input_policy
import krea_format_route
@@ -74,7 +74,7 @@ except ImportError: # Allows local smoke tests with `python -c`.
pov_labels_from_value as _pov_labels_from_value,
)
from krea_pov_actions import pov_action_phrase as _pov_action_phrase
from prompt_hygiene import sanitize_negative_text, sanitize_prose_text
from prompt_hygiene import combine_negative_text, sanitize_negative_text, sanitize_prose_text
TRIGGER_CANDIDATES = (
@@ -199,8 +199,7 @@ def _single_caption_front(row: dict[str, Any]) -> dict[str, str]:
def _combine_negative(*parts: str) -> str:
cleaned = [_clean(part).strip(" ,.") for part in parts if _clean(part).strip(" ,.")]
return ", ".join(cleaned)
return combine_negative_text(*parts)
def _sanitize_scene_text_for_cast(text: Any, labels: list[str]) -> str: