inoculatemedia commited on
Commit
6a2344c
·
verified ·
1 Parent(s): 68f9c54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -68,7 +68,6 @@ def sample(
68
  base_count = len(glob(os.path.join(output_folder, "*.mp4")))
69
  video_path = os.path.join(output_folder, f"{base_count:06d}.mp4")
70
  res_variants = {
71
- '16:9 (1240x720)': '1240x720/////////////////////////////',
72
  '16:9 (672x384)': '672x384',
73
  '9:16 (384x672)': '384x672',
74
  '1:1 (512x512)': '512x512',
@@ -93,7 +92,7 @@ def sample(
93
 
94
  return video_path
95
 
96
- def resize_image(image, output_size=(1240, 720)):
97
  # Calculate aspect ratios
98
  target_aspect = output_size[0] / output_size[1] # Aspect ratio of the desired size
99
  image_aspect = image.width / image.height # Aspect ratio of the original image
@@ -153,17 +152,17 @@ with gr.Blocks() as demo:
153
  with gr.Column():
154
  aspect_ratio = gr.Dropdown(
155
  label="Aspect ratio",
156
- choices=["16:9 (1240x720)","16:9 (672x384)", "9:16 (384x672)", "1:1 (512x512)", "1:2 (352x736)", "2:1 (736x352)"],
157
- value="16:9 (1240x720)"
158
  )
159
  generate_btn = gr.Button("Generate Video")
160
 
161
- with gr.Accordion("Advanced options", open=False):
162
- seed = gr.Slider(label="Seed", value=42, randomize=True, minimum=0, maximum=max_64_bit_int, step=1)
163
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
164
- motion_bucket_id = gr.Slider(label="Motion bucket id", info="Controls how much motion to add/remove from the image", value=127, minimum=1, maximum=255)
165
- fps_id = gr.Slider(label="Frames per second", info="The length of your video in seconds will be 25/fps", value=6, minimum=5, maximum=30)
166
-
167
  # image.upload(fn=resize_image, inputs=image, outputs=image, queue=False)
168
 
169
  def beautify_prompt(prompt: str, max_attempts: int = 5) -> str:
 
68
  base_count = len(glob(os.path.join(output_folder, "*.mp4")))
69
  video_path = os.path.join(output_folder, f"{base_count:06d}.mp4")
70
  res_variants = {
 
71
  '16:9 (672x384)': '672x384',
72
  '9:16 (384x672)': '384x672',
73
  '1:1 (512x512)': '512x512',
 
92
 
93
  return video_path
94
 
95
+ def resize_image(image, output_size=(672, 384)):
96
  # Calculate aspect ratios
97
  target_aspect = output_size[0] / output_size[1] # Aspect ratio of the desired size
98
  image_aspect = image.width / image.height # Aspect ratio of the original image
 
152
  with gr.Column():
153
  aspect_ratio = gr.Dropdown(
154
  label="Aspect ratio",
155
+ choices=["16:9 (672x384)", "9:16 (384x672)", "1:1 (512x512)", "1:2 (352x736)", "2:1 (736x352)"],
156
+ value="16:9 (672x384)"
157
  )
158
  generate_btn = gr.Button("Generate Video")
159
 
160
+ # with gr.Accordion("Advanced options", open=False):
161
+ # seed = gr.Slider(label="Seed", value=42, randomize=True, minimum=0, maximum=max_64_bit_int, step=1)
162
+ # randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
163
+ # motion_bucket_id = gr.Slider(label="Motion bucket id", info="Controls how much motion to add/remove from the image", value=127, minimum=1, maximum=255)
164
+ # fps_id = gr.Slider(label="Frames per second", info="The length of your video in seconds will be 25/fps", value=6, minimum=5, maximum=30)
165
+
166
  # image.upload(fn=resize_image, inputs=image, outputs=image, queue=False)
167
 
168
  def beautify_prompt(prompt: str, max_attempts: int = 5) -> str: