Eueuiaa commited on
Commit
320a8a3
·
verified ·
1 Parent(s): ac04fcc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -134,17 +134,18 @@ with gr.Blocks() as demo:
134
  start_image = gr.Image(label="Imagem de Início (Opcional)", type="filepath", sources=["upload"])
135
 
136
  with gr.Accordion("Parâmetros Principais", open=False):
137
- duration_input = gr.Slider(label="Duração Total (s)", value=8, step=1, minimum=2, maximum=40)
138
  with gr.Row():
139
  height_input = gr.Slider(label="Height", value=720, step=32, minimum=256, maximum=1024)
140
- width_input = gr.Slider(label="Width", value=480, step=32, minimum=256, maximum=1024)
141
  with gr.Row():
142
  seed_input = gr.Number(label="Seed", value=42, precision=0)
143
  randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
144
 
145
  with gr.Accordion("Opções Adicionais LTX (Avançado)", open=False):
146
- cfg_input = gr.Slider(label="Guidance Scale (CFG)", info="Afeta o refinamento (se usado) e não tem efeito no First Pass dos modelos 'distilled'.", value=3.0, step=0.1, minimum=1.0, maximum=10.0)
147
-
 
148
  with gr.Tabs():
149
  with gr.TabItem("Guiagem (First Pass)"):
150
  fp_guidance_preset = gr.Dropdown(
@@ -157,10 +158,7 @@ with gr.Blocks() as demo:
157
  fp_guidance_scale_list = gr.Textbox(label="Lista de Guidance Scale", value="[1, 1, 6, 8, 6, 1, 1]")
158
  fp_stg_scale_list = gr.Textbox(label="Lista de STG Scale (Movimento)", value="[0, 0, 4, 4, 4, 2, 1]")
159
  fp_timesteps_list = gr.Textbox(label="Lista de Guidance Timesteps", value="[1.0, 0.996, 0.9933, 0.9850, 0.9767, 0.9008, 0.6180]")
160
-
161
- with gr.TabItem("Geral"):
162
- fp_num_inference_steps = gr.Slider(label="Passos de Inferência (First Pass)", minimum=10, maximum=100, step=1, value=30)
163
-
164
  generate_low_btn = gr.Button("1. Gerar Vídeo Base", variant="primary")
165
 
166
  with gr.Column(scale=1):
@@ -199,8 +197,7 @@ with gr.Blocks() as demo:
199
  fp_guidance_preset.change(fn=update_custom_guidance_visibility, inputs=fp_guidance_preset, outputs=custom_guidance_group)
200
 
201
  all_ltx_inputs = [
202
- fp_guidance_preset, fp_guidance_scale_list, fp_stg_scale_list, fp_timesteps_list,
203
- fp_num_inference_steps,
204
  ]
205
 
206
  generate_low_btn.click(
@@ -208,6 +205,7 @@ with gr.Blocks() as demo:
208
  inputs=[
209
  generation_mode_input, prompt_input, neg_prompt_input, start_image, height_input, width_input,
210
  duration_input, cfg_input, seed_input, randomize_seed,
 
211
  *all_ltx_inputs
212
  ],
213
  outputs=[low_res_video_output, app_state, post_prod_group]
 
134
  start_image = gr.Image(label="Imagem de Início (Opcional)", type="filepath", sources=["upload"])
135
 
136
  with gr.Accordion("Parâmetros Principais", open=False):
137
+ duration_input = gr.Slider(label="Duração Total (s)", value=1, step=1, minimum=1, maximum=40)
138
  with gr.Row():
139
  height_input = gr.Slider(label="Height", value=720, step=32, minimum=256, maximum=1024)
140
+ width_input = gr.Slider(label="Width", value=720, step=32, minimum=256, maximum=1024)
141
  with gr.Row():
142
  seed_input = gr.Number(label="Seed", value=42, precision=0)
143
  randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
144
 
145
  with gr.Accordion("Opções Adicionais LTX (Avançado)", open=False):
146
+ cfg_input = gr.Slider(label="Guidance Scale (CFG)", info="Afeta o refinamento (se usado) e não tem efeito no First Pass dos modelos 'distilled'.", value=0.0, step=1, minimum=0.0, maximum=10.0)
147
+ fp_num_inference_steps = gr.Slider(label="Passos de Inferência (First Pass)", minimum=10, maximum=100, step=1, value=30)
148
+
149
  with gr.Tabs():
150
  with gr.TabItem("Guiagem (First Pass)"):
151
  fp_guidance_preset = gr.Dropdown(
 
158
  fp_guidance_scale_list = gr.Textbox(label="Lista de Guidance Scale", value="[1, 1, 6, 8, 6, 1, 1]")
159
  fp_stg_scale_list = gr.Textbox(label="Lista de STG Scale (Movimento)", value="[0, 0, 4, 4, 4, 2, 1]")
160
  fp_timesteps_list = gr.Textbox(label="Lista de Guidance Timesteps", value="[1.0, 0.996, 0.9933, 0.9850, 0.9767, 0.9008, 0.6180]")
161
+
 
 
 
162
  generate_low_btn = gr.Button("1. Gerar Vídeo Base", variant="primary")
163
 
164
  with gr.Column(scale=1):
 
197
  fp_guidance_preset.change(fn=update_custom_guidance_visibility, inputs=fp_guidance_preset, outputs=custom_guidance_group)
198
 
199
  all_ltx_inputs = [
200
+ fp_guidance_preset, fp_guidance_scale_list, fp_stg_scale_list, fp_timesteps_list
 
201
  ]
202
 
203
  generate_low_btn.click(
 
205
  inputs=[
206
  generation_mode_input, prompt_input, neg_prompt_input, start_image, height_input, width_input,
207
  duration_input, cfg_input, seed_input, randomize_seed,
208
+ fp_num_inference_steps, ship_initial_inference_steps, ship_final_inference_steps
209
  *all_ltx_inputs
210
  ],
211
  outputs=[low_res_video_output, app_state, post_prod_group]