mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-06-21 20:40:50 +02:00
close files before remove
This commit is contained in:
parent
692eb6f38b
commit
dafdd3d9d8
@ -91,9 +91,11 @@ def check_server_status(jobID, address) -> str | pd.DataFrame:
|
|||||||
elif content_type == 'video/mp4':
|
elif content_type == 'video/mp4':
|
||||||
with open('./outputs/video.mp4', 'wb') as f:
|
with open('./outputs/video.mp4', 'wb') as f:
|
||||||
f.write(response.content)
|
f.write(response.content)
|
||||||
|
f.close()
|
||||||
clip = VideoFileClip("./outputs/video.mp4")
|
clip = VideoFileClip("./outputs/video.mp4")
|
||||||
clip.write_videofile("./outputs/video2.mp4")
|
clip.write_videofile("./outputs/video2.mp4")
|
||||||
result = upload_media_to_hoster("./outputs/video2.mp4")
|
result = upload_media_to_hoster("./outputs/video2.mp4")
|
||||||
|
clip.close()
|
||||||
os.remove("./outputs/video.mp4")
|
os.remove("./outputs/video.mp4")
|
||||||
os.remove("./outputs/video2.mp4")
|
os.remove("./outputs/video2.mp4")
|
||||||
return result
|
return result
|
||||||
|
@ -40,7 +40,7 @@ class VideoGenerationSVD(DVMTaskInterface):
|
|||||||
request_form["trainerFilePath"] = r'modules\stablevideodiffusion\stablevideodiffusion.trainer'
|
request_form["trainerFilePath"] = r'modules\stablevideodiffusion\stablevideodiffusion.trainer'
|
||||||
|
|
||||||
url = ""
|
url = ""
|
||||||
frames = 14 # 25
|
frames = 7 # 25
|
||||||
model = "stabilityai/stable-video-diffusion-img2vid-xt" #,stabilityai/stable-video-diffusion-img2vid
|
model = "stabilityai/stable-video-diffusion-img2vid-xt" #,stabilityai/stable-video-diffusion-img2vid
|
||||||
|
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class VideoGenerationSVD(DVMTaskInterface):
|
|||||||
|
|
||||||
options = {
|
options = {
|
||||||
"model": model,
|
"model": model,
|
||||||
"fps": 14
|
"fps": frames
|
||||||
|
|
||||||
}
|
}
|
||||||
request_form['options'] = json.dumps(options)
|
request_form['options'] = json.dumps(options)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user