Model Downloader: Only allow downloading models for avail. implementations

This commit is contained in:
N00MKRAD
2024-10-13 14:21:50 +02:00
parent f47a27a7de
commit f8c24c253d
6 changed files with 66 additions and 71 deletions

View File

@@ -43,6 +43,8 @@ namespace Flowframes.Forms
this.dainNcnn = new System.Windows.Forms.CheckBox();
this.flavrCuda = new System.Windows.Forms.CheckBox();
this.xvfiCuda = new System.Windows.Forms.CheckBox();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// longProgBar
@@ -170,7 +172,8 @@ namespace Flowframes.Forms
this.rifeCuda.AutoSize = true;
this.rifeCuda.Checked = true;
this.rifeCuda.CheckState = System.Windows.Forms.CheckState.Checked;
this.rifeCuda.Location = new System.Drawing.Point(12, 203);
this.rifeCuda.Location = new System.Drawing.Point(0, 3);
this.rifeCuda.Margin = new System.Windows.Forms.Padding(0, 3, 6, 3);
this.rifeCuda.Name = "rifeCuda";
this.rifeCuda.Size = new System.Drawing.Size(83, 17);
this.rifeCuda.TabIndex = 95;
@@ -183,7 +186,8 @@ namespace Flowframes.Forms
this.rifeNcnn.AutoSize = true;
this.rifeNcnn.Checked = true;
this.rifeNcnn.CheckState = System.Windows.Forms.CheckState.Checked;
this.rifeNcnn.Location = new System.Drawing.Point(101, 203);
this.rifeNcnn.Location = new System.Drawing.Point(89, 3);
this.rifeNcnn.Margin = new System.Windows.Forms.Padding(0, 3, 6, 3);
this.rifeNcnn.Name = "rifeNcnn";
this.rifeNcnn.Size = new System.Drawing.Size(84, 17);
this.rifeNcnn.TabIndex = 96;
@@ -196,7 +200,8 @@ namespace Flowframes.Forms
this.dainNcnn.AutoSize = true;
this.dainNcnn.Checked = true;
this.dainNcnn.CheckState = System.Windows.Forms.CheckState.Checked;
this.dainNcnn.Location = new System.Drawing.Point(191, 203);
this.dainNcnn.Location = new System.Drawing.Point(179, 3);
this.dainNcnn.Margin = new System.Windows.Forms.Padding(0, 3, 6, 3);
this.dainNcnn.Name = "dainNcnn";
this.dainNcnn.Size = new System.Drawing.Size(86, 17);
this.dainNcnn.TabIndex = 97;
@@ -209,7 +214,8 @@ namespace Flowframes.Forms
this.flavrCuda.AutoSize = true;
this.flavrCuda.Checked = true;
this.flavrCuda.CheckState = System.Windows.Forms.CheckState.Checked;
this.flavrCuda.Location = new System.Drawing.Point(283, 203);
this.flavrCuda.Location = new System.Drawing.Point(271, 3);
this.flavrCuda.Margin = new System.Windows.Forms.Padding(0, 3, 6, 3);
this.flavrCuda.Name = "flavrCuda";
this.flavrCuda.Size = new System.Drawing.Size(93, 17);
this.flavrCuda.TabIndex = 98;
@@ -222,24 +228,33 @@ namespace Flowframes.Forms
this.xvfiCuda.AutoSize = true;
this.xvfiCuda.Checked = true;
this.xvfiCuda.CheckState = System.Windows.Forms.CheckState.Checked;
this.xvfiCuda.Location = new System.Drawing.Point(382, 203);
this.xvfiCuda.Location = new System.Drawing.Point(370, 3);
this.xvfiCuda.Margin = new System.Windows.Forms.Padding(0, 3, 6, 3);
this.xvfiCuda.Name = "xvfiCuda";
this.xvfiCuda.Size = new System.Drawing.Size(82, 17);
this.xvfiCuda.TabIndex = 99;
this.xvfiCuda.Text = "XVFI CUDA";
this.xvfiCuda.UseVisualStyleBackColor = true;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.rifeCuda);
this.flowLayoutPanel1.Controls.Add(this.rifeNcnn);
this.flowLayoutPanel1.Controls.Add(this.dainNcnn);
this.flowLayoutPanel1.Controls.Add(this.flavrCuda);
this.flowLayoutPanel1.Controls.Add(this.xvfiCuda);
this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 204);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(600, 29);
this.flowLayoutPanel1.TabIndex = 100;
//
// ModelDownloadForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32)))));
this.ClientSize = new System.Drawing.Size(624, 301);
this.Controls.Add(this.xvfiCuda);
this.Controls.Add(this.flavrCuda);
this.Controls.Add(this.dainNcnn);
this.Controls.Add(this.rifeNcnn);
this.Controls.Add(this.rifeCuda);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.statusLabel);
this.Controls.Add(this.closeBtn);
this.Controls.Add(this.cancelBtn);
@@ -255,6 +270,8 @@ namespace Flowframes.Forms
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Model Downloader";
this.Load += new System.EventHandler(this.ModelDownloadForm_Load);
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -270,10 +287,11 @@ namespace Flowframes.Forms
private HTAlt.WinForms.HTButton closeBtn;
private HTAlt.WinForms.HTButton cancelBtn;
private System.Windows.Forms.Label statusLabel;
private System.Windows.Forms.CheckBox rifeCuda;
private System.Windows.Forms.CheckBox rifeNcnn;
private System.Windows.Forms.CheckBox dainNcnn;
private System.Windows.Forms.CheckBox flavrCuda;
private System.Windows.Forms.CheckBox xvfiCuda;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
public System.Windows.Forms.CheckBox rifeCuda;
public System.Windows.Forms.CheckBox rifeNcnn;
public System.Windows.Forms.CheckBox dainNcnn;
public System.Windows.Forms.CheckBox flavrCuda;
public System.Windows.Forms.CheckBox xvfiCuda;
}
}

