Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ torch.backends.cuda.preferred_linalg_library="cusolver"
|
|
37 |
|
38 |
torch.set_float32_matmul_precision("highest")
|
39 |
|
40 |
-
MAX_SEED = np.iinfo(np.
|
41 |
|
42 |
# Load Hugging Face token if needed
|
43 |
hf_token = os.getenv("HF_TOKEN")
|
@@ -124,7 +124,7 @@ def center_crop_and_resize(frame, target_height, target_width):
|
|
124 |
frame_resized = cv2.resize(frame_cropped, (target_width, target_height))
|
125 |
return frame_resized
|
126 |
|
127 |
-
def load_image_to_tensor_with_resize(image_path, target_height=
|
128 |
image = Image.open(image_path).convert("RGB")
|
129 |
image_np = np.array(image)
|
130 |
frame_resized = center_crop_and_resize(image_np, target_height, target_width)
|
@@ -246,7 +246,7 @@ def generate_video_from_text(
|
|
246 |
frame_rate=25,
|
247 |
seed=random.randint(0, MAX_SEED),
|
248 |
num_inference_steps=30,
|
249 |
-
guidance_scale=
|
250 |
height=768,
|
251 |
width=768,
|
252 |
num_frames=60,
|
@@ -326,7 +326,7 @@ def generate_video_from_image(
|
|
326 |
frame_rate=20,
|
327 |
seed=random.randint(0, MAX_SEED),
|
328 |
num_inference_steps=35,
|
329 |
-
guidance_scale=
|
330 |
height=768,
|
331 |
width=768,
|
332 |
num_frames=60,
|
@@ -412,7 +412,7 @@ def create_advanced_options():
|
|
412 |
with gr.Accordion("Step 4: Advanced Options (Optional)", open=False):
|
413 |
seed = gr.Slider(label="4.1 Seed", minimum=0, maximum=1000000, step=1, value=646373)
|
414 |
inference_steps = gr.Slider(label="4.2 Inference Steps", minimum=5, maximum=150, step=5, value=40)
|
415 |
-
guidance_scale = gr.Slider(label="4.3 Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=
|
416 |
|
417 |
gpu_duration = gr.Dropdown(
|
418 |
label="GPU Duration",
|
|
|
37 |
|
38 |
torch.set_float32_matmul_precision("highest")
|
39 |
|
40 |
+
MAX_SEED = np.iinfo(np.int32).max
|
41 |
|
42 |
# Load Hugging Face token if needed
|
43 |
hf_token = os.getenv("HF_TOKEN")
|
|
|
124 |
frame_resized = cv2.resize(frame_cropped, (target_width, target_height))
|
125 |
return frame_resized
|
126 |
|
127 |
+
def load_image_to_tensor_with_resize(image_path, target_height=768, target_width=768):
|
128 |
image = Image.open(image_path).convert("RGB")
|
129 |
image_np = np.array(image)
|
130 |
frame_resized = center_crop_and_resize(image_np, target_height, target_width)
|
|
|
246 |
frame_rate=25,
|
247 |
seed=random.randint(0, MAX_SEED),
|
248 |
num_inference_steps=30,
|
249 |
+
guidance_scale=3.2,
|
250 |
height=768,
|
251 |
width=768,
|
252 |
num_frames=60,
|
|
|
326 |
frame_rate=20,
|
327 |
seed=random.randint(0, MAX_SEED),
|
328 |
num_inference_steps=35,
|
329 |
+
guidance_scale=3.2,
|
330 |
height=768,
|
331 |
width=768,
|
332 |
num_frames=60,
|
|
|
412 |
with gr.Accordion("Step 4: Advanced Options (Optional)", open=False):
|
413 |
seed = gr.Slider(label="4.1 Seed", minimum=0, maximum=1000000, step=1, value=646373)
|
414 |
inference_steps = gr.Slider(label="4.2 Inference Steps", minimum=5, maximum=150, step=5, value=40)
|
415 |
+
guidance_scale = gr.Slider(label="4.3 Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=3.2)
|
416 |
|
417 |
gpu_duration = gr.Dropdown(
|
418 |
label="GPU Duration",
|