Beispiel #1
0
        private void interpConfigureBtn_Click(object sender, EventArgs e)
        {
            if (!PreviewUI.HasValidModelSelection())
            {
                Program.ShowMessage("Please select two models for interpolation.", "Message");
                return;
            }

            AdvancedModelsForm interpForm = new AdvancedModelsForm(model1TreeBtn.Text.Trim(), model2TreeBtn.Text.Trim());

            interpForm.ShowDialog();
        }
Beispiel #2
0
        private async void upscaleBtn_Click(object sender, EventArgs e)
        {
            if (Program.busy)
            {
                return;
            }

            if (!PreviewUI.HasValidModelSelection())
            {
                Program.ShowMessage("Invalid model selection.\nMake sure you have selected a model and that the file still exists.", "Error");
                return;
            }

            bool useNcnn = (Config.Get("cudaFallback").GetInt() == 2 || Config.Get("cudaFallback").GetInt() == 3);

            if (useNcnn && !Program.mainForm.HasValidNcnnModelSelection())
            {
                Program.ShowMessage("Invalid model selection - NCNN does not support interpolation or chaining.", "Error");
                return;
            }

            if (Config.GetBool("reloadImageBeforeUpscale"))
            {
                ReloadImage();
            }

            UpdateResizeMode();
            Program.lastUpscaleIsVideo = htTabControl.SelectedIndex == 2;

            if (htTabControl.SelectedIndex == 0)
            {
                await PreviewUI.UpscaleImage();
            }
            if (htTabControl.SelectedIndex == 1)
            {
                await BatchUpscaleUI.Run(preprocessMode.SelectedIndex == 0, true, batchCacheSplitDepth.SelectedIndex == 1);
            }
            if (htTabControl.SelectedIndex == 2)
            {
                await VideoUpscaleUI.Run(videoPreprocessMode.SelectedIndex == 0);
            }
        }