View File

@@ -1,4 +1,5 @@
using Flowframes.MiscUtils;
using Flowframes.Data;
using Flowframes.MiscUtils;
using Microsoft.WindowsAPICodePack.Taskbar;
using System;
using System.Collections.Generic;
@@ -21,7 +22,14 @@ namespace Flowframes.Forms
private void ModelDownloadForm_Load(object sender, EventArgs e)
{
var availImplems = Implementations.NetworksAvailable.Select(ai => ai.NameInternal.Replace("_", "").Lower());
void SetChecked(CheckBox cb)
{
cb.Visible = availImplems.Contains(cb.Name.Lower());
}
new List<Control> { rifeCuda, rifeNcnn, dainNcnn, flavrCuda, xvfiCuda }.ForEach(cb => SetChecked((CheckBox)cb));
}
public void SetWorking(bool state, bool allowCancel = true)
@@ -63,11 +71,11 @@ namespace Flowframes.Forms
private void downloadModelsBtn_Click(object sender, EventArgs e)
{
ModelDownloadFormUtils.form = this;
bool rifeC = rifeCuda.Checked;
bool rifeN = rifeNcnn.Checked;
bool dainN = dainNcnn.Checked;
bool flavrC = flavrCuda.Checked;
bool xvfiC = xvfiCuda.Checked;
bool rifeC = rifeCuda.Visible && rifeCuda.Checked;
bool rifeN = rifeNcnn.Visible && rifeNcnn.Checked;
bool dainN = dainNcnn.Visible && dainNcnn.Checked;
bool flavrC = flavrCuda.Visible && flavrCuda.Checked;
bool xvfiC = xvfiCuda.Visible && xvfiCuda.Checked;
ModelDownloadFormUtils.DownloadModels(rifeC, rifeN, dainN, flavrC, xvfiC);
}

View File

