Update app.py
Browse files
app.py
CHANGED
@@ -205,7 +205,7 @@ def video_to_audio(video_path, prompt, negative_prompt="music", seed=0, num_step
|
|
205 |
rng.manual_seed(seed)
|
206 |
fm = FlowMatching(min_sigma=0, inference_mode='euler', num_steps=num_steps)
|
207 |
|
208 |
-
# ๋น๋์ค ๋ก๋ -
|
209 |
clip_frames, sync_frames, actual_duration = load_video(video_path, duration)
|
210 |
clip_frames = clip_frames.unsqueeze(0)
|
211 |
sync_frames = sync_frames.unsqueeze(0)
|
@@ -225,17 +225,18 @@ def video_to_audio(video_path, prompt, negative_prompt="music", seed=0, num_step
|
|
225 |
cfg_strength=cfg_strength)
|
226 |
audio = audios.float().cpu()[0]
|
227 |
|
228 |
-
# ๋น๋์ค์ ์ค๋์ค ๊ฒฐํฉ
|
229 |
video_save_path = tempfile.NamedTemporaryFile(delete=False, suffix='.mp4').name
|
230 |
make_video(video_path,
|
231 |
video_save_path,
|
232 |
audio,
|
233 |
-
sampling_rate=mmaudio_seq_cfg.sampling_rate
|
234 |
-
duration_sec=actual_duration) # actual_duration ์ฌ์ฉ
|
235 |
|
236 |
return video_save_path
|
237 |
except Exception as e:
|
238 |
logging.error(f"Video to audio error: {str(e)}")
|
|
|
|
|
239 |
return video_path
|
240 |
|
241 |
def generate_video_from_image(image, prompt="", length=4.0, sound_generation="์ฌ์ด๋ ์์", sound_prompt="", sound_negative_prompt="music"):
|
|
|
205 |
rng.manual_seed(seed)
|
206 |
fm = FlowMatching(min_sigma=0, inference_mode='euler', num_steps=num_steps)
|
207 |
|
208 |
+
# ๋น๋์ค ๋ก๋ - ๋ฐํ๋๋ duration์ ๋ค๋ฅธ ๋ณ์๋ช
์ผ๋ก ๋ฐ๊ธฐ
|
209 |
clip_frames, sync_frames, actual_duration = load_video(video_path, duration)
|
210 |
clip_frames = clip_frames.unsqueeze(0)
|
211 |
sync_frames = sync_frames.unsqueeze(0)
|
|
|
225 |
cfg_strength=cfg_strength)
|
226 |
audio = audios.float().cpu()[0]
|
227 |
|
228 |
+
# ๋น๋์ค์ ์ค๋์ค ๊ฒฐํฉ - duration_sec ๋งค๊ฐ๋ณ์ ์ ๊ฑฐ
|
229 |
video_save_path = tempfile.NamedTemporaryFile(delete=False, suffix='.mp4').name
|
230 |
make_video(video_path,
|
231 |
video_save_path,
|
232 |
audio,
|
233 |
+
sampling_rate=mmaudio_seq_cfg.sampling_rate)
|
|
|
234 |
|
235 |
return video_save_path
|
236 |
except Exception as e:
|
237 |
logging.error(f"Video to audio error: {str(e)}")
|
238 |
+
import traceback
|
239 |
+
traceback.print_exc()
|
240 |
return video_path
|
241 |
|
242 |
def generate_video_from_image(image, prompt="", length=4.0, sound_generation="์ฌ์ด๋ ์์", sound_prompt="", sound_negative_prompt="music"):
|