├── dlls ├── Toaster.dll ├── FormPager.dll ├── ConsoleControl.dll └── ConsoleControlCommon.dll ├── SDLauncher ├── runtimes.zip ├── ic_avator.ico ├── FodyWeavers.xml ├── App.config ├── Properties │ ├── Settings.settings │ ├── AssemblyInfo.cs │ ├── Settings.Designer.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── packages.config ├── Program.cs ├── Form1.resx ├── FodyWeavers.xsd ├── SDLauncher.csproj ├── Form1.cs └── Form1.Designer.cs ├── README.md ├── LICENSE ├── SDLauncher.sln └── .gitignore /dlls/Toaster.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYFDroid/stable-diffusion-webui-launcher/HEAD/dlls/Toaster.dll -------------------------------------------------------------------------------- /dlls/FormPager.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYFDroid/stable-diffusion-webui-launcher/HEAD/dlls/FormPager.dll -------------------------------------------------------------------------------- /SDLauncher/runtimes.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYFDroid/stable-diffusion-webui-launcher/HEAD/SDLauncher/runtimes.zip -------------------------------------------------------------------------------- /dlls/ConsoleControl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYFDroid/stable-diffusion-webui-launcher/HEAD/dlls/ConsoleControl.dll -------------------------------------------------------------------------------- /SDLauncher/ic_avator.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYFDroid/stable-diffusion-webui-launcher/HEAD/SDLauncher/ic_avator.ico -------------------------------------------------------------------------------- /dlls/ConsoleControlCommon.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYFDroid/stable-diffusion-webui-launcher/HEAD/dlls/ConsoleControlCommon.dll -------------------------------------------------------------------------------- /SDLauncher/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /SDLauncher/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stable diffusion webui Launcher 2 | 3 | 非常简单的Stable Diffusion WebUI启动器 4 | 5 | 使用方法:将stable-diffusion-webui 放在程序所在目录,然后双击启动即可 6 | 7 | 当前功能: 8 | 9 | - 控制台和web界面互相切换显示 10 | 11 | - 退出确认 12 | 13 | - 快速打开模型目录和输出目录 14 | 15 | - 一键重启后端 16 | 17 | - (更改启动参数的功能还没写) 18 | -------------------------------------------------------------------------------- /SDLauncher/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SDLauncher/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SDLauncher/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("SDLauncher")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SDLauncher")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("c7894b09-3221-4efa-a56b-966bd8e20056")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 ZYFDroid 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /SDLauncher.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.5.33103.201 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDLauncher", "SDLauncher\SDLauncher.csproj", "{C7894B09-3221-4EFA-A56B-966BD8E20056}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C7894B09-3221-4EFA-A56B-966BD8E20056}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {C7894B09-3221-4EFA-A56B-966BD8E20056}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {C7894B09-3221-4EFA-A56B-966BD8E20056}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {C7894B09-3221-4EFA-A56B-966BD8E20056}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {1FE9E20A-04B9-444D-8B4E-C60701CA0AAD} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SDLauncher/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SDLauncher.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SDLauncher/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SDLauncher.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SDLauncher.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 重写当前线程的 CurrentUICulture 属性,对 51 | /// 使用此强类型资源类的所有资源查找执行重写。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// 查找 System.Byte[] 类型的本地化资源。 65 | /// 66 | internal static byte[] webviewRuntimeBinary { 67 | get { 68 | object obj = ResourceManager.GetObject("webviewRuntimeBinary", resourceCulture); 69 | return ((byte[])(obj)); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /SDLauncher/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Web.WebView2.Core; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.IO.Compression; 6 | using System.Linq; 7 | using System.Net; 8 | using System.Net.Sockets; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace SDLauncher 13 | { 14 | internal static class Program 15 | { 16 | /// 17 | /// 应用程序的主入口点。 18 | /// 19 | /// 20 | 21 | public static int AvailablePort = 32409; 22 | 23 | [STAThread] 24 | static void Main() 25 | { 26 | PrepareWebview2RuntimeEnvironment(); 27 | FindAvailablePorts(); 28 | if(AvailablePort < 0) 29 | { 30 | return; 31 | } 32 | Application.EnableVisualStyles(); 33 | Application.SetCompatibleTextRenderingDefault(false); 34 | Application.Run(new Form1()); 35 | } 36 | 37 | private static void FindAvailablePorts() 38 | { 39 | int count = 0; 40 | Random rnd = new Random(); 41 | while(!IsPortAvailable(AvailablePort)) 42 | { 43 | AvailablePort = rnd.Next(32000, 38999); 44 | count++; 45 | if(count > 1024) 46 | { 47 | MessageBox.Show("启动失败,没有可用的端口(你是怎么做到的)"); 48 | AvailablePort = -1; 49 | return; 50 | } 51 | } 52 | } 53 | 54 | private static bool IsPortAvailable(int port) 55 | { 56 | try 57 | { 58 | var x = new TcpListener(IPAddress.Loopback, port); 59 | x.Start(); 60 | x.Stop(); 61 | return true; 62 | } 63 | catch(Exception ex) { 64 | return false; 65 | } 66 | } 67 | 68 | private static void PrepareWebview2RuntimeEnvironment() 69 | { 70 | string baseDir = Path.Combine(Environment.GetEnvironmentVariable("LOCALAPPDATA"),"SDWebuiLauncher","wvruntime_0"); 71 | if(!Directory.Exists(baseDir)) {Directory.CreateDirectory(baseDir);} 72 | string flagFile = Path.Combine(baseDir, "runtime.ok"); 73 | if(!File.Exists(flagFile)) 74 | { 75 | using (ZipArchive zipArchive = new ZipArchive(new MemoryStream(Properties.Resources.webviewRuntimeBinary), ZipArchiveMode.Read, false)) 76 | { 77 | foreach (var item in zipArchive.Entries) 78 | { 79 | if (item.FullName.EndsWith("/")) 80 | { 81 | 82 | } 83 | else 84 | { 85 | string fileName = Path.Combine(baseDir, item.FullName); 86 | string fileDir = Path.GetDirectoryName(fileName); 87 | if (!Directory.Exists(fileDir)) { Directory.CreateDirectory(fileDir); } 88 | using(FileStream fs = File.Create(fileName)) 89 | { 90 | using(Stream s = item.Open()) 91 | { 92 | s.CopyTo(fs); 93 | } 94 | } 95 | } 96 | } 97 | File.Create(flagFile).Close(); 98 | } 99 | 100 | } 101 | 102 | if (Environment.Is64BitProcess) 103 | { 104 | CoreWebView2Environment.SetLoaderDllFolderPath(Path.Combine(baseDir, "runtimes", "win-x64", "native")); 105 | } 106 | else 107 | { 108 | 109 | CoreWebView2Environment.SetLoaderDllFolderPath(Path.Combine(baseDir, "runtimes", "win-x86", "native")); 110 | } 111 | 112 | } 113 | 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /SDLauncher/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\runtimes.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 123 | 124 | -------------------------------------------------------------------------------- /SDLauncher/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 294, 17 125 | 126 | -------------------------------------------------------------------------------- /SDLauncher/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks 13 | 14 | 15 | 16 | 17 | A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. 18 | 19 | 20 | 21 | 22 | A list of unmanaged 32 bit assembly names to include, delimited with line breaks. 23 | 24 | 25 | 26 | 27 | A list of unmanaged 64 bit assembly names to include, delimited with line breaks. 28 | 29 | 30 | 31 | 32 | The order of preloaded assemblies, delimited with line breaks. 33 | 34 | 35 | 36 | 37 | 38 | This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. 39 | 40 | 41 | 42 | 43 | Controls if .pdbs for reference assemblies are also embedded. 44 | 45 | 46 | 47 | 48 | Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. 49 | 50 | 51 | 52 | 53 | As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. 54 | 55 | 56 | 57 | 58 | Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. 59 | 60 | 61 | 62 | 63 | Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. 64 | 65 | 66 | 67 | 68 | A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | 69 | 70 | 71 | 72 | 73 | A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. 74 | 75 | 76 | 77 | 78 | A list of unmanaged 32 bit assembly names to include, delimited with |. 79 | 80 | 81 | 82 | 83 | A list of unmanaged 64 bit assembly names to include, delimited with |. 84 | 85 | 86 | 87 | 88 | The order of preloaded assemblies, delimited with |. 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 97 | 98 | 99 | 100 | 101 | A comma-separated list of error codes that can be safely ignored in assembly verification. 102 | 103 | 104 | 105 | 106 | 'false' to turn off automatic generation of the XML Schema file. 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /SDLauncher/SDLauncher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {C7894B09-3221-4EFA-A56B-966BD8E20056} 9 | WinExe 10 | SDLauncher 11 | SDLauncher 12 | v4.5.2 13 | 512 14 | true 15 | true 16 | 17 | 18 | 19 | 20 | AnyCPU 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | false 29 | 30 | 31 | AnyCPU 32 | pdbonly 33 | true 34 | bin\Release\ 35 | TRACE 36 | prompt 37 | 4 38 | 39 | 40 | ic_avator.ico 41 | 42 | 43 | 44 | ..\dlls\ConsoleControl.dll 45 | 46 | 47 | ..\dlls\ConsoleControlCommon.dll 48 | 49 | 50 | ..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll 51 | 52 | 53 | ..\dlls\FormPager.dll 54 | 55 | 56 | ..\packages\Microsoft.Web.WebView2.1.0.1418.22\lib\net45\Microsoft.Web.WebView2.Core.dll 57 | 58 | 59 | ..\packages\Microsoft.Web.WebView2.1.0.1418.22\lib\net45\Microsoft.Web.WebView2.WinForms.dll 60 | 61 | 62 | ..\packages\Microsoft.Web.WebView2.1.0.1418.22\lib\net45\Microsoft.Web.WebView2.Wpf.dll 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | ..\dlls\Toaster.dll 78 | 79 | 80 | 81 | 82 | Form 83 | 84 | 85 | Form1.cs 86 | 87 | 88 | 89 | 90 | Form1.cs 91 | 92 | 93 | ResXFileCodeGenerator 94 | Resources.Designer.cs 95 | Designer 96 | 97 | 98 | True 99 | Resources.resx 100 | True 101 | 102 | 103 | 104 | SettingsSingleFileGenerator 105 | Settings.Designer.cs 106 | 107 | 108 | True 109 | Settings.settings 110 | True 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 125 | 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /SDLauncher/Form1.cs: -------------------------------------------------------------------------------- 1 | using ConsoleControlCommon; 2 | using Microsoft.Web.WebView2.Core; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using System.Drawing; 9 | using System.IO; 10 | using System.Linq; 11 | using System.Net; 12 | using System.Net.Sockets; 13 | using System.Reflection; 14 | using System.Text; 15 | using System.Threading.Tasks; 16 | using System.Windows.Forms; 17 | 18 | namespace SDLauncher 19 | { 20 | public partial class Form1 : Form 21 | { 22 | public Form1() 23 | { 24 | InitializeComponent(); 25 | this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); 26 | } 27 | 28 | private void Form1_Load(object sender, EventArgs e) 29 | { 30 | string webviewDataPath = Path.Combine(Environment.GetEnvironmentVariable("LOCALAPPDATA"), "SDWebuiLauncher", "WebViewData"); ; 31 | Task createEnvTask = CoreWebView2Environment.CreateAsync(userDataFolder: webviewDataPath); 32 | createEnvTask.Wait(); 33 | CoreWebView2Environment env = createEnvTask.Result; 34 | webView.CoreWebView2InitializationCompleted += WebView_CoreWebView2InitializationCompleted; 35 | webView.EnsureCoreWebView2Async(env); 36 | } 37 | 38 | private void WebView_CoreWebView2InitializationCompleted(object sender, CoreWebView2InitializationCompletedEventArgs e) 39 | { 40 | if (!e.IsSuccess) 41 | { 42 | MessageBox.Show("未安装 WebView2 组件"); 43 | Environment.Exit(-1); 44 | } 45 | else 46 | { 47 | webView.CoreWebView2.Navigate("about:blank"); 48 | StartServer(customArgs); 49 | initWebView2(); 50 | } 51 | } 52 | void initWebView2() 53 | { 54 | webView.CoreWebView2.Settings.IsSwipeNavigationEnabled = false; 55 | } 56 | private void mnuShowConsole_Click(object sender, EventArgs e) 57 | { 58 | if(tblMain.SelectedPage == pageWebView) 59 | { 60 | 61 | tblMain.SelectedPage = pageConsole; 62 | } 63 | else 64 | { 65 | 66 | tblMain.SelectedPage = pageWebView; 67 | } 68 | } 69 | 70 | 71 | private void 刷新ToolStripMenuItem_Click(object sender, EventArgs e) 72 | { 73 | if(!confirm("是否刷新 WebUI 页面? 现有的任务不会中止,您可以在控制台中查看进度,并稍后于 WebUI 的图库浏览器中查看结果。")) 74 | { 75 | return; 76 | } 77 | webView.CoreWebView2?.Reload(); 78 | 79 | } 80 | 81 | private bool confirm(string msg) 82 | { 83 | return MessageBox.Show(msg,Text,MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes; 84 | } 85 | 86 | private void mnuLaunch_Click(object sender, EventArgs e) 87 | { 88 | StartServer(customArgs); 89 | } 90 | 91 | private void mnuRelaunch_Click(object sender, EventArgs e) 92 | { 93 | if (!confirm("是否重启?当前正在进行的任务会丢失。")) 94 | { 95 | return; 96 | } 97 | shouldRelaunch = true; 98 | StopServer(); 99 | } 100 | 101 | private void mnuSetArgs_Click(object sender, EventArgs e) 102 | { 103 | 104 | } 105 | 106 | // --medvram --xformers --deepdanbooru 107 | // --port xxx 108 | 109 | string defaultBaseArgs = "--deepdanbooru "; 110 | string customArgs = "--medvram --xformers --max-batch-count 50 "; 111 | 112 | private void StartServer(string args) 113 | { 114 | string finalArgs = defaultBaseArgs + args + "--port " + Program.AvailablePort; 115 | ConsoleStartArgs consoleStartArgs = new ConsoleStartArgs(); 116 | string basedir = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "stable-diffusion-webui"); 117 | string pythonExe = Path.Combine(basedir, "python", "python.exe"); 118 | consoleStartArgs.WorkingDirectory = basedir; 119 | consoleStartArgs.FileName = pythonExe; 120 | consoleStartArgs.Arguments = "webui.py " + finalArgs; 121 | consoleControl.StartConsole(consoleStartArgs); 122 | if (!checkWebuiWorker.IsBusy) 123 | { 124 | checkWebuiWorker.RunWorkerAsync(); 125 | } 126 | } 127 | 128 | private void StopServer() { 129 | consoleControl.SendControlC(); 130 | if (checkWebuiWorker.IsBusy) 131 | { 132 | checkWebuiWorker.CancelAsync(); 133 | } 134 | } 135 | 136 | bool shouldRelaunch = false; 137 | private void consoleControl_ConsoleExited(object sender, EventArgs e) 138 | { 139 | if(shouldRelaunch) 140 | { 141 | shouldRelaunch = false; 142 | StartServer(customArgs); 143 | } 144 | } 145 | 146 | int MsgWebuiOk = 34; 147 | 148 | 149 | 150 | private void checkWebuiWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) 151 | { 152 | 153 | } 154 | 155 | private void checkWebuiWorker_DoWork(object sender, DoWorkEventArgs e) 156 | { 157 | while (!e.Cancel) 158 | { 159 | Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); 160 | 161 | try 162 | { 163 | client.Connect(IPAddress.Loopback, Program.AvailablePort); 164 | client.Close(); 165 | client.Dispose(); 166 | checkWebuiWorker.ReportProgress(MsgWebuiOk); 167 | return; 168 | }catch(Exception ex) 169 | { 170 | 171 | } 172 | } 173 | } 174 | 175 | bool loadedWebContent = false; 176 | 177 | private void checkWebuiWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) 178 | { 179 | if(e.ProgressPercentage == MsgWebuiOk) 180 | { 181 | tblMain.SelectedPage = pageWebView; 182 | if (!loadedWebContent) 183 | { 184 | loadedWebContent = true; 185 | webView.CoreWebView2.Navigate("http://localhost:" + Program.AvailablePort); 186 | } 187 | 188 | } 189 | } 190 | 191 | private void mnuExit_Click(object sender, EventArgs e) 192 | { 193 | Close(); 194 | } 195 | 196 | private void Form1_FormClosing(object sender, FormClosingEventArgs e) 197 | { 198 | if (e.CloseReason == CloseReason.UserClosing || e.CloseReason == CloseReason.None || e.CloseReason == CloseReason.MdiFormClosing) 199 | { 200 | e.Cancel = true; 201 | if (confirm("是否退出?")) 202 | { 203 | e.Cancel = false; 204 | consoleControl.ForceCloseConsole(); 205 | } 206 | } 207 | } 208 | 209 | private void 打开模型目录ToolStripMenuItem_Click(object sender, EventArgs e) 210 | { 211 | string basedir = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "stable-diffusion-webui"); 212 | Process.Start("explorer","\""+Path.Combine(basedir, "models")); 213 | } 214 | 215 | private void 打开输出目录ToolStripMenuItem_Click(object sender, EventArgs e) 216 | { 217 | string basedir = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "stable-diffusion-webui"); 218 | Process.Start("explorer", "\"" + Path.Combine(basedir, "outputs")); 219 | } 220 | 221 | private void tblMain_SelectedPageChanged(object sender, EventArgs e) 222 | { 223 | if(tblMain.SelectedPage == pageWebView) 224 | { 225 | mnuSwitchConsole.Text = "显示控制台"; 226 | 227 | } 228 | else 229 | { 230 | mnuSwitchConsole.Text = "显示 WebUI"; 231 | } 232 | } 233 | } 234 | } 235 | -------------------------------------------------------------------------------- /SDLauncher/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace SDLauncher 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 false。 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows 窗体设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要修改 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.menuStrip1 = new System.Windows.Forms.MenuStrip(); 32 | this.启动ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 33 | this.mnuLaunch = new System.Windows.Forms.ToolStripMenuItem(); 34 | this.mnuSetArgs = new System.Windows.Forms.ToolStripMenuItem(); 35 | this.mnuRelaunch = new System.Windows.Forms.ToolStripMenuItem(); 36 | this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); 37 | this.mnuRefresh = new System.Windows.Forms.ToolStripMenuItem(); 38 | this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); 39 | this.mnuExit = new System.Windows.Forms.ToolStripMenuItem(); 40 | this.mnuSwitchConsole = new System.Windows.Forms.ToolStripMenuItem(); 41 | this.mnuOpenDir = new System.Windows.Forms.ToolStripMenuItem(); 42 | this.打开模型目录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 43 | this.打开输出目录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 44 | this.tblMain = new Creek.UI.MultiPanel.MultiPaneControl(); 45 | this.pageConsole = new Creek.UI.MultiPanel.MultiPanePage(); 46 | this.consoleControl = new ConsoleControl.ConsoleControl(); 47 | this.pageWebView = new Creek.UI.MultiPanel.MultiPanePage(); 48 | this.webView = new Microsoft.Web.WebView2.WinForms.WebView2(); 49 | this.checkWebuiWorker = new System.ComponentModel.BackgroundWorker(); 50 | this.menuStrip1.SuspendLayout(); 51 | this.tblMain.SuspendLayout(); 52 | this.pageConsole.SuspendLayout(); 53 | this.pageWebView.SuspendLayout(); 54 | ((System.ComponentModel.ISupportInitialize)(this.webView)).BeginInit(); 55 | this.SuspendLayout(); 56 | // 57 | // menuStrip1 58 | // 59 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 60 | this.启动ToolStripMenuItem, 61 | this.mnuSwitchConsole, 62 | this.mnuOpenDir}); 63 | this.menuStrip1.Location = new System.Drawing.Point(0, 0); 64 | this.menuStrip1.Name = "menuStrip1"; 65 | this.menuStrip1.Size = new System.Drawing.Size(1360, 25); 66 | this.menuStrip1.TabIndex = 0; 67 | this.menuStrip1.Text = "menuStrip1"; 68 | // 69 | // 启动ToolStripMenuItem 70 | // 71 | this.启动ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 72 | this.mnuLaunch, 73 | this.mnuSetArgs, 74 | this.mnuRelaunch, 75 | this.toolStripSeparator2, 76 | this.mnuRefresh, 77 | this.toolStripSeparator1, 78 | this.mnuExit}); 79 | this.启动ToolStripMenuItem.Name = "启动ToolStripMenuItem"; 80 | this.启动ToolStripMenuItem.Size = new System.Drawing.Size(44, 21); 81 | this.启动ToolStripMenuItem.Text = "启动"; 82 | // 83 | // mnuLaunch 84 | // 85 | this.mnuLaunch.Name = "mnuLaunch"; 86 | this.mnuLaunch.Size = new System.Drawing.Size(172, 22); 87 | this.mnuLaunch.Text = "启动"; 88 | this.mnuLaunch.Click += new System.EventHandler(this.mnuLaunch_Click); 89 | // 90 | // mnuSetArgs 91 | // 92 | this.mnuSetArgs.Name = "mnuSetArgs"; 93 | this.mnuSetArgs.Size = new System.Drawing.Size(172, 22); 94 | this.mnuSetArgs.Text = "设置启动参数"; 95 | this.mnuSetArgs.Click += new System.EventHandler(this.mnuSetArgs_Click); 96 | // 97 | // mnuRelaunch 98 | // 99 | this.mnuRelaunch.Name = "mnuRelaunch"; 100 | this.mnuRelaunch.Size = new System.Drawing.Size(172, 22); 101 | this.mnuRelaunch.Text = "重启"; 102 | this.mnuRelaunch.Click += new System.EventHandler(this.mnuRelaunch_Click); 103 | // 104 | // toolStripSeparator2 105 | // 106 | this.toolStripSeparator2.Name = "toolStripSeparator2"; 107 | this.toolStripSeparator2.Size = new System.Drawing.Size(169, 6); 108 | // 109 | // mnuRefresh 110 | // 111 | this.mnuRefresh.Name = "mnuRefresh"; 112 | this.mnuRefresh.Size = new System.Drawing.Size(172, 22); 113 | this.mnuRefresh.Text = "刷新 WebUI 页面"; 114 | this.mnuRefresh.Click += new System.EventHandler(this.刷新ToolStripMenuItem_Click); 115 | // 116 | // toolStripSeparator1 117 | // 118 | this.toolStripSeparator1.Name = "toolStripSeparator1"; 119 | this.toolStripSeparator1.Size = new System.Drawing.Size(169, 6); 120 | // 121 | // mnuExit 122 | // 123 | this.mnuExit.Name = "mnuExit"; 124 | this.mnuExit.Size = new System.Drawing.Size(172, 22); 125 | this.mnuExit.Text = "退出"; 126 | this.mnuExit.Click += new System.EventHandler(this.mnuExit_Click); 127 | // 128 | // mnuSwitchConsole 129 | // 130 | this.mnuSwitchConsole.Name = "mnuSwitchConsole"; 131 | this.mnuSwitchConsole.Size = new System.Drawing.Size(88, 21); 132 | this.mnuSwitchConsole.Text = "显示 WebUI"; 133 | this.mnuSwitchConsole.Click += new System.EventHandler(this.mnuShowConsole_Click); 134 | // 135 | // mnuOpenDir 136 | // 137 | this.mnuOpenDir.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 138 | this.打开模型目录ToolStripMenuItem, 139 | this.打开输出目录ToolStripMenuItem}); 140 | this.mnuOpenDir.Name = "mnuOpenDir"; 141 | this.mnuOpenDir.Size = new System.Drawing.Size(53, 21); 142 | this.mnuOpenDir.Text = "浏览..."; 143 | // 144 | // 打开模型目录ToolStripMenuItem 145 | // 146 | this.打开模型目录ToolStripMenuItem.Name = "打开模型目录ToolStripMenuItem"; 147 | this.打开模型目录ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); 148 | this.打开模型目录ToolStripMenuItem.Text = "打开模型目录"; 149 | this.打开模型目录ToolStripMenuItem.Click += new System.EventHandler(this.打开模型目录ToolStripMenuItem_Click); 150 | // 151 | // 打开输出目录ToolStripMenuItem 152 | // 153 | this.打开输出目录ToolStripMenuItem.Name = "打开输出目录ToolStripMenuItem"; 154 | this.打开输出目录ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); 155 | this.打开输出目录ToolStripMenuItem.Text = "打开输出目录"; 156 | this.打开输出目录ToolStripMenuItem.Click += new System.EventHandler(this.打开输出目录ToolStripMenuItem_Click); 157 | // 158 | // tblMain 159 | // 160 | this.tblMain.BackColor = System.Drawing.Color.Transparent; 161 | this.tblMain.Controls.Add(this.pageConsole); 162 | this.tblMain.Controls.Add(this.pageWebView); 163 | this.tblMain.Dock = System.Windows.Forms.DockStyle.Fill; 164 | this.tblMain.Location = new System.Drawing.Point(0, 25); 165 | this.tblMain.Name = "tblMain"; 166 | this.tblMain.SelectedPage = this.pageConsole; 167 | this.tblMain.Size = new System.Drawing.Size(1360, 767); 168 | this.tblMain.TabIndex = 1; 169 | this.tblMain.Text = "multiPaneControl1"; 170 | this.tblMain.SelectedPageChanged += new System.EventHandler(this.tblMain_SelectedPageChanged); 171 | // 172 | // pageConsole 173 | // 174 | this.pageConsole.Controls.Add(this.consoleControl); 175 | this.pageConsole.Name = "pageConsole"; 176 | this.pageConsole.Size = new System.Drawing.Size(1360, 767); 177 | this.pageConsole.TabIndex = 0; 178 | // 179 | // consoleControl 180 | // 181 | this.consoleControl.BackColor = System.Drawing.Color.Black; 182 | this.consoleControl.Dock = System.Windows.Forms.DockStyle.Fill; 183 | this.consoleControl.Location = new System.Drawing.Point(0, 0); 184 | this.consoleControl.Name = "consoleControl"; 185 | this.consoleControl.Size = new System.Drawing.Size(1360, 767); 186 | this.consoleControl.TabIndex = 0; 187 | this.consoleControl.ConsoleExited += new System.EventHandler(this.consoleControl_ConsoleExited); 188 | // 189 | // pageWebView 190 | // 191 | this.pageWebView.Controls.Add(this.webView); 192 | this.pageWebView.Name = "pageWebView"; 193 | this.pageWebView.Size = new System.Drawing.Size(1360, 767); 194 | this.pageWebView.TabIndex = 1; 195 | // 196 | // webView 197 | // 198 | this.webView.AllowExternalDrop = true; 199 | this.webView.CreationProperties = null; 200 | this.webView.DefaultBackgroundColor = System.Drawing.Color.White; 201 | this.webView.Dock = System.Windows.Forms.DockStyle.Fill; 202 | this.webView.Location = new System.Drawing.Point(0, 0); 203 | this.webView.Name = "webView"; 204 | this.webView.Size = new System.Drawing.Size(1360, 767); 205 | this.webView.TabIndex = 0; 206 | this.webView.ZoomFactor = 1D; 207 | // 208 | // checkWebuiWorker 209 | // 210 | this.checkWebuiWorker.WorkerReportsProgress = true; 211 | this.checkWebuiWorker.WorkerSupportsCancellation = true; 212 | this.checkWebuiWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.checkWebuiWorker_DoWork); 213 | this.checkWebuiWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.checkWebuiWorker_ProgressChanged); 214 | this.checkWebuiWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.checkWebuiWorker_RunWorkerCompleted); 215 | // 216 | // Form1 217 | // 218 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 219 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 220 | this.ClientSize = new System.Drawing.Size(1360, 792); 221 | this.Controls.Add(this.tblMain); 222 | this.Controls.Add(this.menuStrip1); 223 | this.MainMenuStrip = this.menuStrip1; 224 | this.Name = "Form1"; 225 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 226 | this.Text = "Stable Diffusion"; 227 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); 228 | this.Load += new System.EventHandler(this.Form1_Load); 229 | this.menuStrip1.ResumeLayout(false); 230 | this.menuStrip1.PerformLayout(); 231 | this.tblMain.ResumeLayout(false); 232 | this.pageConsole.ResumeLayout(false); 233 | this.pageWebView.ResumeLayout(false); 234 | ((System.ComponentModel.ISupportInitialize)(this.webView)).EndInit(); 235 | this.ResumeLayout(false); 236 | this.PerformLayout(); 237 | 238 | } 239 | 240 | #endregion 241 | 242 | private System.Windows.Forms.MenuStrip menuStrip1; 243 | private System.Windows.Forms.ToolStripMenuItem 启动ToolStripMenuItem; 244 | private System.Windows.Forms.ToolStripMenuItem mnuLaunch; 245 | private System.Windows.Forms.ToolStripMenuItem mnuSetArgs; 246 | private System.Windows.Forms.ToolStripMenuItem mnuRelaunch; 247 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; 248 | private System.Windows.Forms.ToolStripMenuItem mnuExit; 249 | private System.Windows.Forms.ToolStripMenuItem mnuSwitchConsole; 250 | private System.Windows.Forms.ToolStripMenuItem mnuOpenDir; 251 | private System.Windows.Forms.ToolStripMenuItem 打开模型目录ToolStripMenuItem; 252 | private System.Windows.Forms.ToolStripMenuItem 打开输出目录ToolStripMenuItem; 253 | private Creek.UI.MultiPanel.MultiPaneControl tblMain; 254 | private Creek.UI.MultiPanel.MultiPanePage pageConsole; 255 | private Creek.UI.MultiPanel.MultiPanePage pageWebView; 256 | private ConsoleControl.ConsoleControl consoleControl; 257 | private Microsoft.Web.WebView2.WinForms.WebView2 webView; 258 | private System.ComponentModel.BackgroundWorker checkWebuiWorker; 259 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; 260 | private System.Windows.Forms.ToolStripMenuItem mnuRefresh; 261 | } 262 | } 263 | 264 | --------------------------------------------------------------------------------