@@ -73,8 +73,6 @@
this.label63 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.keepMeta = new System.Windows.Forms.CheckBox();
this.sceneChangeFillMode = new System.Windows.Forms.ComboBox();
this.label71 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.enableAlpha = new System.Windows.Forms.CheckBox();
this.label25 = new System.Windows.Forms.Label();
@@ -560,8 +558,6 @@
this.tabListPage2.Controls.Add(this.label63);
this.tabListPage2.Controls.Add(this.label18);
this.tabListPage2.Controls.Add(this.keepMeta);
this.tabListPage2.Controls.Add(this.sceneChangeFillMode);
this.tabListPage2.Controls.Add(this.label71);
this.tabListPage2.Controls.Add(this.label4);
this.tabListPage2.Controls.Add(this.enableAlpha);
this.tabListPage2.Controls.Add(this.label25);
@@ -593,7 +589,7 @@
//
// autoEncBlockPanel
//
this.autoEncBlockPanel.Location = new System.Drawing.Point(4, 330);
this.autoEncBlockPanel.Location = new System.Drawing.Point(4, 300);
this.autoEncBlockPanel.Name = "autoEncBlockPanel";
this.autoEncBlockPanel.Size = new System.Drawing.Size(755, 86);
this.autoEncBlockPanel.TabIndex = 94;
@@ -602,7 +598,7 @@
//
this.label70.AutoSize = true;
this.label70.ForeColor = System.Drawing.Color.Silver;
this.label70.Location = new System.Drawing.Point(308, 390);
this.label70.Location = new System.Drawing.Point(308, 360);
this.label70.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
this.label70.Name = "label70";
this.label70.Size = new System.Drawing.Size(443, 13);
@@ -613,7 +609,7 @@
// alwaysWaitForAutoEnc
//
this.alwaysWaitForAutoEnc.AutoSize = true;
this.alwaysWaitForAutoEnc.Location = new System.Drawing.Point(280, 390);
this.alwaysWaitForAutoEnc.Location = new System.Drawing.Point(280, 360);
this.alwaysWaitForAutoEnc.Name = "alwaysWaitForAutoEnc";
this.alwaysWaitForAutoEnc.Size = new System.Drawing.Size(15, 14);
this.alwaysWaitForAutoEnc.TabIndex = 92;
@@ -622,7 +618,7 @@
// label58
//
this.label58.AutoSize = true;
this.label58.Location = new System.Drawing.Point(10, 390);
this.label58.Location = new System.Drawing.Point(10, 360);
this.label58.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
this.label58.Name = "label58";
this.label58.Size = new System.Drawing.Size(229, 13);
@@ -633,7 +629,7 @@
//
this.pictureBox2.BackgroundImage = global::Flowframes.Properties.Resources.questmark_72px_bordeer;
this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pictureBox2.Location = new System.Drawing.Point(536, 357);
this.pictureBox2.Location = new System.Drawing.Point(536, 327);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(29, 21);
this.pictureBox2.TabIndex = 90;
@@ -644,7 +640,7 @@
//
this.label41.AutoSize = true;
this.label41.ForeColor = System.Drawing.Color.Silver;
this.label41.Location = new System.Drawing.Point(578, 360);
this.label41.Location = new System.Drawing.Point(578, 330);
this.label41.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
this.label41.Name = "label41";
this.label41.Size = new System.Drawing.Size(158, 13);
@@ -662,7 +658,7 @@
"Disabled",
"Enabled (Only Video)",
"Enabled (Complete - With Audio, Subtitles)"});
this.autoEncBackupMode.Location = new System.Drawing.Point(280, 357);
this.autoEncBackupMode.Location = new System.Drawing.Point(280, 327);
this.autoEncBackupMode.Name = "autoEncBackupMode";
this.autoEncBackupMode.Size = new System.Drawing.Size(250, 21);
this.autoEncBackupMode.TabIndex = 88;
@@ -670,7 +666,7 @@
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(10, 360);
this.label16.Location = new System.Drawing.Point(10, 330);
this.label16.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(114, 13);
@@ -729,31 +725,6 @@
this.keepMeta.Text = "Keep Metadata (MKV)";
this.keepMeta.UseVisualStyleBackColor = true;
//
// sceneChangeFillMode
//
this.sceneChangeFillMode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.sceneChangeFillMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.sceneChangeFillMode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.sceneChangeFillMode.ForeColor = System.Drawing.Color.White;
this.sceneChangeFillMode.FormattingEnabled = true;
this.sceneChangeFillMode.Items.AddRange(new object[] {
"Basic (Duplicate Previous Frame)",
"Fancy (Blend To Next Scene)"});
this.sceneChangeFillMode.Location = new System.Drawing.Point(280, 267);
this.sceneChangeFillMode.Name = "sceneChangeFillMode";
this.sceneChangeFillMode.Size = new System.Drawing.Size(250, 21);
this.sceneChangeFillMode.TabIndex = 80;
//
// label71
//
this.label71.AutoSize = true;
this.label71.Location = new System.Drawing.Point(10, 270);
this.label71.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
this.label71.Name = "label71";
this.label71.Size = new System.Drawing.Size(124, 13);
this.label71.TabIndex = 79;
this.label71.Text = "Scene Change Fix Mode";
//
// label4
//
this.label4.AutoSize = true;
@@ -827,7 +798,7 @@
// sbsAllowAutoEnc
//
this.sbsAllowAutoEnc.AutoSize = true;
this.sbsAllowAutoEnc.Location = new System.Drawing.Point(280, 330);
this.sbsAllowAutoEnc.Location = new System.Drawing.Point(280, 300);
this.sbsAllowAutoEnc.Name = "sbsAllowAutoEnc";
this.sbsAllowAutoEnc.Size = new System.Drawing.Size(15, 14);
this.sbsAllowAutoEnc.TabIndex = 72;
@@ -846,7 +817,7 @@
// label53
//
this.label53.AutoSize = true;
this.label53.Location = new System.Drawing.Point(10, 330);
this.label53.Location = new System.Drawing.Point(10, 300);
this.label53.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
this.label53.Name = "label53";
this.label53.Size = new System.Drawing.Size(203, 13);
@@ -864,7 +835,7 @@
"Disabled",
"Enabled (Keep Interpolated Frames)",
"Enabled (Delete Frames Once Encoded)"});
this.autoEncMode.Location = new System.Drawing.Point(280, 297);
this.autoEncMode.Location = new System.Drawing.Point(280, 267);
this.autoEncMode.Name = "autoEncMode";
this.autoEncMode.Size = new System.Drawing.Size(250, 21);
this.autoEncMode.TabIndex = 70;
@@ -873,7 +844,7 @@
// label49
//
this.label49.AutoSize = true;
this.label49.Location = new System.Drawing.Point(10, 300);
this.label49.Location = new System.Drawing.Point(10, 270);
this.label49.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
this.label49.Name = "label49";
this.label49.Size = new System.Drawing.Size(206, 13);
@@ -1908,8 +1879,6 @@
private System.Windows.Forms.TextBox exportNamePatternLoop;
private System.Windows.Forms.Label label69;
private System.Windows.Forms.Label label68;
private System.Windows.Forms.ComboBox sceneChangeFillMode;
private System.Windows.Forms.Label label71;
private System.Windows.Forms.Label label73;
private System.Windows.Forms.CheckBox fixOutputDuration;
private System.Windows.Forms.Label label72;

