BATUTO-ART commited on
Commit
bc2c815
·
verified ·
1 Parent(s): 5837a54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -29
app.py CHANGED
@@ -46,12 +46,13 @@ class FashionPromptGenerator:
46
  hair_texture = random.choice(self.photo_real.HAIR)
47
  full_hair_desc = f"{hair_style}, featuring {hair_texture}"
48
  expression = random.choice(fashion_elements["expressions"])
49
- sensual_pose = random.choice(self.photo_real.SENSUAL_POSES)
50
  discovery_moment = random.choice(fashion_elements["discovery_moments"])
51
  reveal_action = random.choice(fashion_elements["lingerie_reveal_actions"])
52
  background = random.choice(fashion_elements["backgrounds"])
53
- lighting = random.choice(fashion_elements["lighting"])
54
- angle = random.choice(fashion_elements["voyeuristic_angles"])
 
 
55
 
56
  if random.random() > 0.3:
57
  lingerie_desc = random.choice(fashion_elements["lingerie_sets"])
@@ -63,27 +64,28 @@ class FashionPromptGenerator:
63
 
64
  stockings = random.choice(fashion_elements["stockings"])
65
 
 
66
  prompt = (
67
- f"Photorealistic portrait of {subject_name} as a {role['role']}, captured from {angle}. "
68
- f"The composition focuses on a moment of discovery: {discovery_moment}. "
69
- f"She is {reveal_action}.\n\n"
70
  f"**Body & Appearance:**\n"
71
  f"- Physique: {body} with {skin}\n"
72
  f"- Hair: {full_hair_desc}\n"
73
  f"- Expression: {expression}\n"
74
- f"- Outfit: She wears a {role['outfit']}. underneath, accidentally revealed, is a exquisite {lingerie_desc}. "
75
  f"Legs adorned with {stockings} and {self.photo_real.HEELS}.\n\n"
76
- f"**Scene:**\n"
77
  f"- Setting: {background}\n"
78
- f"- Lighting: {lighting}\n"
79
- f"- Pose: {sensual_pose['pose']} ({sensual_pose['view']} view)\n\n"
80
- f"**Tech:**\n"
81
- f"- Camera: {self.photo_real.CAMERA}\n"
82
- f"- Quality: 8K, ultra-sharp, cinematic, hyper-detailed textures.\n\n"
83
- f"--ar 9:16 --v 6 --q 2 --style raw --stylize 150"
84
  )
85
  return prompt.strip()
86
- except Exception:
87
  return f"Photorealistic portrait of {subject_name}. --ar 9:16 --v 6"
88
 
89
  def clear_history(self):
@@ -93,14 +95,13 @@ class FashionPromptGenerator:
93
  def create_gradio_interface():
94
  generator = FashionPromptGenerator()
95
 
96
- # ⭐ CORRECCIÓN: Quitamos 'theme=gr.themes.Soft()' para evitar el error en versiones viejas
97
  with gr.Blocks() as demo:
98
- gr.Markdown("# 🎭 Advanced Fashion Prompt Generator")
99
 
100
  # Toast notification script
101
  gr.HTML("""
102
- <div id="custom-toast" style="position: fixed; bottom: 20px; right: 20px; background: #333; color: white; padding: 12px 24px; border-radius: 8px; font-family: sans-serif; opacity: 0; transition: opacity 0.5s; pointer-events: none; z-index: 9999;">
103
- ¡Prompt copiado! 👍
104
  </div>
105
  <script>
106
  window.showMyToast = function() {
@@ -112,22 +113,20 @@ def create_gradio_interface():
112
  """)
113
 
114
  with gr.Row():
115
- celebrity_input = gr.Textbox(label="Celebrity Name", placeholder="Optional (e.g., Ana de Armas)")
116
- num_prompts_slider = gr.Slider(1, 10, 5, step=1, label="Number of Prompts")
117
 
118
  with gr.Row():
119
- generate_btn = gr.Button("✨ Generate", variant="primary")
120
- clear_btn = gr.Button("🗑️ Clear", variant="secondary")
121
 
122
- gr.Markdown("### Negative Prompt")
123
- negative_prompt_output = gr.Textbox(value=negative_prompt_fusion, lines=4, interactive=False)
124
 
125
- gr.Markdown("## Generated Prompts")
126
 
127
  output_columns = []
128
  output_prompts = []
129
 
130
- # JavaScript para copiar el texto que le pasemos
131
  js_copy_logic = """(x) => {
132
  navigator.clipboard.writeText(x).then(() => {
133
  if(window.showMyToast) window.showMyToast();
@@ -136,13 +135,12 @@ def create_gradio_interface():
136
  }"""
137
 
138
  for i in range(10):
139
- with gr.Column(visible=(i < 10)) as col:
140
  gr.Markdown(f"### 🎯 Prompt {i+1}")
141
 
142
  prompt_box = gr.Textbox(label="", lines=14, interactive=False)
143
  copy_btn = gr.Button("📋 Copiar Prompt")
144
 
