benibraz commited on
Commit
623c312
1 Parent(s): a73f2f6

Refactor advanced options sliders and enhance UI with instructional tips for video generation

Browse files
Files changed (1) hide show
  1. app.py +39 -10
app.py CHANGED
@@ -309,15 +309,12 @@ def create_advanced_options():
309
  inference_steps = gr.Slider(
310
  label="4.2 Inference Steps", minimum=1, maximum=100, step=1, value=40
311
  )
312
- images_per_prompt = gr.Slider(
313
- label="4.3 Images per Prompt", minimum=1, maximum=10, step=1, value=1
314
- )
315
  guidance_scale = gr.Slider(
316
- label="4.4 Guidance Scale", minimum=1.0, maximum=20.0, step=0.1, value=3.0
317
  )
318
 
319
  height_slider = gr.Slider(
320
- label="4.5 Height",
321
  minimum=256,
322
  maximum=1024,
323
  step=64,
@@ -325,7 +322,7 @@ def create_advanced_options():
325
  visible=False,
326
  )
327
  width_slider = gr.Slider(
328
- label="4.6 Width",
329
  minimum=256,
330
  maximum=1024,
331
  step=64,
@@ -333,7 +330,7 @@ def create_advanced_options():
333
  visible=False,
334
  )
335
  num_frames_slider = gr.Slider(
336
- label="4.7 Number of Frames",
337
  minimum=1,
338
  maximum=200,
339
  step=1,
@@ -341,7 +338,7 @@ def create_advanced_options():
341
  visible=False,
342
  )
343
  frame_rate = gr.Slider(
344
- label="4.8 Frame Rate",
345
  minimum=1,
346
  maximum=60,
347
  step=1,
@@ -352,7 +349,6 @@ def create_advanced_options():
352
  return [
353
  seed,
354
  inference_steps,
355
- images_per_prompt,
356
  guidance_scale,
357
  height_slider,
358
  width_slider,
@@ -363,7 +359,40 @@ def create_advanced_options():
363
 
364
  # Define the Gradio interface with tabs
365
  with gr.Blocks(theme=gr.themes.Soft()) as iface:
366
- gr.Markdown("# Video Generation with LTX Video")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367
 
368
  with gr.Tabs():
369
  # Text to Video Tab
 
309
  inference_steps = gr.Slider(
310
  label="4.2 Inference Steps", minimum=1, maximum=100, step=1, value=40
311
  )
 
 
 
312
  guidance_scale = gr.Slider(
313
+ label="4.3 Guidance Scale", minimum=1.0, maximum=20.0, step=0.1, value=3.0
314
  )
315
 
316
  height_slider = gr.Slider(
317
+ label="4.4 Height",
318
  minimum=256,
319
  maximum=1024,
320
  step=64,
 
322
  visible=False,
323
  )
324
  width_slider = gr.Slider(
325
+ label="4.5 Width",
326
  minimum=256,
327
  maximum=1024,
328
  step=64,
 
330
  visible=False,
331
  )
332
  num_frames_slider = gr.Slider(
333
+ label="4.5 Number of Frames",
334
  minimum=1,
335
  maximum=200,
336
  step=1,
 
338
  visible=False,
339
  )
340
  frame_rate = gr.Slider(
341
+ label="4.7 Frame Rate",
342
  minimum=1,
343
  maximum=60,
344
  step=1,
 
349
  return [
350
  seed,
351
  inference_steps,
 
352
  guidance_scale,
353
  height_slider,
354
  width_slider,
 
359
 
360
  # Define the Gradio interface with tabs
361
  with gr.Blocks(theme=gr.themes.Soft()) as iface:
362
+ with gr.Row(elem_id="title-row"):
363
+ gr.Markdown(
364
+ """
365
+ <div style="text-align: center; margin-bottom: 1em">
366
+ <h1 style="font-size: 2.5em; font-weight: 600; margin: 0.5em 0;">Video Generation with LTX Video</h1>
367
+ </div>
368
+ """
369
+ )
370
+ with gr.Accordion(
371
+ " 📖 Tips for Best Results", open=False, elem_id="instructions-accordion"
372
+ ):
373
+ gr.Markdown(
374
+ """
375
+ 📝 Prompt Engineering
376
+
377
+ When writing prompts, focus on detailed, chronological descriptions of actions and scenes. Include specific movements, appearances, camera angles, and environmental details - all in a single flowing paragraph. Start directly with the action, and keep descriptions literal and precise. Think like a cinematographer describing a shot list. Keep within 200 words.
378
+ For best results, build your prompts using this structure:
379
+
380
+ - Start with main action in a single sentence
381
+ - Add specific details about movements and gestures
382
+ - Describe character/object appearances precisely
383
+ - Include background and environment details
384
+ - Specify camera angles and movements
385
+ - Describe lighting and colors
386
+ - Note any changes or sudden events
387
+
388
+ 🎮 Parameter Guide
389
+
390
+ - Resolution Preset: Higher resolutions for detailed scenes, lower for faster generation and simpler scenes
391
+ - Seed: Save seed values to recreate specific styles or compositions you like
392
+ - Guidance Scale: Higher values (5-7) for accurate prompt following, lower values (3-5) for more creative freedom
393
+ - Inference Steps: More steps (40+) for quality, fewer steps (20-30) for speed
394
+ """
395
+ )
396
 
397
  with gr.Tabs():
398
  # Text to Video Tab