Skip to content

Commit 750384a

Browse files
committed
Fix HunyuanVideo 1.5 modular glyph regex to match curly quotes
The `extract_glyph_texts` helper in the HunyuanVideo 1.5 modular pipeline had a copy-paste typo: both alternatives of the pattern matched ASCII double quotes (`\"(.*?)\"|\"(.*?)\"`), making the second branch redundant and silently dropping any text wrapped in the Chinese/smart curly quotes `“…”`. The non-modular counterpart in `src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5.py` uses the correct pattern `\"(.*?)\"|“(.*?)”`, which is what the model expects for glyph rendering — HunyuanVideo 1.5 is a bilingual model, so Chinese prompts that quote text with `“…”` would skip glyph extraction entirely under the modular path and produce mis-rendered poster text. This aligns the modular pipeline's pattern with the canonical one.
1 parent c8c8401 commit 750384a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/diffusers/modular_pipelines/hunyuan_video1_5

src/diffusers/modular_pipelines/hunyuan_video1_5/encoders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def format_text_input(prompt, system_message):
4444

4545

4646
def extract_glyph_texts(prompt):
47-
pattern = r"\"(.*?)\"|\"(.*?)\""
47+
pattern = r"\"(.*?)\"|(.*?)"
4848
matches = re.findall(pattern, prompt)
4949
result = [match[0] or match[1] for match in matches]
5050
result = list(dict.fromkeys(result)) if len(result) > 1 else result

0 commit comments

Comments
 (0)