AsifBridge commited on
Commit
f8d678e
·
verified ·
1 Parent(s): 6023138

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +78 -0
app.py ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Import libraries
2
+ import gradio as gr
3
+
4
+ # Define dropdown options
5
+ daytime_options = ["", "Early Morning", "Morning", "Late Morning", "Noon", "Early Afternoon", "Afternoon", "Late Afternoon", "Golden Hour", "Pre-Sunset", "Sunset", "After Sunset", "Twilight"]
6
+ nighttime_options = ["", "Dusk", "Early Evening", "Evening", "Late Evening", "Night", "Late Night", "Blue Hour", "Midnight", "Pre-Dawn", "Predawn Twilight", "First Light", "Dawn"]
7
+ indoor_locations = ["", "Conference Hall", "Bedroom", "Lounge", "Store", "Underground Subway", "Kitchen", "Living Room", "Bathroom", "Library", "Office", "Gym", "Warehouse", "Theater", "Hospital Room", "Art Gallery", "School Classroom", "Laboratory", "Bar", "Hotel Lobby", "Airport Terminal", "Shopping Mall", "Museum", "Recording Studio", "Church", "Dance Studio"]
8
+ outdoor_locations = ["", "Mountain", "Grassland", "Village", "City", "Beach", "Forest", "Desert", "Lake", "Ocean", "River", "Valley", "Cliff", "Canyon", "Garden", "Park", "Bridge", "Street Market", "Harbor", "Meadow", "Island", "Farm", "Field of Flowers", "Swamp", "Volcano", "Waterfall"]
9
+ sky_options = ["", "Clear Sky", "Cloudy Sky", "Stormy Sky", "Overcast", "Sunset Sky", "Sunrise Sky", "Twilight", "Starlit Sky", "Moonlit Sky", "Partly Cloudy", "Hazy Sky", "Foggy", "Blue Sky", "Aurora Borealis", "Dramatic Clouds"]
10
+ sun_positions = ["", "Directly Overhead", "Low in the East", "Low in the West", "High in the East", "High in the West", "Golden Hour", "Setting in the Horizon", "Rising in the Horizon", "Directly in Front", "Directly Behind", "Scattered Rays", "Soft Diffuse", "Hazy Sun", "Bright and Sharp", "Glimmering"]
11
+ camera_positions = ["", "Eye Level", "High Angle", "Low Angle", "Overhead", "Bird's Eye View", "Worm's Eye View", "Dutch Angle", "Close-Up", "Wide Shot", "Medium Shot", "Extreme Close-Up", "Over-the-Shoulder", "Point-of-View", "Tilted", "Side Angle"]
12
+
13
+ # Other attribute options for user guidance (excluded in output prompts)
14
+ lighting_moods = ["", "Warm and Inviting", "Mystical", "Dramatic", "Gritty", "Soft and Dreamy", "High Contrast", "Ethereal", "Dark and Moody", "Vibrant", "Natural", "Subdued", "Harsh"]
15
+ emotional_moods = ["", "Romantic", "Suspenseful", "Melancholic", "Joyful", "Nostalgic", "Tense", "Eerie", "Intense", "Hopeful", "Whimsical", "Serene", "Foreboding"]
16
+ camera_lenses = ["", "ARRI Signature Prime", "Cooke S4/i Prime", "Panavision Primo", "Zeiss Master Prime", "Leica Summilux-C", "Canon K35", "Hawk V-Lite", "Angenieux Optimo", "IMAX Hasselblad", "Sony CineAlta"]
17
+ camera_filters = ["", "Tiffen Pro-Mist", "Schneider Hollywood Black Magic", "Tiffen Glimmerglass", "Formatt Hitech ND", "Schneider Tru-Pol", "Hoya IRND", "B+W 812 Warming", "Tiffen Low Contrast", "IMAX ND", "Schneider Classic Soft"]
18
+ cinematic_blurs = ["", "Gaussian Blur", "Motion Blur", "Bokeh Blur", "Radial Blur", "Tilt-Shift Blur", "Zoom Blur", "Lens Blur", "Directional Blur", "Depth of Field Blur", "Anamorphic Blur", "Foggy Blur", "Defocus Blur"]
19
+ focus_options = ["", "Deep Focus", "Shallow Focus", "Soft Focus", "Split Focus", "Rack Focus", "Selective Focus", "Macro Focus", "Infinity Focus", "Zone Focus", "Follow Focus"]
20
+ key_light_positions = ["", "Front Light", "Side Light", "Back Light", "Top Light", "Bottom Light", "45-Degree High", "Overhead Light", "Three-Quarter Front", "Edge Light", "Diagonal Back"]
21
+ film_grain_options = ["", "Fine Grain", "Medium Grain", "Coarse Grain", "Color Grain", "Monochrome Grain", "Soft Grain", "Sharp Grain", "Natural Grain", "Dense Grain", "Minimal Grain"]
22
+ aperture_settings = ["", "f/1.4", "f/2", "f/2.8", "f/4", "f/5.6", "f/8", "f/11", "f/16", "f/22", "f/32"]
23
+ iso_settings = ["", "ISO 100", "ISO 200", "ISO 400", "ISO 800", "ISO 1600", "ISO 3200", "ISO 6400", "ISO 12800", "ISO 25600", "ISO 51200"]
24
+ shutter_speeds = ["", "1/1000", "1/500", "1/250", "1/125", "1/60", "1/30", "1/15", "1/8", "1/4", "1/2"]
25
+
26
+ # Function to generate prompts for each AI platform
27
+ def generate_prompts(
28
+ daytime, nighttime, indoor_location, outdoor_location, sky_option, sun_position, camera_position, lighting_mood,
29
+ emotional_mood, camera_lens, camera_filter, cinematic_blur, focus_option,
30
+ key_light_position, film_grain, aperture, iso, shutter_speed, user_text
31
+ ):
32
+ # Collect non-empty components
33
+ components = [daytime, nighttime, indoor_location, outdoor_location, sky_option, sun_position, camera_position, lighting_mood,
34
+ emotional_mood, camera_lens, camera_filter, cinematic_blur, focus_option,
35
+ key_light_position, film_grain, aperture, iso, shutter_speed, user_text]
36
+ core_prompt = ", ".join([component for component in components if component])
37
+
38
+ # Generate platform-specific prompts
39
+ midjourney_prompt = f"[Midjourney] {core_prompt}"
40
+ luma_prompt = f"[Luma AI] {core_prompt}"
41
+ runway_prompt = f"[Runway] {core_prompt}"
42
+ klingai_prompt = f"[KlingAI] {core_prompt}"
43
+
44
+ return midjourney_prompt, luma_prompt, runway_prompt, klingai_prompt
45
+
46
+ # Interface with platform-specific outputs
47
+ gr.Interface(
48
+ fn=generate_prompts,
49
+ inputs=[
50
+ gr.Dropdown(daytime_options, label="Daytime"),
51
+ gr.Dropdown(nighttime_options, label="Nighttime"),
52
+ gr.Dropdown(indoor_locations, label="Indoor Location"),
53
+ gr.Dropdown(outdoor_locations, label="Outdoor Location"),
54
+ gr.Dropdown(sky_options, label="Sky Condition"),
55
+ gr.Dropdown(sun_positions, label="Sun Position"),
56
+ gr.Dropdown(camera_positions, label="Camera Position"),
57
+ gr.Dropdown(lighting_moods, label="Lighting Mood"),
58
+ gr.Dropdown(emotional_moods, label="Emotional Mood"),
59
+ gr.Dropdown(camera_lenses, label="Camera Lens"),
60
+ gr.Dropdown(camera_filters, label="Camera Filter"),
61
+ gr.Dropdown(cinematic_blurs, label="Cinematic Blur"),
62
+ gr.Dropdown(focus_options, label="Focus Option"),
63
+ gr.Dropdown(key_light_positions, label="Key Light Position"),
64
+ gr.Dropdown(film_grain_options, label="Film Grain"),
65
+ gr.Dropdown(aperture_settings, label="Aperture"),
66
+ gr.Dropdown(iso_settings, label="ISO"),
67
+ gr.Dropdown(shutter_speeds, label="Shutter Speed"),
68
+ gr.Textbox(label="User Custom Prompt")
69
+ ],
70
+ outputs=[
71
+ gr.Textbox(label="Midjourney Prompt"),
72
+ gr.Textbox(label="Luma Prompt"),
73
+ gr.Textbox(label="Runway Prompt"),
74
+ gr.Textbox(label="KlingAI Prompt")
75
+ ],
76
+ title="Cinematic Prompt Generator for AI Platforms",
77
+ description="Generate tailored prompts for Midjourney, Luma, Runway, and KlingAI based on cinematic attributes."
78
+ ).launch()