private async void upscaleBtn_Click(object sender, EventArgs e) { if (Program.busy) { return; } if (!MainUIHelper.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(); if (htTabControl.SelectedIndex == 0) { await MainUIHelper.UpscaleImage(); } if (htTabControl.SelectedIndex == 1) { await BatchUpscaleUI.Run(preprocessMode.SelectedIndex == 0); } }
private void interpConfigureBtn_Click(object sender, EventArgs e) { if (!MainUIHelper.HasValidModelSelection()) { Program.ShowMessage("Please select two models for interpolation.", "Message"); return; } AdvancedModelsForm interpForm = new AdvancedModelsForm(model1TreeBtn.Text.Trim(), model2TreeBtn.Text.Trim()); interpForm.ShowDialog(); }