ERROR - ❌ Error during video generation: Error code: 400 -
{'error': 'Validation of body failed', 'issues': [
{'origin': 'string', 'code': 'too_big', 'maximum': 1000, 'inclusive': True,
'path': ['promptText'], 'message': 'Too big: expected string to have <=1000 characters'}
]}
Root Cause: Enhanced motion prompts were exceeding Runway API's 1000-character limit for promptText field.
Created _generate_concise_motion_from_scene() method with shorter but effective descriptions:
"Leaves gently swaying in the breeze, branches moving naturally, dappled sunlight shifting through the canopy, smooth camera movement, dynamic motion, flowing movement, high quality video, smooth motion, no text, no letters, no words, pure visual content, cinematic quality"
Length: ~250+ characters (before image prompt)
"Leaves swaying gently, branches moving, shifting sunlight through canopy, fluid motion, no text"
Length: ~95 characters (much more room for image prompt)
# Ensure we're under 1000 characters
if len(final_prompt) > 1000:
# Truncate base prompt to fit
max_base_length = 1000 - len(f", {motion_enhancer}, {quality_enhancer}")
base_prompt = base_prompt[:max_base_length]
final_prompt = f"{base_prompt}, {motion_enhancer}, {quality_enhancer}"
logger.info(f"🎬 Enhanced video prompt ({len(final_prompt)} chars): {final_prompt}")- Motion enhancers: 6 concise options (vs 8 verbose)
- Quality enhancers: 4 short options (vs 7 long)
- Selected enhancers: 2 total (vs 3+ previously)
- 🌊 Water: "Water flowing naturally, gentle waves, reflections dancing on surface"
- 🌲 Forest: "Leaves swaying gently, branches moving, shifting sunlight through canopy"
- ⛰️ Mountain: "Clouds drifting slowly, grass swaying, atmospheric mist moving"
- 🌸 Garden: "Petals falling softly, flowers swaying, butterflies floating gently"
- 🔥 Fire: "Flames dancing naturally, warm light flickering, heat distortion"
- 🌃 Night: "Stars twinkling softly, moonlight shifting, gentle night atmosphere"
- Base motion description: ~60-80 characters
- Motion enhancer: ~15-20 characters
- Quality enhancer: ~10-15 characters
- Separators: ~5 characters
- Image prompt space: ~800-900 characters
- Total: <1000 characters ✅
- Image enhancement: Limited to 800 characters total
- Video prompt: Truncated at 600 characters if user-provided
- Final check: Hard limit enforcement before API call
❌ Error: Validation of body failed - Too big: <=1000 characters
🎬 Video URL: https://dnznrvs05pmza.cloudfront.net/65284c7c-ebe6-4105-b93e-d2ad514e15c1.mp4
✅ SUCCESS! Character limit issue fixed!
🎯 Fixed Issues:
✅ Prompt under 1000 characters
✅ Still maintains dynamic motion
✅ Keeps cinematic enhancement
✅ NO text elimination remains activeDespite the character reduction, videos still feature:
- ✅ Scene-appropriate motion (water flowing, leaves swaying, etc.)
- ✅ Cinematic camera movement
- ✅ NO text or letters in videos
- ✅ Dynamic visual elements
- ✅ Professional quality enhancement
# Log character count for monitoring
logger.info(f"🎬 Enhanced video prompt ({len(final_prompt)} chars): {final_prompt}")
# Safety check before API call
if len(final_prompt) > 1000:
# Automatic truncation with preservation of key elements- Motion keywords (highest priority - always included)
- Quality enhancers (medium priority - always included)
- Base description (truncated if needed to fit)
- If user prompt is very long, automatically truncate while preserving motion enhancement
- Always maintain core motion and quality keywords
- Graceful degradation rather than failure
- Use concise scene descriptions in image prompts
- Let the system auto-generate motion (don't provide custom video prompts unless necessary)
- Longer prompts will be automatically optimized
- Complex scenes will be simplified while maintaining motion quality
- Optimal: 50-100 characters (leaves most room for motion enhancement)
- Good: 100-200 characters (still plenty of room)
- Acceptable: 200-400 characters (some truncation may occur)
- Automatic handling: 400+ characters (system will optimize)
✅ Character limit compliance - No more API errors ✅ Enhanced motion preserved - Still dynamic videos ✅ Automatic optimization - System handles length management ✅ Quality maintained - Same cinematic results ✅ Error-free generation - Reliable video creation
The motion enhancement system now works reliably within Runway API's character limits while maintaining all the dynamic motion improvements! 🎬✨