Equityone commited on
Commit
a51d71a
·
verified ·
1 Parent(s): a9896c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +58 -58
app.py CHANGED
@@ -67,9 +67,9 @@ COMPOSITION_PARAMS = {
67
  "Asymétrique": "dynamic asymmetrical composition",
68
  "Grille": "grid-based layout, structured composition",
69
  "Diagonal": "diagonal dynamic composition",
70
- "Minimaliste": "minimal composition with lots of whitespace",
71
  # Nouvelles options ajoutées
72
- "Radial": "'radial' composition with circular arrangement",
73
  'En Z': "'Z-shaped' composition guiding the viewer's eye",
74
  'Règle des tiers': "'rule of thirds' composition for balance",
75
  'Symétrie': "'symmetrical' composition for mirror-like balance",
@@ -214,70 +214,70 @@ def create_interface():
214
  </div>
215
  """)
216
 
217
- with gr.Column(elem_classes="container"):
218
- with gr.Group(elem_classes="controls-group"):
219
- gr.Markdown("### 📐 Format et Orientation")
220
- with gr.Row():
221
- format_size = gr.Dropdown( choices=["A4",
222
- A3",
223
- A2",
224
- A1",
225
- A0"],
226
- value="A4", label="Format")
227
- orientation = gr.Radio( choices=["Portrait",
228
- Paysage"],
229
- value="Portrait", label="Orientation")
230
 
231
- with gr.Group(elem_classes="controls-group"):
232
- gr.Markdown("### 🎨 Style et Composition")
233
- with gr.Row():
234
- style = gr.Dropdown( choices=list(ART_STYLES.keys()), value="Neo Vintage", label="Style artistique")
235
- layout = gr.Dropdown( choices=list(COMPOSITION_PARAMS["Layouts"].keys()), value="Centré", label="Composition")
236
- with gr.Row():
237
- ambiance = gr.Dropdown( choices=list(COMPOSITION_PARAMS["Ambiances"].keys()), value="Dramatique", label="Ambiance")
238
- palette = gr.Dropdown( choices=list(COMPOSITION_PARAMS["Palette"].keys()), value="Contrasté", label="Palette")
239
 
240
- with gr.Group(elem_classes="controls-group"):
241
- gr.Markdown("### 📝 Contenu")
242
- subject = gr.Textbox( label="Description", placeholder="Décrivez votre vision..." )
243
- title = gr.Textbox( label="Titre", placeholder="Titre de l'affiche..." )
244
 
245
- with gr.Group(elem_classes="advanced-controls"):
246
- gr.Markdown("### 🎯 Ajustements Fins")
247
- with gr.Row():
248
- detail_level = gr.Slider(minimum=1,
249
- maximum=10,
250
- value=7,
251
- step=1,
252
- label="Niveau de Détail")
253
- contrast = gr.Slider(minimum=1,
254
  maximum=10,
255
- value=5,
256
  step=1,
257
- label="Contraste")
258
- saturation = gr.Slider(minimum=1,
259
- maximum=10,
260
- value=5,
261
- step=1,
262
- label="Saturation")
263
-
264
- with gr.Group(elem_classes="controls-group"):
265
- with gr.Row():
266
- quality = gr.Slider(minimum=30,
267
- maximum=50,
268
- value=35,
269
- label="Qualité")
270
- creativity = gr.Slider(minimum=5,
271
- maximum=15,
272
- value=7.5,
273
- label="Créativité")
274
 
 
275
  with gr.Row():
276
- generate_btn = gr.Button("✨ Générer", variant="primary")
277
- clear_btn = gr.Button("🗑️ Effacer", variant="secondary")
 
 
 
 
 
 
 
 
 
 
278
 
279
- image_output = gr.Image(label="Aperçu")
280
- status = gr.Textbox(label="Statut", interactive=False)
281
 
282
  def generate(*args):
283
  logger.info("Démarrage d'une nouvelle génération")
 
67
  "Asymétrique": "dynamic asymmetrical composition",
68
  "Grille": "grid-based layout, structured composition",
69
  "Diagonal": "diagonal dynamic composition",
70
+ "Minimaliste": "'minimal composition with lots of whitespace'",
71
  # Nouvelles options ajoutées
72
+ 'Radial': "'radial' composition with circular arrangement",
73
  'En Z': "'Z-shaped' composition guiding the viewer's eye",
74
  'Règle des tiers': "'rule of thirds' composition for balance",
75
  'Symétrie': "'symmetrical' composition for mirror-like balance",
 
214
  </div>
215
  """)
216
 
217
+ with gr.Column(elem_classes="container"):
218
+ with gr.Group(elem_classes="controls-group"):
219
+ gr.Markdown("### 📐 Format et Orientation")
220
+ with gr.Row():
221
+ format_size = gr.Dropdown(choices=["A4",
222
+ A3",
223
+ A2",
224
+ A1",
225
+ A0"],
226
+ value="A4", label="Format")
227
+ orientation = gr.Radio(choices=["Portrait",
228
+ Paysage"],
229
+ value="Portrait", label="Orientation")
230
 
231
+ with gr.Group(elem_classes="controls-group"):
232
+ gr.Markdown("### 🎨 Style et Composition")
233
+ with gr.Row():
234
+ style = gr.Dropdown(choices=list(ART_STYLES.keys()), value="Neo Vintage", label="Style artistique")
235
+ layout = gr.Dropdown(choices=list(COMPOSITION_PARAMS["Layouts"].keys()), value="Centré", label="Composition")
236
+ with gr.Row():
237
+ ambiance = gr.Dropdown(choices=list(COMPOSITION_PARAMS["Ambiances"].keys()), value="Dramatique", label="Ambiance")
238
+ palette = gr.Dropdown(choices=list(COMPOSITION_PARAMS["Palette"].keys()), value="Contrasté", label="Palette")
239
 
240
+ with gr.Group(elem_classes="controls-group"):
241
+ gr.Markdown("### 📝 Contenu")
242
+ subject = gr.Textbox(label="Description", placeholder="Décrivez votre vision...")
243
+ title = gr.Textbox(label="Titre", placeholder="Titre de l'affiche...")
244
 
245
+ with gr.Group(elem_classes="advanced-controls"):
246
+ gr.Markdown("### 🎯 Ajustements Fins")
247
+ with gr.Row():
248
+ detail_level = gr.Slider(minimum=1,
 
 
 
 
 
249
  maximum=10,
250
+ value=7,
251
  step=1,
252
+ label="Niveau de Détail")
253
+ contrast = gr.Slider(minimum=1,
254
+ maximum=10,
255
+ value=5,
256
+ step=1,
257
+ label="Contraste")
258
+ saturation = gr.Slider(minimum=1,
259
+ maximum=10,
260
+ value=5,
261
+ step=1,
262
+ label="Saturation")
 
 
 
 
 
 
263
 
264
+ with gr.Group(elem_classes="controls-group"):
265
  with gr.Row():
266
+ quality = gr.Slider(minimum=30,
267
+ maximum=50,
268
+ value=35,
269
+ label="Qualité")
270
+ creativity = gr.Slider(minimum=5,
271
+ maximum=15,
272
+ value=7.5,
273
+ label="Créativité")
274
+
275
+ with gr.Row():
276
+ generate_btn = gr.Button("✨ Générer", variant="primary")
277
+ clear_btn = gr.Button("🗑️ Effacer", variant="secondary")
278
 
279
+ image_output = gr.Image(label="Aperçu")
280
+ status = gr.Textbox(label="Statut", interactive=False)
281
 
282
  def generate(*args):
283
  logger.info("Démarrage d'une nouvelle génération")