mirror of
https://github.com/n00mkrad/flowframes.git
synced 2026-07-13 22:09:40 +02:00
Run CreateDupesFile, FrameRename and CreateFrameOrderFile in background threads
This commit is contained in:
@@ -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