File tree 2 files changed +21
-0
lines changed
src/BuiltinExtensions/ComfyUIBackend
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
CustomWorkflows /
2
2
Workflows /
3
+ DLNodes /
Original file line number Diff line number Diff line change @@ -54,6 +54,24 @@ public static void EnsureComfyFile()
54
54
{
55
55
return ;
56
56
}
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" ) ;
57
75
string yaml = $ """
58
76
stableswarmui:
59
77
base_path: { Utilities . CombinePathWithAbsolute ( Environment . CurrentDirectory , Program . ServerSettings . Paths . ModelRoot ) }
@@ -79,6 +97,8 @@ public static void EnsureComfyFile()
79
97
clip_vision: |
80
98
{ Program . ServerSettings . Paths . SDClipVisionFolder }
81
99
clip_vision
100
+ custom_nodes: |
101
+ { nodePath }
82
102
""" ;
83
103
File . WriteAllText ( "Data/comfy-auto-model.yaml" , yaml ) ;
84
104
IsComfyModelFileEmitted = true ;
You can’t perform that action at this time.
0 commit comments