gokaygokay commited on
Commit
4fa548e
·
1 Parent(s): dd8afa8

fix prompts

Browse files
Files changed (1) hide show
  1. llm_inference_video.py +12 -53
llm_inference_video.py CHANGED
@@ -35,66 +35,25 @@ class VideoLLMInferenceNode:
35
  try:
36
  # Video prompt templates
37
  prompt_templates = {
38
- "cinematic": f"""Create a detailed cinematic prompt for a {duration}-second video. Include:
39
- - 3-5 distinct scenes with smooth transitions
40
- - Camera movements: {camera_style}
41
- - Lighting design for {style} style
42
- - Special effects: {special_effects}
43
- - Color grading and film grain details
44
- - Pacing: {pacing}
45
- - Add {custom_elements if custom_elements else 'unique atmospheric elements'}
46
- Format: Timestamped scene descriptions with shot types and transition notes.""",
47
 
48
- "documentary": f"""Develop a documentary-style video prompt for {duration} seconds. Include:
49
- - Interview setup with lighting and background
50
- - B-roll sequences (3-5 locations)
51
- - Archival footage integration
52
- - Text overlay and info-graphics
53
- - Narration style and tone
54
- - {camera_style} camera work
55
- - {pacing} rhythm for topic exploration
56
- - {special_effects} for historical recreations""",
57
 
58
- "animation": f"""Create a {style} animation prompt for {duration} seconds. Specify:
59
- - Animation technique (2D/3D/stop-motion)
60
- - Key action sequences (3-5)
61
- - Character design elements
62
- - Background art style
63
- - Motion blur and frame rate considerations
64
- - Camera zooms/pans for {pacing} pacing
65
- - Special effects: {special_effects}
66
- - {custom_elements if custom_elements else 'unique stylistic flourishes'}""",
67
 
68
- "action": f"""Generate intense action sequence prompt ({duration} seconds). Include:
69
- - 3 escalating action beats
70
- - Camera angles for {style} impact
71
- - Stunt choreography details
72
- - Slow-motion/fast-cut ratios
73
- - Explosion/sfx elements: {special_effects}
74
- - Pacing structure: {pacing}
75
- - {camera_style} camera movements
76
- - Hero shot composition""",
77
 
78
- "experimental": f"""Design avant-garde video prompt ({duration} seconds) with:
79
- - Unconventional narrative structure
80
- - {style} visual treatments
81
- - Abstract transitions between {random.randint(5,8)} concepts
82
- - Experimental sound/image relationships
83
- - {camera_style} capture techniques
84
- - {special_effects} digital manipulations
85
- - Pacing: {pacing} with {custom_elements if custom_elements else 'temporal distortions'}"""
86
  }
87
 
88
  base_prompt = prompt_templates.get(style.lower(), prompt_templates["cinematic"])
89
- system_message = """You are a professional video director and cinematography expert.
90
- Generate rich, technical video prompts that include:
91
- 1. Scene-by-scene breakdowns with timestamps
92
- 2. Camera movements and lens specifications
93
- 3. Lighting setups and color palettes
94
- 4. Transition types and durations
95
- 5. Special effects implementation
96
- 6. Pacing and rhythm markers
97
- 7. Technical specifications when relevant"""
98
 
99
  # Select provider
100
  if provider == "Hugging Face":
 
35
  try:
36
  # Video prompt templates
37
  prompt_templates = {
38
+ "cinematic": f"""Create a single, detailed paragraph describing a {duration}-second cinematic video that captures {input_concept}. Focus on creating a cohesive narrative that incorporates {style} visual aesthetics, {camera_style} camera work, {pacing} pacing, and {special_effects} effects. Include atmospheric elements like {custom_elements if custom_elements else 'mood lighting and environmental details'} to enhance the storytelling. Describe the visual journey without technical timestamps or shot lists.""",
 
 
 
 
 
 
 
 
39
 
40
+ "documentary": f"""Write a comprehensive paragraph for a {duration}-second documentary-style video exploring {input_concept}. Blend observational footage with {camera_style} cinematography, incorporating {pacing} editorial rhythm and {special_effects} visual treatments. Focus on creating an immersive narrative that educates and engages, enhanced by {custom_elements if custom_elements else 'authentic moments and natural lighting'}.""",
 
 
 
 
 
 
 
 
41
 
42
+ "animation": f"""Compose a vivid paragraph describing a {duration}-second {style} animated video showcasing {input_concept}. Detail the unique visual style, character movements, and world-building elements, incorporating {camera_style} perspectives and {pacing} story flow. Include {special_effects} animation effects and {custom_elements if custom_elements else 'signature artistic elements'} to create a memorable visual experience.""",
 
 
 
 
 
 
 
 
43
 
44
+ "action": f"""Craft an energetic paragraph describing a {duration}-second action sequence centered on {input_concept}. Emphasize the dynamic flow of action using {camera_style} cinematography, {pacing} rhythm, and {special_effects} visual effects. Incorporate {style} stylistic choices and {custom_elements if custom_elements else 'impactful moments'} to create an adrenaline-pumping experience.""",
 
 
 
 
 
 
 
 
45
 
46
+ "experimental": f"""Create an avant-garde paragraph describing a {duration}-second experimental video exploring {input_concept}. Embrace unconventional storytelling through {style} aesthetics, {camera_style} techniques, and {pacing} temporal flow. Incorporate {special_effects} digital manipulations and {custom_elements if custom_elements else 'abstract visual metaphors'} to challenge traditional narrative structures."""
 
 
 
 
 
 
 
47
  }
48
 
49
  base_prompt = prompt_templates.get(style.lower(), prompt_templates["cinematic"])
50
+ system_message = """You are a visionary video director and creative storyteller. Create a single, richly detailed paragraph that paints a complete picture of the video concept. Focus on:
51
+ 1. Overall visual atmosphere and mood
52
+ 2. Narrative flow and story progression
53
+ 3. Distinctive visual style and aesthetic choices
54
+ 4. Key moments and visual highlights
55
+ 5. Emotional impact and audience experience
56
+ Avoid technical specifications or shot-by-shot breakdowns. Instead, create a flowing, descriptive narrative that captures the essence of the video."""
 
 
57
 
58
  # Select provider
59
  if provider == "Hugging Face":