mgbam commited on
Commit
f4f1e64
·
verified ·
1 Parent(s): 31646d0

Update core/prompt_engineering.py

Browse files
Files changed (1) hide show
  1. core/prompt_engineering.py +42 -0
core/prompt_engineering.py CHANGED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # core/prompt_engineering.py
2
+ def create_story_breakdown_prompt(user_idea, genre="sci-fi", mood="suspenseful"):
3
+ return f"""
4
+ You are an expert screenwriter and visual storyteller.
5
+ Based on the user's idea: "{user_idea}"
6
+ And considering the genre: "{genre}" and mood: "{mood}"
7
+
8
+ Generate a 3-scene story breakdown. For each scene, provide:
9
+ 1. scene_number (int)
10
+ 2. setting_description (str): Vivid description of the location and atmosphere.
11
+ 3. characters_involved (list of str): Names of characters in the scene.
12
+ 4. key_action (str): The main event or action happening.
13
+ 5. visual_style_suggestion (str): e.g., "Dark and gritty, high contrast, Blade Runner-esque neon"
14
+ 6. camera_angle_suggestion (str): e.g., "Low-angle shot to emphasize power"
15
+
16
+ Output ONLY the JSON object. Example for one scene:
17
+ {{
18
+ "scene_number": 1,
19
+ "setting_description": "A dimly lit, cluttered spaceship cockpit. Warning lights flash intermittently.",
20
+ "characters_involved": ["Captain Eva Rostova"],
21
+ "key_action": "Eva notices an unusual energy signature on the main console.",
22
+ "visual_style_suggestion": "Claustrophobic, practical lighting, lens flares.",
23
+ "camera_angle_suggestion": "Close-up on Eva's face, then a point-of-view shot of the console."
24
+ }}
25
+
26
+ Provide the full JSON structure for 3 scenes in a list:
27
+ [
28
+ {{scene1_details...}},
29
+ {{scene2_details...}},
30
+ {{scene3_details...}}
31
+ ]
32
+ """
33
+
34
+ def create_image_prompt_from_scene(scene_description, visual_style):
35
+ return f"""
36
+ Generate a highly detailed, photorealistic image generation prompt for an AI image generator.
37
+ The image should depict: {scene_description}
38
+ The style should be: {visual_style}.
39
+ Focus on cinematic composition, lighting, and mood.
40
+ Make the prompt suitable for models like DALL-E 3 or Midjourney.
41
+ Output only the prompt string.
42
+ """