Share fallback field-label cleanup
This commit is contained in:
+5
-5
@@ -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)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user