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