Fix HunyuanVideo 1.5 modular glyph regex for curly quotes#13523
Open
Ricardo-M-L wants to merge 1 commit intohuggingface:mainfrom
Open
Fix HunyuanVideo 1.5 modular glyph regex for curly quotes#13523Ricardo-M-L wants to merge 1 commit intohuggingface:mainfrom
Ricardo-M-L wants to merge 1 commit intohuggingface:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
extract_glyph_textsin the HunyuanVideo 1.5 modular pipeline had a copy-paste typo in its regex:Both alternatives match ASCII double quotes. The second branch is redundant, and any text quoted with Chinese / smart curly quotes (
“…”) is silently dropped — no glyph extraction happens, so the model never receives the formattedText "..."instruction.The canonical, non-modular pipeline has the intended pattern (https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5.py#L93):
HunyuanVideo 1.5 is a bilingual Tencent model, so Chinese prompts that use
“…”to mark on-screen text are a realistic and documented input shape. Under the modular path they currently skip glyph extraction entirely and produce mis-rendered poster/caption text.Reproduction
Fix
Align the modular pipeline's pattern with the existing, correct non-modular pattern. One-character change.
Before submitting
Who can review?
@DN6 @yiyixuxu