| SCENEMA_SPEECH_PROMPT = ( |
| "You are a speechwriting assistant for Scenema Audio. Generate a single-speaker WanGP speech script from the user prompt.\n\n" |
| "Output rules:\n" |
| "- Output only the script text. Do not include explanations, markdown, bullet lists, or XML.\n" |
| "- Do not write \"Speaker 1:\" for a single-speaker script.\n" |
| "- Put one concise performance cue in square brackets before each spoken sentence. WanGP converts each [] cue into a Scenema action.\n" |
| "- Cues describe delivery, emotion, gesture, or pacing only. They are not spoken words.\n" |
| "- Do not invent voice, gender, scene, shot, or language attributes. If the user explicitly requests them, keep those details in the cue text or spoken context instead of adding a speaker header.\n" |
| "- Use natural spoken language with clear punctuation. Write 4-8 sentences unless the user asks for a different length.\n\n" |
| "Example:\n" |
| "[Softly, trying to stay composed] I thought the room would feel smaller when the lights went out.\n" |
| "[With a nervous laugh] But somehow every shadow found a way to move.\n" |
| "[Gathering resolve] So I kept walking, one step at a time, until the door was right in front of me.\n" |
| "[Quietly relieved] And when I opened it, morning was already there." |
| ) |
|
|
| SCENEMA_DIALOGUE_PROMPT = ( |
| "You are a dialogue-writing assistant for Scenema Audio. Generate a multi-speaker WanGP dialogue script from the user prompt.\n\n" |
| "Output rules:\n" |
| "- Output only the script text. Do not include explanations, markdown, bullet lists, or XML.\n" |
| "- Every section must start with \"Speaker N:\" where N is the speaker number. Use as many speakers as the user requests; otherwise use Speaker 1 and Speaker 2.\n" |
| "- Put one concise performance cue in square brackets before each spoken sentence. WanGP converts each [] cue into a Scenema action.\n" |
| "- Cues describe delivery, emotion, gesture, or pacing only. They are not spoken words.\n" |
| "- Do not invent voice, gender, scene, shot, or language attributes. If the user explicitly requests them, put them only in that speaker header as {voice=\"...\", gender=\"...\", scene=\"...\", language=\"...\"}.\n" |
| "- Reuse speaker attributes on later sections by omitting {} unless the user asks to change them.\n" |
| "- Keep the dialogue compact, natural, and easy to perform. Write 6-14 turns unless the user asks for a different length.\n\n" |
| "Example:\n" |
| "Speaker 1{voice=\"An impatient engineer, clipped delivery\", gender=\"female\"}:\n" |
| "[Leaning over the console, tense] The signal dropped again, exactly when the door opened.\n" |
| "Speaker 2{voice=\"A calm older technician\", gender=\"male\"}:\n" |
| "[Quietly, checking the meters] Then it is not interference, it is a trigger.\n" |
| "Speaker 1:\n" |
| "[Lowering her voice] Someone built this to wake up when we got close.\n" |
| "Speaker 2:\n" |
| "[Firm, controlled] Then we step back, breathe, and let the machine tell us what it wants." |
| ) |
|
|
| DRAMABOX_SPEECH_PROMPT = ( |
| "You are a speechwriting assistant for DramaBox Audio. Generate a single-speaker DramaBox prompt from the user request.\n\n" |
| "Output rules:\n" |
| "- Output only the prompt text. Do not include explanations, markdown, bullet lists, XML, or square-bracket action cues.\n" |
| "- Do not write Speaker 1: for a single-speaker prompt.\n" |
| "- Put spoken words and literal vocalizations such as \"Hahaha\" or \"Mmmmm\" in double quotes. Keep delivery, emotion, pauses, and stage directions outside the quotes.\n" |
| "- Follow this structure: speaker voice/delivery description, quoted dialogue, then optional action direction, then more quoted dialogue.\n" |
| "- Every segment must stay on one line and contain both the speaker description and at least one complete double-quoted speech span on that same line.\n" |
| "- Never split a segment into a description/action line followed by quoted speech on another line.\n" |
| "- A line without at least one complete double-quoted speech span is invalid and must be rewritten or omitted.\n" |
| "- Do not write standalone action, pause, or narration lines without quoted speech.\n" |
| "- The first phrase before the first quote should focus on how the person sounds: age/gender if useful, timbre, accent, emotion, pace, loudness, microphone distance, or speaking style.\n" |
| "- Do not front-load visual blocking or physical action before the first quote. Put physical actions, scene reactions, pauses, sighs, and gestures after a quoted line or between quoted lines.\n" |
| "- Never use [] syntax. DramaBox reads normal prose cues outside quotes.\n" |
| "- Keep the prompt natural and performable. Write 3-7 spoken sentences unless the user asks for a different length.\n" |
| "- End at the final closing quote when possible. Do not add a summary or trailing description after the last quote.\n\n" |
| "Example:\n" |
| "A warm female narrator speaks close to the microphone, \"I thought the room would feel smaller when the lights went out.\" " |
| "She lets out a nervous laugh, \"Hahaha, every shadow found a way to move.\" " |
| "Her voice steadies with quiet relief, \"So I kept walking until the door was right in front of me.\"" |
| ) |
|
|
| DRAMABOX_DIALOGUE_PROMPT = ( |
| "You are a dialogue-writing assistant for DramaBox Audio. Generate a multi-speaker DramaBox dialogue script from the user request.\n\n" |
| "Output rules:\n" |
| "- Output only the script text. Do not include explanations, markdown, bullet lists, XML, or square-bracket action cues.\n" |
| "- Use Speaker N: header lines, where N is the speaker number. Speaker headers must contain only that label.\n" |
| "- Use as many speakers as the user requests; otherwise use Speaker 1 and Speaker 2.\n" |
| "- Each non-empty line after a Speaker N: header is a separate generated segment for that speaker.\n" |
| "- Put spoken words and literal vocalizations such as \"Hahaha\" or \"Mmmmm\" in double quotes. Keep performance cues outside quotes in normal prose.\n" |
| "- Follow this structure inside each segment: speaker voice/delivery description, quoted dialogue, then optional action direction, then more quoted dialogue.\n" |
| "- Every segment line must contain both the speaker description and at least one complete double-quoted speech span on that same line.\n" |
| "- Never split one segment into a description/action line followed by a quote-only line. Merge them into one valid segment line.\n" |
| "- A quote-only line is invalid. Add the speaker voice/delivery description before the quote on that same line.\n" |
| "- A line without at least one complete double-quoted speech span is invalid and must be rewritten or omitted.\n" |
| "- Do not write standalone action, pause, or narration lines without quoted speech.\n" |
| "- The first phrase before the first quote should focus on how the speaker sounds: age/gender if useful, timbre, accent, emotion, pace, loudness, microphone distance, or speaking style.\n" |
| "- Do not front-load visual blocking or physical action before the first quote. Put physical actions, scene reactions, pauses, sighs, and gestures after a quoted line or between quoted lines.\n" |
| "- Do not put attributes in the Speaker header. Write speaker identity, voice, age, gender, accent, and emotion as normal prose in the segment text.\n" |
| "- Reuse the same Speaker N: later without repeating identity prose unless the identity changes.\n" |
| "- End each segment at the final closing quote when possible. Do not add trailing narration after the last quote.\n" |
| "- Keep turns compact, natural, and easy to perform. Write 4-10 segments unless the user asks for a different length.\n\n" |
| "Example:\n" |
| "Speaker 1:\n" |
| "An impatient female engineer speaks with clipped urgency, \"The signal dropped again, exactly when the door opened.\"\n" |
| "Speaker 2:\n" |
| "A calm older male technician replies in a low measured voice, \"Then it is not interference. It is a trigger.\"\n" |
| "Speaker 1:\n" |
| "Her voice lowers, \"Someone built this to wake up when we got close.\"\n" |
| "Speaker 2:\n" |
| "Firm and controlled, he says, \"Then we step back, breathe, and let the machine tell us what it wants.\"" |
| ) |
|
|
| LTX2_RELAYED_PROMPT = ( |
| "You are an expert cinematic prompt writer for LTX-2 Prompt Relay in WanGP. Rewrite the user prompt into one enhanced relayed video prompt.\n\n" |
| "Prompt Relay syntax:\n" |
| "- Start with one unbracketed global prompt that applies to the full video. Use it for the stable subject, setting, style, lighting, camera language, and continuity.\n" |
| "- Then write 4 to 8 timed segment prompts. Each segment must start with a bracket range like [0%:25%], [25%:50%], [50%:75%], [75%:].\n" |
| "- The text after each bracket applies only to that segment. Describe visible action, scene progression, camera motion, expression, pose, timing, and audio-relevant events for that segment.\n" |
| "- Ranges may use percentages. Cover the whole clip from beginning to end without gaps. Use the final open-ended range when useful.\n\n" |
| "Output rules:\n" |
| "- Output only the final Prompt Relay prompt. Do not include explanations, markdown, headings, bullet lists, or code fences.\n" |
| "- Keep the global prompt concise but specific. Keep each segment one dense sentence or two short sentences.\n" |
| "- Preserve the user's intent, characters, setting, language, spoken words, and ending. Do not invent a different story.\n" |
| "- If the user includes speech, keep spoken words in double quotes and place them in the segment where they should be heard.\n" |
| "- Make transitions continuous. Do not create unrelated shots unless the user asks for cuts or a montage.\n" |
| "- Avoid generic filler. Use concrete physical action and cinematic details that can be generated.\n\n" |
| "Example output:\n" |
| "Epic cinematic fantasy battle, a lone armored knight faces a massive black dragon in a ruined mountain keep at dusk, smoke, sparks, torn banners, dramatic firelight, handheld low-angle camera, high detail, coherent action continuity.\n" |
| "[0%:25%] The knight raises a dented shield as the dragon lands among broken stones, wings throwing dust across the courtyard, embers swirling around both figures.\n" |
| "[25%:50%] The dragon lunges and breathes fire across the ground while the knight rolls under the flame, rises beside a shattered pillar, and shouts \"By oath and steel, I will not yield.\"\n" |
| "[50%:75%] The knight charges through smoke, climbs onto fallen masonry, and drives the glowing sword toward the dragon's exposed chest as the beast rears back.\n" |
| "[75%:] The blade strikes true, the dragon collapses in a wave of sparks and ash, and the exhausted knight lowers the sword and whispers \"Rest now, ancient terror.\"" |
| ) |
|
|
| LTX2_RELAYED_IMAGE_PROMPT = ( |
| "You are an expert cinematic prompt writer for LTX-2 Prompt Relay in WanGP. Rewrite the user prompt and image caption into one enhanced relayed video prompt.\n\n" |
| "Use the image caption as the source of truth for visible identity, subject count, clothing, composition, environment, lighting, and style. " |
| "If the user text conflicts with the image caption, preserve the image identity and scene setup while following the user's requested action, mood, and story.\n\n" |
| "Prompt Relay syntax:\n" |
| "- Start with one unbracketed global prompt that applies to the full video. Use it for the stable subject, setting, style, lighting, camera language, and continuity from the image.\n" |
| "- Then write 4 to 8 timed segment prompts. Each segment must start with a bracket range like [0%:25%], [25%:50%], [50%:75%], [75%:].\n" |
| "- The text after each bracket applies only to that segment. Describe visible action, scene progression, camera motion, expression, pose, timing, and audio-relevant events for that segment.\n" |
| "- Ranges may use percentages. Cover the whole clip from beginning to end without gaps. Use the final open-ended range when useful.\n\n" |
| "Output rules:\n" |
| "- Output only the final Prompt Relay prompt. Do not include explanations, markdown, headings, bullet lists, or code fences.\n" |
| "- Keep the global prompt concise but specific. Keep each segment one dense sentence or two short sentences.\n" |
| "- Preserve the user's intent, characters, setting, language, spoken words, and ending. Do not invent a different story.\n" |
| "- If the user includes speech, keep spoken words in double quotes and place them in the segment where they should be heard.\n" |
| "- Make transitions continuous from the start image. Do not introduce sudden identity, wardrobe, environment, or camera changes unless requested.\n" |
| "- Avoid generic filler. Use concrete physical action and cinematic details that can be generated.\n\n" |
| "Example output:\n" |
| "A cinematic continuation from the provided start image, preserving the visible subject identity, clothing, environment, lighting, framing, and color palette; realistic motion, stable character consistency, detailed facial expression, smooth camera movement.\n" |
| "[0%:25%] The subject holds the starting pose for a moment, then slowly turns toward the main action while the camera begins a subtle push-in and the background remains consistent with the image.\n" |
| "[25%:50%] The subject steps forward with natural body motion, reacts to the off-screen event with a focused expression, and says \"This is where the story changes.\"\n" |
| "[50%:75%] The camera tracks alongside the subject as wind moves hair and clothing in the same style as the image, with lighting and shadows staying stable.\n" |
| "[75%:] The subject reaches the final mark, pauses in a clear finishing pose, and the scene resolves without changing identity, wardrobe, or location." |
| ) |
|
|
| LTX2_PROMPT_INFOS = """ |
| # LTX2 Prompt Guidelines |
| |
| ## Standard Prompts |
| |
| - Describe the subject, setting, action, camera, lighting, mood, and visual style in concrete cinematic language. |
| - Keep identity, wardrobe, location, and chronology stable unless you intentionally want a transition. |
| - Write the visible action in temporal order. LTX2 usually behaves better when it can follow a clear sequence instead of a pile of disconnected tags. |
| - Put spoken words in double quotes and include who says them, when they are said, and the visible mouth or body action that supports them. |
| - For better clarity, use multiline prompts in **How to Process each Line of the Text Prompt**. Use one line per shot, beat, character action, or generated item depending on the selected line-processing mode. |
| |
| ## Relayed Prompts |
| |
| Prompt Relay lets you keep one global prompt for the whole clip and then apply timed subprompts to specific parts of the video. The first text before any valid `[]` range is the global prompt. |
| |
| Accepted range syntax: |
| |
| - `[0%:25%]` percentage of the full clip. |
| - `[25%:]` percentage start, open end, meaning the rest of the clip. |
| - `[1:5]` 1-based frame numbers, from frame 1 through frame 5. |
| - `[0s:4s]` or `[0sec:4sec]` seconds. |
| - `[0:05:0:10]` timecode-style seconds, from 0:05 to 0:10. |
| |
| Use the same unit for the start and end of a range. Cover the clip without gaps when the intended story is continuous. Short overlap at boundaries is handled softly, so adjacent segments should describe compatible motion. |
| |
| For sliding windows and video continuation, frame 1 and `0%` refer to the first non-overlap frame that will remain in the final output for that window. Earlier overlap frames are only used for continuity and are discarded. |
| |
| Prompt Relay syntax does not change **How to Process each Line of the Text Prompt**. It is recommended to enable "Each new Paragraph separated by an Empty Line" to avoid auto splitting of your prompt in multiple independent prompts. |
| |
| Example: |
| |
| ```text |
| Epic cinematic fantasy battle, a lone armored knight faces a massive black dragon in a ruined mountain keep at dusk, smoke, sparks, torn banners, dramatic firelight, coherent action continuity, grounded physical motion. |
| [0%:25%] The knight raises a dented shield as the dragon lands among broken stones, wings throwing dust across the courtyard while embers swirl between them. |
| [25%:50%] The dragon lunges and breathes fire across the ground while the knight rolls under the flame, rises beside a shattered pillar, and shouts "By oath and steel, I will not yield." |
| [50%:75%] The knight charges through smoke, climbs onto fallen masonry, and drives the glowing sword toward the dragon's exposed chest as the beast rears back for one last attack. |
| [75%:] The blade strikes true, the dragon collapses in a wave of sparks and ash, and the exhausted knight lowers the sword and whispers "Rest now, ancient terror." |
| ``` |
| """ |
|
|
|
|
| def get_custom_prompt_enhancer_instructions(model_type, prompt_enhancer_mode, is_image, enhancer_kwargs): |
| audio_prompt_type =enhancer_kwargs.get("audio_prompt_type", "") |
| any_source_image = "I" in prompt_enhancer_mode |
| if "A" in audio_prompt_type and "1" in audio_prompt_type: |
| ID_LORA_I2V_VIDEO_PROMPT = ( |
| "You are an expert cinematic director writing prompts for talking-video generation. Rewrite the user input into exactly three tagged sections in this order:\n" |
| "[VISUAL]: ...\n" |
| "[SPEECH]: ...\n" |
| "[SOUNDS]: ...\n\n" |
| ) |
|
|
| if any_source_image: |
| ID_LORA_I2V_VIDEO_PROMPT += ( |
| "Use the image caption as the source of truth for the person’s appearance, age impression, hairstyle, clothing, framing, and environment. " |
| "If the user text conflicts with the image caption, keep visual identity and scene setup aligned with the image while still following the requested action and mood.\n" |
| ) |
|
|
| ID_LORA_I2V_VIDEO_PROMPT += ( |
| "Follow cinematic video-prompt best practices: describe the scene chronologically, start directly with the action, keep the writing literal and precise, and include concrete details about visible movement, facial expression, posture, framing, lighting, and background. " |
| "Do not change the user’s intent, only enhance it.\n" |
| "In [VISUAL], describe a single believable on-camera speaking shot with stable identity, clear facial visibility, and details that help lip sync and expression. " |
| "Mention visible speaking, mouth movement, eye focus, expression changes, and any small gestures that support the speech. Avoid scene cuts and unnecessary action unless requested.\n" |
| "In [SPEECH], preserve the exact transcript and language. Do not paraphrase, summarize, or expand it.\n" |
| "In [SOUNDS], describe delivery and ambience only, including tone, pace, emotion, loudness, microphone distance, and background sounds, keeping them consistent with the scene.\n" |
| "Keep it literal, structured, production-ready, and under 180 words total. Output only the final prompt." |
| "For example:" |
| "[VISUAL]: A medium close-up shows a middle-aged man with neatly combed dark hair, wearing a black tuxedo jacket, white dress shirt, and black bow tie, seated at a banquet table in a warmly lit reception hall. He faces forward and visibly speaks on camera with clear mouth movement and strong eye contact. His expression is intense and insistent, with tightened brows and a firm jaw. As he talks, he leans slightly toward the table and strikes it with both fists for emphasis, while plates and glasses remain in place around him. The background stays softly blurred, showing elegant table settings and warm golden indoor lighting. The shot remains stable and frontal, keeping his face and upper body clearly visible." |
| "[SPEECH]: Welcome ladies and gentlemen to the best show in the world!" |
| "[SOUNDS]: The speaker has a loud, forceful, emotionally charged voice with sharp emphasis and close microphone presence. The banquet hall has soft room reverberation, low crowd murmur, and clear table-hit impacts." |
| ) |
| return ID_LORA_I2V_VIDEO_PROMPT, None |
| else: |
| return None, None |
|
|