Spaces:
Runtime error
Runtime error
Update app.py (#1)
Browse files- Update app.py (b3547a510c7a30c0995836463308ff6a98d90a1e)
- Update app.py (f41263642fc83451fae2692116077eac7746722b)
26 unmodified lines272829303031323334353637383937404142431 unmodified line45464745464849505152535448495556575859102 unmodified lines1621631641651661671681581691701711721731601741751766 unmodified lines18318418517318618718818919019119217919319419519619726 unmodified lines@spaces.GPUdef generate(prompt, negative_prompt, image, image, video, steps, num_frames, seed, randomize_seed, t2v, improve_texture=False, progress=gr.Progress(track_tqdm=True)): if randomize_seed: seed = random.randint(0, MAX_SEED) # Part 1. Generate video at smaller resolution # Text-only conditioning is also supported without the need to pass `conditions` expected_height, expected_width = 768, 11521 unmodified line downscaled_height, downscaled_width = int(expected_height * downscale_factor), int(expected_width * downscale_factor) downscaled_height, downscaled_width = round_to_nearest_resolution_acceptable_by_vae(downscaled_height, downscaled_width)
if randomize_seed: seed = random.randint(0, MAX_SEED) condition = image is not None or video is not None if video: frames_to_use = 21 video = load_video(video)[:frames_to_use] else: video = [image]
if image is not None or t2v: condition1 = LTXVideoCondition(video=image, frame_index=0) if condition and (not t2v): condition1 = LTXVideoCondition(video=video, frame_index=0) latents = pipe( conditions=condition1, prompt=prompt,102 unmodified lines with gr.Row(): with gr.Column(): with gr.Group(): with gr.Tab("text-to-video"): image = gr.Image(label="", visible=False) #prompt = gr.Textbox(label="prompt") with gr.Tab("image-to-video"): image = gr.Image(label="") image = gr.Image(label="") #prompt = gr.Textbox(label="prompt") with gr.Tab("video-to-video"): video = gr.Video(label="") prompt = gr.Textbox(label="prompt") t2v = gr.Checkbox(label="run text-to-video", value=False) run_button = gr.Button() with gr.Column(): output = gr.Video(interactive=False)6 unmodified lines randomize_seed = gr.Checkbox(label="randomize seed") with gr.Row(): steps = gr.Slider(label="Steps", minimum=1, maximum=30, value=8, step=1) num_frames = gr.Slider(label="# frames", minimum=1, maximum=200, value=161, step=1) num_frames = gr.Slider(label="# frames", minimum=1, maximum=30, value=8, step=1)
run_button.click(fn=generate, inputs=[prompt, negative_prompt, image, image, video, steps, num_frames, seed,app.py+25-10