mirror of
https://github.com/n00mkrad/flowframes.git
synced 2026-07-10 12:37:56 +02:00
Run CreateDupesFile, FrameRename and CreateFrameOrderFile in background threads
This commit is contained in:
@@ -229,9 +229,6 @@ namespace Flowframes.Magick
|
||||
if(debug)
|
||||
Logger.Log($"{(isLastItem ? "[isLastItem] " : "")}frameNum1 (frameFiles[{i}]) = {frameNum1}, frameNum2 (frameFiles[{i+1}]) = {frameNum2} => dupes = {dupes}", true, false, "dupes");
|
||||
|
||||
//if (File.Exists(Path.Combine(framesPath.GetParentDir(), Paths.scenesDir, frameFiles[i].Name)))
|
||||
// dupes = 0;
|
||||
|
||||
fileContent += $"{Path.GetFileNameWithoutExtension(frameFiles[i].Name)}:{dupes}\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Flowframes
|
||||
await CreateVideo.Export(current.interpFolder, current.outPath, current.outMode, false);
|
||||
|
||||
if (Config.GetBool("keepTempFolder"))
|
||||
await FrameRename.Unrename();
|
||||
await Task.Run(async () => { await FrameRename.Unrename(); });
|
||||
|
||||
await Cleanup();
|
||||
Program.mainForm.SetWorking(false);
|
||||
@@ -142,6 +142,8 @@ namespace Flowframes
|
||||
{
|
||||
if (canceled) return;
|
||||
|
||||
Program.mainForm.SetStatus("Processing frames...");
|
||||
|
||||
int extractedFrames = IOUtils.GetAmountOfFiles(current.framesFolder, false, "*" + current.framesExt);
|
||||
if (!Directory.Exists(current.framesFolder) || currentInputFrameCount <= 0 || extractedFrames < 2)
|
||||
{
|
||||
@@ -189,9 +191,10 @@ namespace Flowframes
|
||||
public static async Task RunAi(string outpath, AI ai, bool stepByStep = false)
|
||||
{
|
||||
if (canceled) return;
|
||||
await Dedupe.CreateDupesFile(current.framesFolder, currentInputFrameCount, current.framesExt);
|
||||
await FrameRename.Rename();
|
||||
await FrameOrder.CreateFrameOrderFile(current.framesFolder, Config.GetBool("enableLoop"), current.interpFactor);
|
||||
|
||||
await Task.Run(async () => { await Dedupe.CreateDupesFile(current.framesFolder, currentInputFrameCount, current.framesExt); });
|
||||
await Task.Run(async () => { await FrameRename.Rename(); });
|
||||
await Task.Run(async () => { await FrameOrder.CreateFrameOrderFile(current.framesFolder, Config.GetBool("enableLoop"), current.interpFactor); });
|
||||
|
||||
Program.mainForm.SetStatus("Downloading models...");
|
||||
await ModelDownloader.DownloadModelFiles(ai.pkgDir, current.model);
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Flowframes.Main
|
||||
if (canceled) return;
|
||||
Program.mainForm.SetStatus("Running AI...");
|
||||
await RunAi(current.interpFolder, current.ai, true);
|
||||
await FrameRename.Unrename(); // Get timestamps back
|
||||
await Task.Run(async () => { await FrameRename.Unrename(); }); // Get timestamps back
|
||||
Program.mainForm.SetProgress(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user