Share fallback field-label cleanup

This commit is contained in:
2026-06-27 01:53:06 +02:00
parent 5ab2433ca7
commit 2d3d668359
5 changed files with 47 additions and 9 deletions
+5 -5
View File
@@ -63,6 +63,10 @@ def _split_avoid(text: str) -> tuple[str, str]:
return input_policy.split_avoid(text)
def _strip_prompt_field_labels(text: str) -> str:
return input_policy.strip_prompt_field_labels(text, field_labels=PROMPT_FIELD_LABELS)
def _prompt_field(text: str, label: str) -> str:
return input_policy.prompt_field(text, label, field_labels=PROMPT_FIELD_LABELS)
@@ -416,11 +420,7 @@ def _fallback_text_to_sdxl(
nude_weight: float,
) -> tuple[str, str, str]:
positive, negative = _split_avoid(_strip_trigger(source_text, preserve_trigger))
positive = re.sub(
r"\b(?:Scene|Setting|Pose|Sexual pose|Sexual scene|Facial expressions?|Composition|Role graph|Camera control):\s*",
"",
positive,
)
positive = _strip_prompt_field_labels(positive)
tags = _combine_tags(positive, ", ".join(_explicit_tags(positive, nude_weight)))
return tags, negative, "text(fallback)"