diff --git a/.editorconfig b/.editorconfig index b6242a2..2010ab3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -35,3 +35,6 @@ dotnet_diagnostic.CA1806.severity = none # CS4014: Так как этот вызов не ожидается, выполнение существующего метода продолжается до тех пор, пока вызов не будет завершен dotnet_diagnostic.CS4014.severity = none + +# SYSLIB0014: Тип или член устарел +dotnet_diagnostic.SYSLIB0014.severity = none diff --git a/data/repo/diffusion_scripts/sd_xbackend.py b/data/repo/diffusion_scripts/sd_xbackend.py index 65ce080..84366fc 100644 --- a/data/repo/diffusion_scripts/sd_xbackend.py +++ b/data/repo/diffusion_scripts/sd_xbackend.py @@ -396,40 +396,40 @@ def MakeImage(self, pipe, mode : str, eta, prompt, prompt_neg, steps, width, hei def ApplyArg(parser): parser.add_argument( - "--model", type=str, help="Path to model checkpoint file", dest='mdlpath', + "--model", type=str, help="Path to model checkpoint (.ckpt or .safetensors)", dest='mdlpath', ) parser.add_argument( - "--workdir", default=None, type=str, help="Path to model checkpoint file", dest='workdir', + "--workdir", default=None, type=str, help="Path to working directory", dest='workdir', ) parser.add_argument( - "--width", type=int, help="Path to model checkpoint file", dest='width', + "--width", type=int, help="Image width", dest='width', ) parser.add_argument( - "--guidance_scale", type=float, help="Path to model checkpoint file", dest='guidance_scale', + "--guidance_scale", type=float, help="guidance scale or CFG scale", dest='guidance_scale', ) parser.add_argument( - "--height", type=int, help="Path to model checkpoint file", dest='height', + "--height", type=int, help="Image Height", dest='height', ) parser.add_argument( "--totalcount", - type=int, help="Path to model checkpoint file", dest='totalcount', + type=int, help="total images", dest='totalcount', ) parser.add_argument( "--steps", - type=int, help="Path to model checkpoint file", dest='steps', + type=int, help="scheduller steps per image", dest='steps', ) parser.add_argument( - "--seed", type=int, help="Path to model checkpoint file", dest='seed', + "--seed", type=int, help="random seed", dest='seed', ) parser.add_argument( "--imgscale", - type=float, default=0.44, help="Path to model checkpoint file", dest='imgscale', + type=float, default=0.44, help="no description", dest='imgscale', ) parser.add_argument( - "--prompt_neg", type=str, help="Path to model checkpoint file", dest='prompt_neg', + "--prompt_neg", type=str, help="negative prompt", dest='prompt_neg', ) parser.add_argument( - "--prompt", type=str, help="Path to model checkpoint file", dest='prompt', + "--prompt", type=str, help="prompt", dest='prompt', ) parser.add_argument( "--outpath", @@ -481,10 +481,10 @@ def ApplyArg(parser): "--hypernetwork", type=str, help="hypernetwork path", dest='hypernetwork', default=None, ) parser.add_argument( - "--cn_model", type=str, help="Path to model checkpoint file", dest='cn_model', + "--cn_model", type=str, help="controlnet model path", dest='cn_model', ) parser.add_argument( - "--outfile", type=str, default="", help="Specify generation mode", dest='outfile', + "--outfile", type=str, default="", help="specify generation mode", dest='outfile', ) parser.add_argument( "--pose", type=str, default="", help="input pose image", dest='pose', diff --git a/ui-src/Debug/Dumper.cs b/ui-src/Debug/Dumper.cs index 4d09bf6..0ae1aa5 100644 --- a/ui-src/Debug/Dumper.cs +++ b/ui-src/Debug/Dumper.cs @@ -1,4 +1,5 @@ -using System; +using SD_FXUI.Debug; +using System; using System.Diagnostics; using System.IO; using System.Reflection; @@ -87,8 +88,18 @@ public static bool WriteDump( } public static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { - //System.Windows.Forms.MessageBox.Show("Unhandled exception!"); - Notification.MsgBox(e.ExceptionObject.ToString()); + string CallStack = e.ExceptionObject.ToString(); + + try + { + Log.SendMessageToFile(CallStack); + } + catch + { + // So sad... + } + + Notification.MsgBox(CallStack); WriteDump(); } diff --git a/ui-src/GlobalSuppressions.cs b/ui-src/GlobalSuppressions.cs new file mode 100644 index 0000000..44f4972 --- /dev/null +++ b/ui-src/GlobalSuppressions.cs @@ -0,0 +1,8 @@ +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Style", "IDE0044:Добавить модификатор только для чтения", Justification = "<Ожидание>", Scope = "member", Target = "~F:SD_FXUI.Utils.FileDownloader.Client")] diff --git a/ui-src/Utils/CMD.cs b/ui-src/Utils/CMD.cs index 29ad1ee..002088e 100644 --- a/ui-src/Utils/CMD.cs +++ b/ui-src/Utils/CMD.cs @@ -250,14 +250,14 @@ public static async Task UpscalerRunner(int Size, string File) Host.Print("\n Startup upscale..... \n"); string OutFile = File.Substring(0, File.Length - 4) + "_upscale.png"; - ProcessHost.Start("-i " + File + " -o " + OutFile + DopCmd); + ProcessHost.Start("-i \"" + File + "\" -o \"" + OutFile + "\"" + DopCmd); ProcessHost.Wait(); if (Helper.EnableGFPGAN) { Host ProcesHostTwo = new Host(FS.GetModelDir(), FileName); OutFile = NewFile.Substring(0, NewFile.Length - 4) + "_upscale.png"; - ProcesHostTwo.Start("-i " + NewFile + " -o " + OutFile + DopCmd); + ProcesHostTwo.Start("-i \"" + NewFile + "\" -o \"" + OutFile + "\"" + DopCmd); ProcesHostTwo.Wait(); Helper.Form.UpdateViewImg(OutFile); } diff --git a/ui-src/Utils/Downloader.cs b/ui-src/Utils/Downloader.cs index c2367bc..f2bf27d 100644 --- a/ui-src/Utils/Downloader.cs +++ b/ui-src/Utils/Downloader.cs @@ -64,7 +64,7 @@ private static void OnDownloadProgressChanged(object sender, DownloadProgressCha } - private static void OnDownloadFileCompleted(object sender, AsyncCompletedEventArgs e) + private static void OnDownloadFileCompleted(object? sender, AsyncCompletedEventArgs e) { PreviousProgress = 0; TaskCompleted = true; diff --git a/ui-src/Utils/Helper/HelperControlNet.cs b/ui-src/Utils/Helper/HelperControlNet.cs index 24c8a69..1d84152 100644 --- a/ui-src/Utils/Helper/HelperControlNet.cs +++ b/ui-src/Utils/Helper/HelperControlNet.cs @@ -10,8 +10,8 @@ namespace SD_FXUI { class ControlNetBase { - protected string Model; - protected string CNModel; + protected string Model = ""; + protected string CNModel = ""; protected string BaseOutPath = FS.GetModelDir() + "controlnet/gen/"; public string GetModelPathSD() diff --git a/ui-src/Utils/Models/ModelImporter.xaml.cs b/ui-src/Utils/Models/ModelImporter.xaml.cs index 33ce575..959fba0 100644 --- a/ui-src/Utils/Models/ModelImporter.xaml.cs +++ b/ui-src/Utils/Models/ModelImporter.xaml.cs @@ -9,6 +9,8 @@ namespace SD_FXUI.Utils /// public partial class SharkModelImporter : Window { + string SwapText = "Enter the path to the file (.ckpt/.safetensors/.pt) or folder (diffusers)"; + public SharkModelImporter() { InitializeComponent(); @@ -16,7 +18,9 @@ public SharkModelImporter() cbFrom.SelectedIndex = 0; cbTo.SelectedIndex = 0; cbBaseModel.SelectedIndex = 0; + cbPath.Text = SwapText; } + bool PresetIs768() { return cbBaseModel.Text.Contains("768"); @@ -217,12 +221,12 @@ private void Grid_DragEnter(object sender, DragEventArgs e) private void cbPathLost(object sender, RoutedEventArgs e) { if (cbPath.Text == "") - cbPath.Text = "Set your dir/url"; + cbPath.Text = SwapText; } private void cbPathSet(object sender, RoutedEventArgs e) { - if (cbPath.Text == "Set your dir/url") + if (cbPath.Text == SwapText) cbPath.Text = ""; } }