You can now provide exact custom script text for video narration instead of relying on auto-generated content. This gives you complete control over what the voice says.
- Purpose: Provide exact text for the voice narration
- Priority: Overrides style-based auto-generation
- Limit: 2000 characters maximum
- Usage: Combined with
voice_typefor complete control
curl -X POST "http://localhost:8000/generate-video-from-prompt" \
-H "Content-Type: application/json" \
-d '{
"image_prompt": "A beautiful mountain landscape with flowing water",
"voice_type": "female",
"voice_script_preview": "Hello everyone! Welcome to this amazing visual journey. What you'\''re seeing here is absolutely incredible - a perfect demonstration of nature'\''s beauty. The way the light dances across the scene creates such a mesmerizing effect.",
"merge_audio": true
}'from src.text_extractor import TextExtractor
extractor = TextExtractor()
custom_script = """
Welcome to our nature documentary! Today we're exploring one of the most
breathtaking landscapes on Earth. Notice how the water reflects the sky
perfectly, creating a mirror-like effect that has captivated visitors
for generations. This is truly a masterpiece of natural beauty.
"""
result = extractor.generate_video_from_prompt(
image_prompt="A serene mountain lake with perfect reflections",
voice_type="male",
voice_script_preview=custom_script,
merge_audio=True
)# Professional Female Narrator
{
"image_prompt": "A corporate office environment",
"voice_type": "female_soft",
"voice_script_preview": "In today's business landscape, efficiency and collaboration are key. This modern workspace represents the future of productive environments."
}
# Energetic Male Presenter
{
"image_prompt": "An exciting sports scene",
"voice_type": "male",
"voice_script_preview": "Get ready for the action! This is where champions are made and legends are born. Feel the energy and excitement in every moment!"
}
# Educational Narrator
{
"image_prompt": "A scientific laboratory",
"voice_type": "male_deep",
"voice_script_preview": "Welcome to the cutting edge of scientific research. Here, dedicated researchers work tirelessly to unlock the mysteries of our universe."
}{
"image_prompt": "A sleek modern smartphone on a clean desk",
"video_prompt": "Smooth camera movement around the device with elegant lighting",
"voice_type": "female_bright",
"voice_script_preview": "Introducing the future of mobile technology. With its stunning design and powerful features, this device redefines what's possible in your pocket. Experience innovation at your fingertips.",
"duration": 10,
"merge_audio": true
}{
"image_prompt": "A tropical beach with crystal clear water and palm trees",
"video_prompt": "Gentle waves washing ashore with palm trees swaying in the breeze",
"voice_type": "male_warm",
"voice_script_preview": "Escape to paradise where time stands still. Feel the warm sand between your toes and let the ocean breeze wash away your worries. This is where memories are made.",
"duration": 10,
"merge_audio": true
}{
"image_prompt": "A detailed diagram of the solar system",
"video_prompt": "Planets slowly orbiting with cosmic effects",
"voice_type": "male_deep",
"voice_script_preview": "Our solar system contains eight planets, each with unique characteristics. From Mercury's extreme temperatures to Neptune's powerful winds, each world tells a story of cosmic evolution spanning billions of years.",
"duration": 10,
"merge_audio": true
}maleβ Deep, authoritative voice (onyx)femaleβ Bright, energetic voice (nova)
male_deepβ Very authoritative (onyx)male_warmβ Friendly, approachable (echo)female_brightβ Energetic, engaging (nova)female_softβ Gentle, soothing (shimmer)
alloyβ Balanced, neutralechoβ Warm, friendlyfableβ Storytelling characteronyxβ Deep, authoritativenovaβ Bright, energeticshimmerβ Soft, gentle
- Match Duration: ~150-200 words per minute
- Natural Speech: Write as you would speak
- Clear Pronunciation: Avoid complex technical terms
- Emotional Tone: Match voice type to content mood
- Pacing: Include natural pauses with punctuation
- Character Limit: 2000 characters maximum
- Voice Selection: Choose voice that matches content tone
- Merge Audio: Always use
merge_audio: truefor complete videos - Duration: Longer videos (10s) allow more detailed scripts
"In today's competitive market, innovation drives success. This solution represents years of research and development, designed to meet the evolving needs of modern businesses."
"What we're observing here demonstrates fundamental principles of physics in action. Notice how each element interacts with the others, creating a perfect example of natural harmony."
"This is absolutely incredible! You're looking at something that will blow your mind. The way everything comes together is just pure magic - you have to see it to believe it!"
"Discover the difference that quality makes. With attention to every detail and commitment to excellence, this represents the pinnacle of craftsmanship and innovation."
{
"voice_type": "female",
"style": "descriptive"
}{
"voice_type": "female",
"voice_script_preview": "Your exact custom text here"
}- Old style-based generation still works
- Custom script takes priority when provided
- Can mix and match in different videos
β
Status: success
π¬ Video URL: http://localhost:8000/merged-video/1759139866
ποΈ Audio URL: http://localhost:8000/audio/35c66c0f
π΅ Complete video with custom narration generated!- β Custom script text used exactly as provided
- β Voice type mapping works (female β nova voice)
- β Audio generation from custom script
- β Video+audio merging successful
- β Primary video URL points to merged version
- β Both separate audio and merged video accessible
- Product demos with specific messaging
- Educational content with precise information
- Marketing videos with brand-specific language
- Tutorials with step-by-step instructions
- Documentaries with researched narration
- Presentations with scripted content
- Exact control over every word
- Brand consistency in messaging
- Technical accuracy for specialized content
- Emotional timing matched to visuals
- Length precision for specific durations
- Professional quality with planned content
The custom voice script feature is fully implemented and tested. You now have complete control over your video narration while maintaining all the enhanced motion, moderation bypass, and audio merging capabilities.
Start creating videos with your exact custom scripts today! π¬ποΈβ¨