ai-forever commited on
Commit
7b1a1a0
1 Parent(s): 1d2debd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -42,6 +42,7 @@ max_64_bit_int = 2**63 - 1
42
  @spaces.GPU(duration=120)
43
  def sample(
44
  # image: Image,
 
45
  seed: Optional[int] = 42,
46
  # randomize_seed: bool = True,
47
  # motion_bucket_id: int = 127,
@@ -65,8 +66,9 @@ def sample(
65
  video_path = os.path.join(output_folder, f"{base_count:06d}.mp4")
66
 
67
  # frames = pipe(image, decode_chunk_size=decoding_t, generator=generator, motion_bucket_id=motion_bucket_id, noise_aug_strength=0.1, num_frames=25).frames[0]
68
- prompt = "The camera follows behind a white vintage SUV with a black roof rack as it speeds up a steep dirt road surrounded by pine trees on a steep mountain slope, dust kicks up from it’s tires, the sunlight shines on the SUV as it speeds along the dirt road, casting a warm glow over the scene. The dirt road curves gently into the distance, with no other cars or vehicles in sight. The trees on either side of the road are redwoods, with patches of greenery scattered throughout. The car is seen from the rear following the curve with ease, making it seem as if it is on a rugged drive through the rugged terrain. The dirt road itself is surrounded by steep hills and mountains, with a clear blue sky above with wispy clouds."
69
  frames = pipe(
 
70
  seed=seed,
71
  time_length=12,
72
  width = 672,
@@ -117,8 +119,16 @@ with gr.Blocks() as demo:
117
  with gr.Row():
118
  with gr.Column():
119
  # image = gr.Image(label="Upload your image", type="pil")
120
- generate_btn = gr.Button("Generate")
121
  video = gr.Video()
 
 
 
 
 
 
 
 
 
122
  # with gr.Accordion("Advanced options", open=False):
123
  # seed = gr.Slider(label="Seed", value=42, randomize=True, minimum=0, maximum=max_64_bit_int, step=1)
124
  # randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
@@ -126,7 +136,7 @@ with gr.Blocks() as demo:
126
  # 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)
127
 
128
  # image.upload(fn=resize_image, inputs=image, outputs=image, queue=False)
129
- generate_btn.click(fn=sample, inputs=[], outputs=[video], api_name="video")
130
  # gr.Examples(
131
  # examples=[
132
  # "images/blink_meme.png",
 
42
  @spaces.GPU(duration=120)
43
  def sample(
44
  # image: Image,
45
+ prompt,
46
  seed: Optional[int] = 42,
47
  # randomize_seed: bool = True,
48
  # motion_bucket_id: int = 127,
 
66
  video_path = os.path.join(output_folder, f"{base_count:06d}.mp4")
67
 
68
  # frames = pipe(image, decode_chunk_size=decoding_t, generator=generator, motion_bucket_id=motion_bucket_id, noise_aug_strength=0.1, num_frames=25).frames[0]
69
+ # prompt = "The camera follows behind a white vintage SUV with a black roof rack as it speeds up a steep dirt road surrounded by pine trees on a steep mountain slope, dust kicks up from it’s tires, the sunlight shines on the SUV as it speeds along the dirt road, casting a warm glow over the scene. The dirt road curves gently into the distance, with no other cars or vehicles in sight. The trees on either side of the road are redwoods, with patches of greenery scattered throughout. The car is seen from the rear following the curve with ease, making it seem as if it is on a rugged drive through the rugged terrain. The dirt road itself is surrounded by steep hills and mountains, with a clear blue sky above with wispy clouds."
70
  frames = pipe(
71
+ prompt,
72
  seed=seed,
73
  time_length=12,
74
  width = 672,
 
119
  with gr.Row():
120
  with gr.Column():
121
  # image = gr.Image(label="Upload your image", type="pil")
 
122
  video = gr.Video()
123
+ prompt = gr.Text(
124
+ label="Prompt",
125
+ show_label=False,
126
+ max_lines=1,
127
+ placeholder="Enter your prompt",
128
+ container=False,
129
+ )
130
+ generate_btn = gr.Button("Generate")
131
+
132
  # with gr.Accordion("Advanced options", open=False):
133
  # seed = gr.Slider(label="Seed", value=42, randomize=True, minimum=0, maximum=max_64_bit_int, step=1)
134
  # randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
 
136
  # 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)
137
 
138
  # image.upload(fn=resize_image, inputs=image, outputs=image, queue=False)
139
+ generate_btn.click(fn=sample, inputs=[prompt], outputs=[video], api_name="video")
140
  # gr.Examples(
141
  # examples=[
142
  # "images/blink_meme.png",