mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 16:37:48 +01:00
Lock pre-4.0 rife ncnn models to 2x
This commit is contained in:
@@ -135,7 +135,7 @@ namespace Flowframes.IO
|
||||
public static async Task DownloadModelFiles (AI ai, string modelDir, bool log = true)
|
||||
{
|
||||
string aiDir = ai.pkgDir;
|
||||
Logger.Log($"DownloadModelFiles(string ai = {ai}, string model = {modelDir}, bool log = {log})", true);
|
||||
Logger.Log($"DownloadModelFiles(string ai = {ai.aiName}, string model = {modelDir}, bool log = {log})", true);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -272,11 +272,12 @@ namespace Flowframes.Os
|
||||
SetProgressCheck(outPath, factor);
|
||||
int targetFrames = ((IoUtils.GetAmountOfFiles(lastInPath, false, "*.*") * factor).RoundToInt()); // TODO: Maybe won't work with fractional factors ??
|
||||
|
||||
string frames = mdl.Contains("v4") ? $"-n {targetFrames}" : "";
|
||||
string uhdStr = await InterpolateUtils.UseUhd() ? "-u" : "";
|
||||
string ttaStr = Config.GetBool(Config.Key.rifeNcnnUseTta, false) ? "-x" : "";
|
||||
|
||||
rifeNcnn.StartInfo.Arguments = $"{OsUtils.GetCmdArg()} cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.rifeNcnn.pkgDir).Wrap()} & rife-ncnn-vulkan.exe " +
|
||||
$" -v -i {inPath.Wrap()} -o {outPath.Wrap()} -n {targetFrames} -m {mdl.ToLower()} {ttaStr} {uhdStr} -g {Config.Get(Config.Key.ncnnGpus)} -f {GetNcnnPattern()} -j {GetNcnnThreads()}";
|
||||
$" -v -i {inPath.Wrap()} -o {outPath.Wrap()} {frames} -m {mdl.ToLower()} {ttaStr} {uhdStr} -g {Config.Get(Config.Key.ncnnGpus)} -f {GetNcnnPattern()} -j {GetNcnnThreads()}";
|
||||
|
||||
Logger.Log("cmd.exe " + rifeNcnn.StartInfo.Arguments, true);
|
||||
|
||||
|
||||
@@ -157,6 +157,14 @@ namespace Flowframes.Ui
|
||||
{
|
||||
AI ai = Program.mainForm.GetAi();
|
||||
|
||||
if (ai.aiName == Implementations.rifeNcnn.aiName && !Program.mainForm.GetModel(ai).dir.Contains("v4"))
|
||||
{
|
||||
if (factor != 2)
|
||||
Logger.Log($"{ai.friendlyName} models before 4.0 only support 2x interpolation!");
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (ai.factorSupport == AI.FactorSupport.Fixed)
|
||||
{
|
||||
int closest = ai.supportedFactors.Min(i => (Math.Abs(factor.RoundToInt() - i), i)).i;
|
||||
|
||||
Reference in New Issue
Block a user