multimodalart HF Staff commited on
Commit
826eb28
·
verified ·
1 Parent(s): b4e4e06

Randomize seeds sby default

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -319,7 +319,7 @@ def generate(prompt, negative_prompt, input_image_filepath, input_video_filepath
319
  print(f"Fallback video saving error: {e2}")
320
  raise gr.Error(f"Failed to save video: {e2}")
321
 
322
- return output_video_path
323
 
324
 
325
  # --- Gradio UI Definition ---
@@ -371,7 +371,7 @@ with gr.Blocks(css=css) as demo:
371
  negative_prompt_input = gr.Textbox(label="Negative Prompt", value="worst quality, inconsistent motion, blurry, jittery, distorted", lines=2)
372
  with gr.Row():
373
  seed_input = gr.Number(label="Seed", value=42, precision=0, minimum=0, maximum=2**32-1)
374
- randomize_seed_input = gr.Checkbox(label="Randomize Seed", value=False)
375
  with gr.Row():
376
  guidance_scale_input = gr.Slider(label="Guidance Scale (CFG)", minimum=1.0, maximum=10.0, value=PIPELINE_CONFIG_YAML.get("first_pass", {}).get("guidance_scale", 1.0), step=0.1, info="Controls how much the prompt influences the output. Higher values = stronger influence.")
377
  # Removed steps_input slider
@@ -461,9 +461,9 @@ with gr.Blocks(css=css) as demo:
461
  duration_input, frames_to_use, # Removed steps_input
462
  seed_input, randomize_seed_input, guidance_scale_input, improve_texture]
463
 
464
- t2v_button.click(fn=generate, inputs=t2v_inputs, outputs=[output_video], api_name="text_to_video")
465
- i2v_button.click(fn=generate, inputs=i2v_inputs, outputs=[output_video], api_name="image_to_video")
466
- v2v_button.click(fn=generate, inputs=v2v_inputs, outputs=[output_video], api_name="video_to_video")
467
 
468
  if __name__ == "__main__":
469
  if os.path.exists(models_dir) and os.path.isdir(models_dir):
 
319
  print(f"Fallback video saving error: {e2}")
320
  raise gr.Error(f"Failed to save video: {e2}")
321
 
322
+ return output_video_path, seed_ui
323
 
324
 
325
  # --- Gradio UI Definition ---
 
371
  negative_prompt_input = gr.Textbox(label="Negative Prompt", value="worst quality, inconsistent motion, blurry, jittery, distorted", lines=2)
372
  with gr.Row():
373
  seed_input = gr.Number(label="Seed", value=42, precision=0, minimum=0, maximum=2**32-1)
374
+ randomize_seed_input = gr.Checkbox(label="Randomize Seed", value=True)
375
  with gr.Row():
376
  guidance_scale_input = gr.Slider(label="Guidance Scale (CFG)", minimum=1.0, maximum=10.0, value=PIPELINE_CONFIG_YAML.get("first_pass", {}).get("guidance_scale", 1.0), step=0.1, info="Controls how much the prompt influences the output. Higher values = stronger influence.")
377
  # Removed steps_input slider
 
461
  duration_input, frames_to_use, # Removed steps_input
462
  seed_input, randomize_seed_input, guidance_scale_input, improve_texture]
463
 
464
+ t2v_button.click(fn=generate, inputs=t2v_inputs, outputs=[output_video, seed_ui], api_name="text_to_video")
465
+ i2v_button.click(fn=generate, inputs=i2v_inputs, outputs=[output_video, seed_ui], api_name="image_to_video")
466
+ v2v_button.click(fn=generate, inputs=v2v_inputs, outputs=[output_video, seed_ui], api_name="video_to_video")
467
 
468
  if __name__ == "__main__":
469
  if os.path.exists(models_dir) and os.path.isdir(models_dir):