File tree Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 5
5
comfy_path = os .path .dirname (folder_paths .__file__ )
6
6
js_path = os .path .join (comfy_path , "web" )
7
7
8
- def sha256sum (filename ):
9
- with open (filename , 'rb' , buffering = 0 ) as f :
10
- return hashlib .file_digest (f , 'sha256' ).hexdigest ()
11
- def need_update ():
12
- return sha256sum ('user.css' )!= sha256sum (os .path .join (js_path ,'user.css' ))
13
-
14
8
15
-
16
- cur_css = ""
17
- if need_update ():
18
- print ('updating user.css' )
19
- with open (os .path .join (os .path .dirname (__file__ ), "user.css" )) as file :
20
- cur_css = file .read ()
21
- with open (os .path .join (js_path , "user.css" ), "w" ) as f :
22
- f .write (cur_css )
9
+ def hash_file (filename : str , blocksize : int = 4096 ) -> str :
10
+ hsh = hashlib .md5 ()
11
+ with open (filename , "rb" ) as f :
12
+ while True :
13
+ buf = f .read (blocksize )
14
+ if not buf :
15
+ break
16
+ hsh .update (buf )
17
+ return hsh .hexdigest ()
23
18
24
19
20
+ def need_update ():
21
+ return hash_file (os .path .join (os .path .dirname (__file__ ), "user.css" )) != hash_file (
22
+ os .path .join (js_path , "user.css" )
23
+ )
25
24
26
25
26
+ cur_css = ""
27
+ if need_update ():
28
+ print ("updating user.css" )
29
+ with open (os .path .join (os .path .dirname (__file__ ), "user.css" )) as file :
30
+ cur_css = file .read ()
31
+ with open (os .path .join (js_path , "user.css" ), "w" ) as f :
32
+ f .write (cur_css )
27
33
28
34
29
35
WEB_DIRECTORY = "./web"
36
+ NODE_CLASS_MAPPINGS = {}
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ thead {
26
26
}
27
27
.comfy-menu {
28
28
z-index : 1 ;
29
+
29
30
}
30
31
.comfy-menu ,
31
32
.comfy-modal {
You can’t perform that action at this time.
0 commit comments