ivanoctaviogaitansantos's picture
Update app.py
83376cc verified
raw
history blame
3.61 kB
import gradio as gr
import random
# Define the function to generate multiple prompts
def generate_all_prompts(name):
# List of clothing combinations with colors and types of miniskirts
outfits = [
"a form-fitting elastic cotton miniskirt and a tight short dress in red",
"a tight short dress and a form-fitting elastic cotton miniskirt in black",
"a leather miniskirt and a crop top in blue",
"a denim miniskirt and a tank top in white",
"a pleated miniskirt and a blouse in green",
"a bodycon miniskirt and a bandeau top in pink",
"a metallic miniskirt and a camisole in silver",
"a lace miniskirt and a bustier in gold",
"a PVC miniskirt and a mesh top in purple"
]
# List of camera angles
angles = [
"low angle shot looking up",
"worm's eye view",
"dynamic low angle"
]
# List of leg positions
leg_positions = [
"legs crossed",
"one leg bent",
"standing with legs slightly apart",
"sitting with legs to the side",
"kneeling"
]
prompts = []
for _ in range(3): # Generate 3 distinct prompts
# Randomly select one outfit, angle, and leg position
selected_outfit = random.choice(outfits)
selected_angle = random.choice(angles)
selected_leg_position = random.choice(leg_positions)
# Create the single prompt with the randomly selected outfit, angle, leg position and added details
prompt = f"/imagine a photorealistic full body portrait of {name}, occupying the entire frame, extreme close-up full body shot, posing sensually and confidently, wearing {selected_outfit} with a subtly more transparent texture, high heels, elegant hairstyle with long hair, captured with a high-end DSLR camera, bright midday sun, full frame, no annoying shadows or borders, perfect lighting, park setting, high-resolution, 8k, cinematic photography, sharp focus, vibrant colors, {selected_angle}, {selected_leg_position}."
prompts.append(prompt)
# Return the list of prompts
return prompts
# Define the CSS theme
css_theme = """
.gradio-container {
background-color: #1a1a1a;
color: #ffffff;
}
.dark .gradio-container,
:root .dark .gradio-container {
background-color: #1a1a1a;
color: #ffffff;
}
.gradio-button {
background-color: #dc2626;
color: #ffffff;
border-radius: 8px;
border: none;
font-weight: bold;
}
.gradio-button:hover {
background-color: #ef4444;
}
.gradio-textbox textarea, .gradio-textbox input {
background-color: #262626;
color: #ffffff;
border: 1px solid #4a4a4a;
}
.gradio-label {
font-weight: bold;
color: #ffffff;
}
h1 {
color: #ef4444 !important;
text-align: center;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
text-shadow: 2px 2px 4px #000000;
}
"""
# Gradio UI setup
with gr.Blocks(
title="🐾BATUTO_-1",
css=css_theme
) as demo:
gr.Markdown(
"""
# 🐾BATUTO_-1 🤖✨
"""
)
with gr.Row():
name_input = gr.Textbox(label="Enter the celebrity's name", scale=3)
generate_btn = gr.Button("Generate Prompt", scale=1)
# The UI now has only one output box
with gr.Column():
prompt_output = gr.Textbox(label="Generated Prompt:", lines=5, interactive=False, show_copy_button=True)
# Link the button to the function
generate_btn.click(
fn=generate_all_prompts,
inputs=name_input,
outputs=prompt_output
)
if __name__ == "__main__":
demo.launch()