linoyts HF Staff commited on
Commit
9c5c2ad
·
verified ·
1 Parent(s): af73a4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -30
app.py CHANGED
@@ -67,34 +67,24 @@ def generate(prompt,
67
 
68
  if condition:
69
  condition1 = LTXVideoCondition(video=video, frame_index=0)
70
- latents = pipe(
71
- conditions=condition1,
72
- prompt=prompt,
73
- negative_prompt=negative_prompt,
74
- width=downscaled_width,
75
- height=downscaled_height,
76
- num_frames=num_frames,
77
- num_inference_steps=steps,
78
- decode_timestep = 0.05,
79
- decode_noise_scale = 0.025,
80
- guidance_scale=1.0,
81
- generator=torch.Generator(device="cuda").manual_seed(seed),
82
- output_type="latent",
83
- ).frames
84
  else:
85
- latents = pipe(
86
- prompt=prompt,
87
- negative_prompt=negative_prompt,
88
- width=downscaled_width,
89
- height=downscaled_height,
90
- num_frames=num_frames,
91
- num_inference_steps=steps,
92
- decode_timestep = 0.05,
93
- decode_noise_scale = 0.025,
94
- guidance_scale=1.0,
95
- generator=torch.Generator(device="cuda").manual_seed(seed),
96
- output_type="latent",
97
- ).frames
 
 
 
 
98
 
99
 
100
 
@@ -121,8 +111,7 @@ def generate(prompt,
121
  output_type="latent"
122
  ).frames
123
 
124
- # Part 3. Denoise the upscaled video with few steps to improve texture (optional, but recommended)
125
-
126
  video = pipe(
127
  conditions=condition1,
128
  prompt=prompt,
@@ -186,7 +175,7 @@ with gr.Blocks(css=css, theme=gr.themes.Ocean()) as demo:
186
  video = gr.Video(label="")
187
  frames_to_use = gr.Number(label="num frames to use",info="first # of frames to use from the input video", value=1)
188
  prompt = gr.Textbox(label="prompt")
189
- improve_texture = gr.Checkbox("improve texture", value=False, info="note it slows generation")
190
  run_button = gr.Button()
191
  with gr.Column():
192
  output = gr.Video(interactive=False)
 
67
 
68
  if condition:
69
  condition1 = LTXVideoCondition(video=video, frame_index=0)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  else:
71
+ condition1 = None
72
+
73
+ latents = pipe(
74
+ conditions=condition1,
75
+ prompt=prompt,
76
+ negative_prompt=negative_prompt,
77
+ width=downscaled_width,
78
+ height=downscaled_height,
79
+ num_frames=num_frames,
80
+ num_inference_steps=steps,
81
+ decode_timestep = 0.05,
82
+ decode_noise_scale = 0.025,
83
+ guidance_scale=1.0,
84
+ generator=torch.Generator(device="cuda").manual_seed(seed),
85
+ output_type="latent",
86
+ ).frames
87
+
88
 
89
 
90
 
 
111
  output_type="latent"
112
  ).frames
113
 
114
+ # Part 3. Denoise the upscaled video with few steps to improve texture (optional, but recommended)
 
115
  video = pipe(
116
  conditions=condition1,
117
  prompt=prompt,
 
175
  video = gr.Video(label="")
176
  frames_to_use = gr.Number(label="num frames to use",info="first # of frames to use from the input video", value=1)
177
  prompt = gr.Textbox(label="prompt")
178
+ improve_texture = gr.Checkbox(label="improve texture", value=False, info="note it slows generation")
179
  run_button = gr.Button()
180
  with gr.Column():
181
  output = gr.Video(interactive=False)