Fabrice-TIERCELIN commited on
Commit
d7a1a43
·
verified ·
1 Parent(s): 0bd0d30

height_input, width_input

Browse files
Files changed (1) hide show
  1. app.py +30 -2
app.py CHANGED
@@ -26,6 +26,8 @@ from ltx_video.utils.skip_layer_strategy import SkipLayerStrategy
26
 
27
  image_i2v_debug_value = None
28
  i2v_prompt_debug_value = None
 
 
29
  config_file_path = "configs/ltxv-13b-0.9.7-distilled.yaml"
30
  with open(config_file_path, "r") as file:
31
  PIPELINE_CONFIG_YAML = yaml.safe_load(file)
@@ -151,13 +153,17 @@ def generate(prompt, negative_prompt, input_image_filepath, input_video_filepath
151
  progress=gr.Progress(track_tqdm=True)):
152
 
153
  if i2v_prompt_debug_value is not None:
154
- print("if i2v_prompt_debug_value is not None:")
155
  prompt = i2v_prompt_debug_value
156
 
157
  if image_i2v_debug_value is not None:
158
- print("if image_i2v_debug_value is not None:")
159
  input_image_filepath = image_i2v_debug_value
160
 
 
 
 
 
 
 
161
  if randomize_seed:
162
  seed_ui = random.randint(0, 2**32 - 1)
163
  seed_everething(int(seed_ui))
@@ -388,6 +394,8 @@ with gr.Blocks(css=css) as demo:
388
  with gr.Accordion("Advanced settings", open=False):
389
  image_i2v_debug = gr.Image(label="Input Image Debug", type="filepath", sources=["upload", "webcam", "clipboard"])
390
  i2v_prompt_debug = gr.Textbox(label="Prompt Debug", value="", lines=3)
 
 
391
  mode = gr.Dropdown(["text-to-video", "image-to-video", "video-to-video"], label="task", value="image-to-video", visible=False)
392
  negative_prompt_input = gr.Textbox(label="Negative Prompt", value="worst quality, inconsistent motion, blurry, jittery, distorted", lines=2)
393
  with gr.Row():
@@ -428,6 +436,16 @@ with gr.Blocks(css=css) as demo:
428
  cache_examples = True,
429
  )
430
 
 
 
 
 
 
 
 
 
 
 
431
  def image_i2v_debug_upload(image_filepath):
432
  global image_i2v_debug_value
433
  image_i2v_debug_value = image_filepath
@@ -510,6 +528,16 @@ with gr.Blocks(css=css) as demo:
510
  inputs=[image_i2v_debug],
511
  outputs=[]
512
  )
 
 
 
 
 
 
 
 
 
 
513
 
514
  image_tab.select(
515
  fn=update_task_image,
 
26
 
27
  image_i2v_debug_value = None
28
  i2v_prompt_debug_value = None
29
+ height_input_debug_value = None
30
+ width_input_debug_value = None
31
  config_file_path = "configs/ltxv-13b-0.9.7-distilled.yaml"
32
  with open(config_file_path, "r") as file:
33
  PIPELINE_CONFIG_YAML = yaml.safe_load(file)
 
153
  progress=gr.Progress(track_tqdm=True)):
154
 
155
  if i2v_prompt_debug_value is not None:
 
156
  prompt = i2v_prompt_debug_value
157
 
158
  if image_i2v_debug_value is not None:
 
159
  input_image_filepath = image_i2v_debug_value
160
 
161
+ if height_input_debug_value is not None:
162
+ height_ui = height_input_debug_value
163
+
164
+ if width_input_debug_value is not None:
165
+ width_ui = width_input_debug_value
166
+
167
  if randomize_seed:
168
  seed_ui = random.randint(0, 2**32 - 1)
169
  seed_everething(int(seed_ui))
 
394
  with gr.Accordion("Advanced settings", open=False):
395
  image_i2v_debug = gr.Image(label="Input Image Debug", type="filepath", sources=["upload", "webcam", "clipboard"])
396
  i2v_prompt_debug = gr.Textbox(label="Prompt Debug", value="", lines=3)
397
+ height_input_debug = gr.Slider(label="Height Debug", value=512, step=32, minimum=MIN_DIM_SLIDER, maximum=MAX_IMAGE_SIZE, info="Must be divisible by 32.")
398
+ width_input_debug = gr.Slider(label="Width Debug", value=704, step=32, minimum=MIN_DIM_SLIDER, maximum=MAX_IMAGE_SIZE, info="Must be divisible by 32.")
399
  mode = gr.Dropdown(["text-to-video", "image-to-video", "video-to-video"], label="task", value="image-to-video", visible=False)
400
  negative_prompt_input = gr.Textbox(label="Negative Prompt", value="worst quality, inconsistent motion, blurry, jittery, distorted", lines=2)
401
  with gr.Row():
 
436
  cache_examples = True,
437
  )
438
 
439
+ def height_input_debug_change(value):
440
+ global height_input_debug_value
441
+ height_input_debug_value = value
442
+ return []
443
+
444
+ def width_input_debug_change(value):
445
+ global width_input_debug_value
446
+ width_input_debug_value = value
447
+ return []
448
+
449
  def image_i2v_debug_upload(image_filepath):
450
  global image_i2v_debug_value
451
  image_i2v_debug_value = image_filepath
 
528
  inputs=[image_i2v_debug],
529
  outputs=[]
530
  )
531
+ height_input_debug.change(
532
+ fn=height_input_debug_change,
533
+ inputs=[height_input_debug],
534
+ outputs=[]
535
+ )
536
+ width_input_debug.change(
537
+ fn=width_input_debug_change,
538
+ inputs=[width_input_debug],
539
+ outputs=[]
540
+ )
541
 
542
  image_tab.select(
543
  fn=update_task_image,