Update app.py
Browse files
app.py
CHANGED
|
@@ -151,6 +151,8 @@ def generate_video(
|
|
| 151 |
prompt: str,
|
| 152 |
end_frame_upload=None,
|
| 153 |
end_frame_generated=None,
|
|
|
|
|
|
|
| 154 |
duration: float = 5,
|
| 155 |
enhance_prompt: bool = True,
|
| 156 |
negative_prompt: str = DEFAULT_NEGATIVE_PROMPT,
|
|
@@ -194,7 +196,7 @@ def generate_video(
|
|
| 194 |
else:
|
| 195 |
temp_start_path = Path(start_frame)
|
| 196 |
temp_paths.append(temp_start_path)
|
| 197 |
-
images.append((str(temp_start_path), 0,
|
| 198 |
|
| 199 |
# Save end frame (last frame index) if provided
|
| 200 |
if end_frame is not None:
|
|
@@ -204,7 +206,7 @@ def generate_video(
|
|
| 204 |
else:
|
| 205 |
temp_end_path = Path(end_frame)
|
| 206 |
temp_paths.append(temp_end_path)
|
| 207 |
-
images.append((str(temp_end_path), num_frames - 1,
|
| 208 |
|
| 209 |
# Get embeddings from text encoder space
|
| 210 |
print(f"Encoding prompt: {prompt}")
|
|
@@ -341,6 +343,21 @@ with gr.Blocks(title="LTX-2 Keyframe Interpolation 🎥🔈") as demo:
|
|
| 341 |
label="Enhance Prompt",
|
| 342 |
value=True
|
| 343 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 344 |
|
| 345 |
negative_prompt = gr.Textbox(
|
| 346 |
label="Negative Prompt",
|
|
@@ -412,6 +429,8 @@ with gr.Blocks(title="LTX-2 Keyframe Interpolation 🎥🔈") as demo:
|
|
| 412 |
prompt,
|
| 413 |
end_frame_upload,
|
| 414 |
end_frame_generated,
|
|
|
|
|
|
|
| 415 |
duration,
|
| 416 |
enhance_prompt,
|
| 417 |
negative_prompt,
|
|
|
|
| 151 |
prompt: str,
|
| 152 |
end_frame_upload=None,
|
| 153 |
end_frame_generated=None,
|
| 154 |
+
strength_start: float = 1.,
|
| 155 |
+
strength_end: float = 1.,
|
| 156 |
duration: float = 5,
|
| 157 |
enhance_prompt: bool = True,
|
| 158 |
negative_prompt: str = DEFAULT_NEGATIVE_PROMPT,
|
|
|
|
| 196 |
else:
|
| 197 |
temp_start_path = Path(start_frame)
|
| 198 |
temp_paths.append(temp_start_path)
|
| 199 |
+
images.append((str(temp_start_path), 0, strength_start))
|
| 200 |
|
| 201 |
# Save end frame (last frame index) if provided
|
| 202 |
if end_frame is not None:
|
|
|
|
| 206 |
else:
|
| 207 |
temp_end_path = Path(end_frame)
|
| 208 |
temp_paths.append(temp_end_path)
|
| 209 |
+
images.append((str(temp_end_path), num_frames - 1, strength_end))
|
| 210 |
|
| 211 |
# Get embeddings from text encoder space
|
| 212 |
print(f"Encoding prompt: {prompt}")
|
|
|
|
| 343 |
label="Enhance Prompt",
|
| 344 |
value=True
|
| 345 |
)
|
| 346 |
+
with gr.Row():
|
| 347 |
+
strength_start = gr.Slider(
|
| 348 |
+
label="strength - start frame",
|
| 349 |
+
minimum=0.0,
|
| 350 |
+
maximum=1.0,
|
| 351 |
+
value=1.0,
|
| 352 |
+
step=0.05
|
| 353 |
+
)
|
| 354 |
+
strength_end = gr.Slider(
|
| 355 |
+
label="strength - end frame",
|
| 356 |
+
minimum=0.0,
|
| 357 |
+
maximum=1.0,
|
| 358 |
+
value=1.0,
|
| 359 |
+
step=0.05
|
| 360 |
+
)
|
| 361 |
|
| 362 |
negative_prompt = gr.Textbox(
|
| 363 |
label="Negative Prompt",
|
|
|
|
| 429 |
prompt,
|
| 430 |
end_frame_upload,
|
| 431 |
end_frame_generated,
|
| 432 |
+
strength_start,
|
| 433 |
+
strength_end,
|
| 434 |
duration,
|
| 435 |
enhance_prompt,
|
| 436 |
negative_prompt,
|