Update app.py
Browse files
app.py
CHANGED
|
@@ -3,20 +3,20 @@ import torch
|
|
| 3 |
import os
|
| 4 |
from diffusers import AutoencoderKLLTXVideo, LTXImageToVideoPipeline, LTXVideoTransformer3DModel
|
| 5 |
from transformers import T5EncoderModel
|
| 6 |
-
from diffusers.utils import export_to_video, load_image #, PIL_INTERPOLATION
|
| 7 |
|
| 8 |
import gradio as gr
|
| 9 |
import numpy as np
|
| 10 |
import random
|
| 11 |
from PIL import Image
|
| 12 |
-
import imageio.v3
|
| 13 |
|
| 14 |
torch.backends.cuda.matmul.allow_tf32 = False
|
| 15 |
torch.backends.cuda.matmul.allow_bf16_reduced_precision_reduction = False
|
| 16 |
torch.backends.cuda.matmul.allow_fp16_reduced_precision_reduction = False
|
| 17 |
torch.backends.cudnn.allow_tf32 = False
|
| 18 |
torch.backends.cudnn.deterministic = False
|
| 19 |
-
torch.backends.cudnn.benchmark =
|
| 20 |
#torch.backends.cuda.preferred_blas_library="cublas"
|
| 21 |
#torch.backends.cuda.preferred_linalg_library="cusolver"
|
| 22 |
torch.set_float32_matmul_precision("highest")
|
|
@@ -80,17 +80,17 @@ iface = gr.Interface(
|
|
| 80 |
inputs=[
|
| 81 |
gr.Image(type="filepath", label="Image"),
|
| 82 |
gr.Textbox(lines=2, label="Prompt"),
|
| 83 |
-
gr.Textbox(lines=2, label="Negative Prompt"),
|
| 84 |
gr.Slider(minimum=256, maximum=1024, step=8, value=704, label="Width"),
|
| 85 |
gr.Slider(minimum=256, maximum=1024, step=8, value=704, label="Height"),
|
| 86 |
gr.Slider(minimum=16, maximum=256, step=16, value=111, label="Number of Frames"),
|
| 87 |
-
gr.Slider(minimum=0.0, maximum=30.0, step=0.
|
| 88 |
-
gr.Slider(minimum=1, maximum=100, step=1, value=
|
| 89 |
gr.Slider(minimum=1, maximum=60, step=1, value=25, label="FPS"),
|
| 90 |
],
|
| 91 |
outputs=gr.Video(label="Generated Video"),
|
| 92 |
title="LTX-Video Test D",
|
| 93 |
-
description="Generate video from image with LTX-Video.",
|
| 94 |
)
|
| 95 |
|
| 96 |
iface.launch()
|
|
|
|
| 3 |
import os
|
| 4 |
from diffusers import AutoencoderKLLTXVideo, LTXImageToVideoPipeline, LTXVideoTransformer3DModel
|
| 5 |
from transformers import T5EncoderModel
|
| 6 |
+
from diffusers.utils import export_to_video #, load_image #, PIL_INTERPOLATION
|
| 7 |
|
| 8 |
import gradio as gr
|
| 9 |
import numpy as np
|
| 10 |
import random
|
| 11 |
from PIL import Image
|
| 12 |
+
# import imageio.v3
|
| 13 |
|
| 14 |
torch.backends.cuda.matmul.allow_tf32 = False
|
| 15 |
torch.backends.cuda.matmul.allow_bf16_reduced_precision_reduction = False
|
| 16 |
torch.backends.cuda.matmul.allow_fp16_reduced_precision_reduction = False
|
| 17 |
torch.backends.cudnn.allow_tf32 = False
|
| 18 |
torch.backends.cudnn.deterministic = False
|
| 19 |
+
torch.backends.cudnn.benchmark = True
|
| 20 |
#torch.backends.cuda.preferred_blas_library="cublas"
|
| 21 |
#torch.backends.cuda.preferred_linalg_library="cusolver"
|
| 22 |
torch.set_float32_matmul_precision("highest")
|
|
|
|
| 80 |
inputs=[
|
| 81 |
gr.Image(type="filepath", label="Image"),
|
| 82 |
gr.Textbox(lines=2, label="Prompt"),
|
| 83 |
+
gr.Textbox(lines=2, label="Negative Prompt", value="blurry, distorted"),
|
| 84 |
gr.Slider(minimum=256, maximum=1024, step=8, value=704, label="Width"),
|
| 85 |
gr.Slider(minimum=256, maximum=1024, step=8, value=704, label="Height"),
|
| 86 |
gr.Slider(minimum=16, maximum=256, step=16, value=111, label="Number of Frames"),
|
| 87 |
+
gr.Slider(minimum=0.0, maximum=30.0, step=0.05, value=3.35, label="Guidance Scale"),
|
| 88 |
+
gr.Slider(minimum=1, maximum=100, step=1, value=50, label="Number of Inference Steps"),
|
| 89 |
gr.Slider(minimum=1, maximum=60, step=1, value=25, label="FPS"),
|
| 90 |
],
|
| 91 |
outputs=gr.Video(label="Generated Video"),
|
| 92 |
title="LTX-Video Test D",
|
| 93 |
+
description="Generate video from image with LTX-Image-to-Video.",
|
| 94 |
)
|
| 95 |
|
| 96 |
iface.launch()
|