FIX 更改缓存路径
This commit is contained in:
parent
f5f35a5c44
commit
7babcd2869
|
|
@ -154,7 +154,7 @@ class VideoCutByFramePoint:
|
||||||
uid = uuid.uuid1()
|
uid = uuid.uuid1()
|
||||||
temp_fname = os.sep.join(
|
temp_fname = os.sep.join(
|
||||||
[
|
[
|
||||||
*video_path.split(os.sep)[:-1],
|
os.path.dirname(__file__),
|
||||||
"%s.%s" % (str(uid), video_path.split(".")[-1]),
|
"%s.%s" % (str(uid), video_path.split(".")[-1]),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
@ -173,7 +173,7 @@ class VideoCutByFramePoint:
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
output = (
|
output = (
|
||||||
os.sep.join([*video_path.split(os.sep)[:-1], output_name])
|
os.sep.join([os.path.dirname(__file__), output_name])
|
||||||
.replace(
|
.replace(
|
||||||
os.sep.join(["ComfyUI", "input"]), os.sep.join(["ComfyUI", "output"])
|
os.sep.join(["ComfyUI", "input"]), os.sep.join(["ComfyUI", "output"])
|
||||||
)
|
)
|
||||||
|
|
@ -214,21 +214,21 @@ class VideoCutByFramePoint:
|
||||||
os.remove(temp_fname)
|
os.remove(temp_fname)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
try:
|
# try:
|
||||||
files = glob.glob(output.replace("%03d", "*"))
|
# files = glob.glob(output.replace("%03d", "*"))
|
||||||
for file in files:
|
# for file in files:
|
||||||
shutil.move(file, file.replace(str(uid), origin_fname))
|
# shutil.move(file, file.replace(str(uid), origin_fname))
|
||||||
files = glob.glob(
|
# files = glob.glob(
|
||||||
output.replace(str(uid), origin_fname).replace("%03d", "*")
|
# output.replace(str(uid), origin_fname).replace("%03d", "*")
|
||||||
)
|
# )
|
||||||
except:
|
# except:
|
||||||
files = glob.glob(output.replace("%03d", "*"))
|
# files = glob.glob(output.replace("%03d", "*"))
|
||||||
traceback.print_exc()
|
# traceback.print_exc()
|
||||||
video, audio, info = torchvision.io.read_video(files[0])
|
video, audio, info = torchvision.io.read_video(output)
|
||||||
video.mul_(255)
|
video.mul_(255)
|
||||||
audio.unsqueeze_(0)
|
audio.unsqueeze_(0)
|
||||||
try:
|
try:
|
||||||
os.remove(files[0])
|
os.remove(output)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
return (video, {"waveform":audio,"sample_rate":info["audio_fps"]},)
|
return (video, {"waveform":audio,"sample_rate":info["audio_fps"]},)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue