Spaces:
Sleeping
Sleeping
| # Import libraries | |
| import gradio as gr | |
| # Define all dropdown options with blank options where requested | |
| quality_options = [ | |
| "", "Cinematic Quality", "Hyper Realistic Quality", "VHS Quality", "Super 8 Quality", "HD Quality", "4K Quality", "8K Quality", "Film Grain Quality", | |
| "Vintage Quality", "Polaroid Quality", "Black and White Quality", "Sepia Quality", "HDR Quality", "Lomo Quality", "Soft Focus Quality", | |
| "Documentary Style Quality", "Surreal Quality", "Glossy Quality", "Matte Quality", "High Contrast Quality", | |
| "IMAX DMR Quality", "IMAX Enhanced Quality", "IMAX 70mm Film Quality" | |
| ] | |
| color_schemes = [ | |
| "", "Monochrome Color Scheme", "Sepia Color Scheme", "Warm Color Scheme", "Cool Color Scheme", "Cinematic Teal and Orange Color Scheme", "Vintage Color Scheme", | |
| "Pastel Color Scheme", "Neon Color Scheme", "Cyberpunk Color Scheme", "Muted Color Scheme", "High Contrast Color Scheme", "Earth Tones Color Scheme", | |
| "Sunset Hues Color Scheme", "Soft Blues Color Scheme", "Vibrant Color Scheme", "Grayscale Color Scheme", "Golden Color Scheme", "Black and White Color Scheme", | |
| "Silver and Blue Color Scheme", "Desert Tones Color Scheme", "Forest Greens Color Scheme", "Ocean Blues Color Scheme", "Fire and Ice Color Scheme", "Neutrals Color Scheme", | |
| "Electric Color Scheme", "Pink and Purple Color Scheme", "Bright Rainbow Color Scheme", "Dark and Moody Color Scheme", "Classic Film Color Scheme", "Industrial Color Scheme", | |
| "Ice and Snow Color Scheme", "Underwater Color Scheme", "Natural Greens Color Scheme", "Retro Neon Color Scheme", "Space Black Color Scheme", "Rustic Color Scheme", | |
| "Faded Color Scheme", "Electric Blue Color Scheme", "High Saturation Color Scheme", "Sunlit Color Scheme", "Dark Shadows Color Scheme", "Deep Ocean Color Scheme", | |
| "Warm Sunset Color Scheme", "Metallic Color Scheme", "Night Life Color Scheme", "Soft Pastels Color Scheme", "Vivid Pop Color Scheme", "Mystic Forest Color Scheme", | |
| "Golden Hour Glow Color Scheme" | |
| ] | |
| style_options = [ | |
| "", "Retro Style", "Punk Style", "2D Style", "3D Style", "Pixar Style", "Disney Style", "Anime Style", "Manga Style", "Steampunk Style", "Cyberpunk Style", | |
| "Surrealism Style", "Impressionism Style", "Watercolor Style", "Ink Wash Style", "Abstract Style", "Pop Art Style", "Minimalist Style", "Photorealism Style", | |
| "Comic Book Style", "Art Deco Style", "Baroque Style", "Gothic Style", "Fantasy Style", "Sci-Fi Style", "Vintage Poster Style", "Chalkboard Style", "Graffiti Style", | |
| "Cartoon Style", "Realistic Style", "Noir Style", "Renaissance Style", "Vector Art Style", "Low Poly Style", "High Poly Style", "Pixel Art Style", "Flat Design Style", | |
| "Doodle Art Style", "Neon Style", "Tribal Art Style", "Egyptian Style", "Medieval Style", "Cubism Style", "Expressionism Style", "Digital Painting Style", | |
| "Stencil Art Style", "Concept Art Style", "Ukiyo-e Style", "Pop Surrealism Style", "Constructivism Style" | |
| ] | |
| black_and_white_options = [ | |
| "", "Grey Dots", "Black Dots", "Black Lines", "Grey Lines", "Black and White Cut Design", "Black and White Gradient", "Checkerboard", "Striped", | |
| "Crosshatched", "Polka Dots", "Pinstripes", "Halftone Dots", "Diagonal Stripes", "Grid", "Speckled", "Zebra Stripes", "Pixelated", "Chevron", | |
| "Argyle", "Plaid", "Ink Wash", "Monochrome Gradient", "Abstract Shapes", "Minimalist Shapes", "Brush Strokes", "Charcoal Lines", "Rough Texture", | |
| "Smooth Gradient", "Geometric Patterns", "Mosaic", "Noise Texture", "Soft Gradient", "High Contrast", "Low Contrast", "Monochrome Blobs", | |
| "Splattered Ink", "Outlined Shapes", "Fine Lines", "Thick Lines", "Gradient Lines", "Gradient Dots", "Layered Shapes", "Dot Matrix", "Stencil", | |
| "Crossed Lines", "Hand-Drawn Doodle", "Grayscale Grunge", "Monochrome Silhouettes", "Pop Art Black and White" | |
| ] | |
| lighting_moods = [ | |
| "", "Warm and Inviting", "Mystical", "Dramatic", "Gritty", "Soft and Dreamy", "High Contrast", "Ethereal", "Dark and Moody", "Vibrant", | |
| "Natural", "Subdued", "Harsh", "Backlit", "Side Lit", "Front Lit", "Golden Hour Glow", "Cool Blue Tone", "Sunset Lighting", | |
| "Morning Soft Light", "Afternoon Brightness", "Overcast Mood", "Bright and Cheerful", "Shadowed", "Silhouetted", "Ambient Glow", | |
| "Reflective", "Underlit", "Top Lit", "Foggy Atmosphere", "Glowing", "Spotlight Effect", "Dynamic Shadows", "Neon Glow", "Soft Shadowed", | |
| "Sharp Shadow", "Studio Light", "Stage Spotlight", "Vintage Glow", "High Key", "Low Key", "Candlelight Warmth", "Fiery", | |
| "Haunted Vibe", "Retro Lighting", "Soft Focus", "Crystal Clear", "Bouncing Light", "Mirror Reflection", "Rainy Day Shadows" | |
| ] | |
| emotional_moods = [ | |
| "", "Romantic", "Suspenseful", "Melancholic", "Joyful", "Nostalgic", "Tense", "Eerie", "Intense", "Hopeful", "Whimsical", | |
| "Serene", "Foreboding", "Playful", "Calm", "Enigmatic", "Triumphant", "Anxious", "Lonely", "Peaceful", "Angry", "Excited", | |
| "Passionate", "Reflective", "Sad", "Uplifting", "Grateful", "Determined", "Rebellious", "Mysterious" | |
| ] | |
| 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", "Polarizer Filter", | |
| "UV Filter", "ND Filter", "Gradient Filter", "Warm Filter", "Cool Filter", "Star Filter", "Sepia Filter", | |
| "Soft Focus Filter" | |
| ] | |
| 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", "Background Blur", | |
| "Dynamic Blur", "Smooth Blur", "Soft Focus Blur", "Intense Blur", "Subtle Blur", "Artistic Blur" | |
| ] | |
| focus_options = [ | |
| "", "Deep Focus", "Shallow Focus", "Soft Focus", "Split Focus", "Rack Focus", "Selective Focus", "Macro Focus", | |
| "Infinity Focus", "Zone Focus", "Follow Focus", "Sharp Focus", "Blurred Background", "Foreground Focus", | |
| "Extreme Close-Up Focus", "Full Frame Focus", "Manual Focus", "Center Focus", "Dynamic Focus", "Shifted Focus" | |
| ] | |
| 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", "Split Light", "Rembrandt Light", "Loop Light", | |
| "Butterfly Light", "Cross Light", "Soft Key Light", "Hard Key Light", "Ambient Light", "Natural Light" | |
| ] | |
| film_grain_options = [ | |
| "", "Fine Grain", "Medium Grain", "Coarse Grain", "Color Grain", "Monochrome Grain", "Soft Grain", | |
| "Sharp Grain", "Natural Grain", "Dense Grain", "Minimal Grain", "Vintage Grain", "Heavy Grain", | |
| "Textured Grain", "Smooth Grain", "Digital Grain", "High ISO Grain", "Classic Film Grain", | |
| "Subtle Grain", "Intense Grain" | |
| ] | |
| 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", "f/0.95", | |
| "f/1.8", "f/3.5", "f/6.3", "f/7.1", "f/9", "f/10", "f/13", "f/18" | |
| ] | |
| iso_settings = [ | |
| "", "ISO 100", "ISO 200", "ISO 400", "ISO 800", "ISO 1600", "ISO 3200", "ISO 6400", "ISO 12800", | |
| "ISO 25600", "ISO 51200", "ISO 50", "ISO 640", "ISO 125", "ISO 160", "ISO 320", "ISO 250", | |
| "ISO 1250", "ISO 20000", "ISO 102400" | |
| ] | |
| shutter_speeds = [ | |
| "", "1/1000", "1/500", "1/250", "1/125", "1/60", "1/30", "1/15", "1/8", "1/4", "1/2", | |
| "1", "2", "4", "8", "15", "30", "1/4000", "1/8000", "Bulb" | |
| ] | |
| 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", "Anamorphic Lens", "Ultra Prime Lens", "Vista Vision Lens", "Zeiss Supreme Prime", "Atlas Orion Anamorphic", "RED Monstro", | |
| "Panasonic Varicam Lens", "ARRI Ultra Wide", "Fujinon Cine Zoom", "Sigma Cine Prime", "Canon CN-E Prime", "Tokina Cinema Vista", "Leica M 0.8", "Xeen CF Lens" | |
| ] | |
| daytime_options = ["", "Early Morning", "Morning", "Late Morning", "Noon", "Early Afternoon", "Afternoon", "Late Afternoon", "Golden Hour", "Pre-Sunset", "Sunset", "After Sunset", "Twilight"] | |
| nighttime_options = ["", "Dusk", "Early Evening", "Evening", "Late Evening", "Night", "Late Night", "Blue Hour", "Midnight", "Pre-Dawn", "Predawn Twilight", "First Light", "Dawn"] | |
| # Define function to generate cinematic prompts for each model | |
| def generate_prompts( | |
| quality, daytime, nighttime, indoor_location, outdoor_location, sky_option, sun_position, camera_position, lighting_preset, color_scheme, style, black_and_white, lighting_mood, | |
| emotional_mood, camera_lens, camera_filter, cinematic_blur, focus_option, | |
| key_light_position, film_grain, aperture, iso, shutter_speed, user_text | |
| ): | |
| core_prompt = ", ".join([component for component in [quality, daytime, nighttime, indoor_location, outdoor_location, sky_option, sun_position, camera_position, lighting_preset, color_scheme, style, black_and_white, lighting_mood, emotional_mood, camera_lens, camera_filter, cinematic_blur, focus_option, key_light_position, film_grain, aperture, iso, shutter_speed, user_text] if component]) | |
| midjourney_note = f"Visualize an elaborate canvas where colors are vibrant, shapes are exaggerated, and textures pop from the surface. In '{core_prompt}', light interacts with every element, casting dramatic shadows and bringing surreal clarity." | |
| luma_note = f"Imagine a scene unfolding in motion, each frame rich with kinetic energy. In '{core_prompt}', the landscape moves, characters interact, and light dances, as if the scene breathes on its own." | |
| runway_note = f"Picture a meticulously constructed scene, layered with intricate details that evoke a cinematic composition. With '{core_prompt}', balance light and shadow to build depth and add layers to every frame." | |
| klingai_note = f"See the scene as though through a high-definition lens, capturing every subtle movement and nuance. In '{core_prompt}', the realism should be striking, with lifelike characters, smooth motion, and atmospheric depth." | |
| return core_prompt, midjourney_note, luma_note, runway_note, klingai_note | |
| # Set up Gradio Interface with explanations | |
| gr.Interface( | |
| fn=generate_prompts, | |
| inputs=[ | |
| gr.Dropdown(quality_options, label="Quality"), | |
| gr.Dropdown(daytime_options, label="Daytime"), | |
| gr.Dropdown(nighttime_options, label="Nighttime"), | |
| gr.Dropdown(["", "Conference Hall", "Bedroom", "Lounge", "Kitchen", "Living Room", "Bathroom", "Office"], label="Indoor Location"), | |
| gr.Dropdown(["", "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"], label="Outdoor Location"), | |
| gr.Dropdown(["", "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"], label="Sky Condition"), | |
| gr.Dropdown(["", "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"], label="Sun Position"), | |
| gr.Dropdown(["", "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"], label="Camera Position", info="Choose the camera perspective to convey different moods and scales."), | |
| gr.Dropdown(lighting_moods, label="Lighting Mood", info="Select lighting to enhance the emotional tone and atmosphere."), | |
| gr.Dropdown(color_schemes, label="Color Scheme", info="Choose a color scheme to define the visual palette and mood."), | |
| gr.Dropdown(style_options, label="Style", info="Select a style to influence the overall aesthetic or era."), | |
| gr.Dropdown(black_and_white_options, label="Black and White", info="Pick a pattern or effect to convey texture in black and white."), | |
| gr.Dropdown(emotional_moods, label="Emotional Mood", info="Select the intended emotional undertone of the scene."), | |
| gr.Dropdown(camera_lenses, label="Camera Lens", info="Choose a lens type to control perspective, depth, and focus."), | |
| gr.Dropdown(camera_filters, label="Camera Filter", info="Apply a filter for color correction or atmospheric effects."), | |
| gr.Dropdown(cinematic_blurs, label="Cinematic Blur", info="Select a blur type to emphasize focal points or create motion."), | |
| gr.Dropdown(focus_options, label="Focus Option", info="Choose a focus setting to direct viewer attention."), | |
| gr.Dropdown(key_light_positions, label="Key Light Position", info="Select key lighting to shape contrast and visibility."), | |
| gr.Dropdown(film_grain_options, label="Film Grain", info="Add grain for texture, age, or retro effects."), | |
| gr.Dropdown(aperture_settings, label="Aperture", info="Control depth of field with aperture settings."), | |
| gr.Dropdown(iso_settings, label="ISO", info="Adjust ISO for sensitivity and grain effects."), | |
| gr.Dropdown(shutter_speeds, label="Shutter Speed", info="Control motion blur and exposure with shutter speed."), | |
| gr.Textbox(label="User Custom Prompt") | |
| ], | |
| outputs=[ | |
| gr.Textbox(label="Core Prompt"), | |
| gr.Textbox(label="Midjourney Scene Description"), | |
| gr.Textbox(label="Luma Scene Description"), | |
| gr.Textbox(label="Runway Scene Description"), | |
| gr.Textbox(label="KlingAI Scene Description") | |
| ], | |
| title="Cinematic Prompt Generator", | |
| description="Generate prompts and scene descriptions for Midjourney, Luma, Runway, and Kling AI based on cinematic attributes." | |
| ).launch() | |