Skip to content

Commit 85d5c04

Browse files
committed
automatically add Dynamic Thresholding to self-start comfyui
1 parent 106ae04 commit 85d5c04

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
CustomWorkflows/
22
Workflows/
3+
DLNodes/

src/BuiltinExtensions/ComfyUIBackend/ComfyUISelfStartBackend.cs

+20
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,24 @@ public static void EnsureComfyFile()
5454
{
5555
return;
5656
}
57+
string nodePath = Path.GetFullPath(ComfyUIBackendExtension.Folder + "/DLNodes");
58+
if (!Directory.Exists(nodePath))
59+
{
60+
Directory.CreateDirectory(nodePath);
61+
}
62+
void EnsureNodeRepo(string url)
63+
{
64+
string folderName = url.AfterLast('/');
65+
if (!Directory.Exists($"{nodePath}/{folderName}"))
66+
{
67+
Process.Start(new ProcessStartInfo("git", $"clone {url}") { WorkingDirectory = nodePath }).WaitForExit();
68+
}
69+
else
70+
{
71+
Process.Start(new ProcessStartInfo("git", "pull") { WorkingDirectory = Path.GetFullPath($"{nodePath}/{folderName}") }).WaitForExit();
72+
}
73+
}
74+
EnsureNodeRepo("https://github.com/mcmonkeyprojects/sd-dynamic-thresholding");
5775
string yaml = $"""
5876
stableswarmui:
5977
base_path: {Utilities.CombinePathWithAbsolute(Environment.CurrentDirectory, Program.ServerSettings.Paths.ModelRoot)}
@@ -79,6 +97,8 @@ public static void EnsureComfyFile()
7997
clip_vision: |
8098
{Program.ServerSettings.Paths.SDClipVisionFolder}
8199
clip_vision
100+
custom_nodes: |
101+
{nodePath}
82102
""";
83103
File.WriteAllText("Data/comfy-auto-model.yaml", yaml);
84104
IsComfyModelFileEmitted = true;

0 commit comments

Comments
 (0)