145
- # Conexión directa: Input -> JS -> Copiar
146
  copy_btn.click(
147
  fn=None,
148
  inputs=[prompt_box],
 
46
  hair_texture = random.choice(self.photo_real.HAIR)
47
  full_hair_desc = f"{hair_style}, featuring {hair_texture}"
48
  expression = random.choice(fashion_elements["expressions"])
 
49
  discovery_moment = random.choice(fashion_elements["discovery_moments"])
50
  reveal_action = random.choice(fashion_elements["lingerie_reveal_actions"])
51
  background = random.choice(fashion_elements["backgrounds"])
52
+
53
+ # Forzamos o sesgamos hacia la pose y ángulo solicitado
54
+ angle_desc = "extreme low-angle ground-level perspective, tilted upward to encompass the complete silhouette"
55
+ pose_desc = "sitting or standing with legs spread open, looking directly at the spectator with a seductive gaze, touching herself sensually and confidently"
56
 
57
  if random.random() > 0.3:
58
  lingerie_desc = random.choice(fashion_elements["lingerie_sets"])
 
64
 
65
  stockings = random.choice(fashion_elements["stockings"])
66
 
67
+ # Prompt con la configuración técnica de 16K y Canon EOS R5 e integración de firma BATUTO-ART
68
  prompt = (
69
+ f"Photorealistic full-length portrait of {subject_name} as a {role['role']}, occupying the entire frame. "
70
+ f"Captured from a {angle_desc}. The composition focuses on a natural movement: {discovery_moment}. "
71
+ f"She is {reveal_action} while {pose_desc}.\n\n"
72
  f"**Body & Appearance:**\n"
73
  f"- Physique: {body} with {skin}\n"
74
  f"- Hair: {full_hair_desc}\n"
75
  f"- Expression: {expression}\n"
76
+ f"- Outfit: She wears a {role['outfit']}. Underneath, exquisitely revealed, is a {lingerie_desc}. "
77
  f"Legs adorned with {stockings} and {self.photo_real.HEELS}.\n\n"
78
+ f"**Scene & Studio:**\n"
79
  f"- Setting: {background}\n"
80
+ f"- Lighting: Professional illumination using ARRI SkyPanel S360-C, providing shadowless light and highlighting skin textures.\n"
81
+ f"- Signature: Small, elongated graffiti tag-style signature 'BATUTO-ART' in the top left corner, liquid gold marker style, discreet (5% width).\n\n"
82
+ f"**Technical Specs:**\n"
83
+ f"- Camera: Canon EOS R5 Cine RAW, Canon RF 85mm f/1.2L USM lens.\n"
84
+ f"- Format: UHD 16K resolution (15360 × 8640), 9:16 aspect ratio, hyper-detailed textures, balanced exposure.\n\n"
85
+ f"--ar 9:16 --v 6 --q 2 --style raw --stylize 250"
86
  )
87
  return prompt.strip()
88
+ except Exception as e:
89
  return f"Photorealistic portrait of {subject_name}. --ar 9:16 --v 6"
90
 
91
  def clear_history(self):
 
95
  def create_gradio_interface():
96
  generator = FashionPromptGenerator()
97
 
 
98
  with gr.Blocks() as demo:
99
+ gr.Markdown("# 🎭 BATUTO-ART | Advanced Fashion Generator")
100
 
101
  # Toast notification script
102
  gr.HTML("""
103
+ <div id="custom-toast" style="position: fixed; bottom: 20px; right: 20px; background: #FFD700; color: black; padding: 12px 24px; border-radius: 8px; font-family: sans-serif; opacity: 0; transition: opacity 0.5s; pointer-events: none; z-index: 9999; font-weight: bold;">
104
+ ¡Prompt copiado al portapapeles! 🚀
105
  </div>
106
  <script>
107
  window.showMyToast = function() {
 
113
  """)
114
 
115
  with gr.Row():
116
+ celebrity_input = gr.Textbox(label="Nombre de la Celebridad", placeholder="Ej. Ana de Armas")
117
+ num_prompts_slider = gr.Slider(1, 10, 5, step=1, label="Número de Prompts")
118
 
119
  with gr.Row():
120
+ generate_btn = gr.Button("✨ Generar Arte", variant="primary")
121
+ clear_btn = gr.Button("🗑️ Limpiar Historial", variant="secondary")
122
 
123
+ # SE ELIMINÓ EL CUADRO DEL NEGATIVE PROMPT AQUÍ ⭐
 
124
 
125
+ gr.Markdown("## Prompts Generados")
126
 
127
  output_columns = []
128
  output_prompts = []
129
 
 
130
  js_copy_logic = """(x) => {
131
  navigator.clipboard.writeText(x).then(() => {
132
  if(window.showMyToast) window.showMyToast();
 
135
  }"""
136
 
137
  for i in range(10):
138
+ with gr.Column(visible=(i < 5)) as col:
139
  gr.Markdown(f"### 🎯 Prompt {i+1}")
140
 
141
  prompt_box = gr.Textbox(label="", lines=14, interactive=False)
142
  copy_btn = gr.Button("📋 Copiar Prompt")
143
 
 
144
  copy_btn.click(
145
  fn=None,
146
  inputs=[prompt_box],