View File

@@ -99,7 +99,7 @@ namespace Flowframes.Forms
ConfigParser.SaveGuiElement(enableLoop);
ConfigParser.SaveGuiElement(scnDetect);
ConfigParser.SaveGuiElement(scnDetectValue);
ConfigParser.SaveComboxIndex(sceneChangeFillMode);
// ConfigParser.SaveComboxIndex(sceneChangeFillMode);
ConfigParser.SaveComboxIndex(autoEncMode);
ConfigParser.SaveComboxIndex(autoEncBackupMode);
ConfigParser.SaveGuiElement(sbsAllowAutoEnc);
@@ -145,7 +145,7 @@ namespace Flowframes.Forms
ConfigParser.LoadGuiElement(enableLoop);
ConfigParser.LoadGuiElement(scnDetect);
ConfigParser.LoadGuiElement(scnDetectValue);
ConfigParser.LoadComboxIndex(sceneChangeFillMode);
// ConfigParser.LoadComboxIndex(sceneChangeFillMode);
ConfigParser.LoadComboxIndex(autoEncMode);
ConfigParser.LoadComboxIndex(autoEncBackupMode);
ConfigParser.LoadGuiElement(sbsAllowAutoEnc);

View File

@@ -117,10 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="pictureBox2.ToolTip" xml:space="preserve">
<value>If this is enabled together with Auto-Encode, a backup video will be created from already encoded chunks, after each chunk has finished encoding.
This causes a minimal CPU load but requires lots of storage bandwidth - It's only recommended to use this on SSDs for longer videos.</value>
</data>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
@@ -139,6 +135,10 @@ This causes a minimal CPU load but requires lots of storage bandwidth - It's onl
The loop suffix gets added if the output gets looped. You can use the following placeholders:
[LOOPS] for how many times it was looped
[PLAYS] for how many times it plays (includes first play, so it's LOOPS+1)</value>
</data>
<data name="pictureBox2.ToolTip" xml:space="preserve">
<value>If this is enabled together with Auto-Encode, a backup video will be created from already encoded chunks, after each chunk has finished encoding.
This causes a minimal CPU load but requires lots of storage bandwidth - It's only recommended to use this on SSDs for longer videos.</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@@ -271,7 +271,7 @@ namespace Flowframes.IO
if (key == Key.keepMeta) return WriteDefault(key, "True");
if (key == Key.scnDetect) return WriteDefault(key, "True");
if (key == Key.scnDetectValue) return WriteDefault(key, "0.2");
if (key == Key.sceneChangeFillMode) return WriteDefault(key, "1");
if (key == Key.sceneChangeFillMode) return WriteDefault(key, "0");
if (key == Key.autoEncMode) return WriteDefault(key, "2");
if (key == Key.jpegFrames) return WriteDefault(key, "True");
// Video Export