Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLIPTextEncodeWildcards.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import re
import os
if __name__ == os.path.splitext(os.path.basename(__file__))[0] or __name__ =='__main__':
from ConsoleColor import print, console
#from ConsoleColor import print, console
from wildcards import wildcards
else:
from .ConsoleColor import print, console
#from .ConsoleColor import print, console
from .wildcards import wildcards
#print(__file__)
#print(os.path.basename(__file__))
Expand Down
4 changes: 2 additions & 2 deletions CheckpointLoaderSimpleText.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import random
import os
if __name__ == os.path.splitext(os.path.basename(__file__))[0] :
from ConsoleColor import print, console, ccolor
#from ConsoleColor import print, console, ccolor
from mypath import *
else:
from .ConsoleColor import print, console, ccolor
#from .ConsoleColor import print, console, ccolor
from .mypath import *

#print(__file__)
Expand Down
4 changes: 2 additions & 2 deletions LoraLoaderText.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import folder_paths

if __name__ == os.path.splitext(os.path.basename(__file__))[0] :
from ConsoleColor import print, console, ccolor
#from ConsoleColor import print, console, ccolor
from mypath import *
else:
from .ConsoleColor import print, console, ccolor
#from .ConsoleColor import print, console, ccolor
from .mypath import *

class LoraLoaderText:
Expand Down
6 changes: 3 additions & 3 deletions LoraLoaderTextRandom.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import folder_paths
import random
if __name__ == os.path.splitext(os.path.basename(__file__))[0] :
from ConsoleColor import print, console
#from ConsoleColor import print, console
from mypath import *
else:
from .ConsoleColor import print, console
#from .ConsoleColor import print, console
from .mypath import *

class LoraLoaderTextRandom:
Expand Down Expand Up @@ -82,7 +82,7 @@ def load_lora(self,
model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora_path, strength_model, strength_clip)
return (model_lora, clip_lora)
except Exception as e:
console.print_exception()
print(f"An exception occurred:", e)
return (model, clip)

#NODE_CLASS_MAPPINGS = {
Expand Down
4 changes: 2 additions & 2 deletions SaveImageSimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import os
if __name__ == os.path.splitext(os.path.basename(__file__))[0] :
from ConsoleColor import print, console
#from ConsoleColor import print, console
from mypath import *
else:
from .ConsoleColor import print, console
#from .ConsoleColor import print, console
from .mypath import *
#print(__file__)
#print(os.path.basename(__file__))
Expand Down
4 changes: 2 additions & 2 deletions SimpleSampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@


if __name__ == os.path.splitext(os.path.basename(__file__))[0] or __name__ =='__main__':
from ConsoleColor import print, console
#from ConsoleColor import print, console
from wildcards import wildcards
else:
from .ConsoleColor import print, console
#from .ConsoleColor import print, console
from .wildcards import wildcards
#print(__file__)
#print(os.path.basename(__file__))
Expand Down
4 changes: 2 additions & 2 deletions TextWildcards.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import re
import os
if __name__ == os.path.splitext(os.path.basename(__file__))[0] or __name__ =='__main__':
from ConsoleColor import print, console
#from ConsoleColor import print, console
from wildcards import wildcards
else:
from .ConsoleColor import print, console
#from .ConsoleColor import print, console
from .wildcards import wildcards


Expand Down
4 changes: 2 additions & 2 deletions VAELoaderText.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import os
from folder_paths import *
if __name__ == os.path.splitext(os.path.basename(__file__))[0] :
from ConsoleColor import print, console, ccolor
#from ConsoleColor import print, console, ccolor
from mypath import *
else:
from .ConsoleColor import print, console, ccolor
#from .ConsoleColor import print, console, ccolor
from .mypath import *

class VAELoaderText:
Expand Down
34 changes: 19 additions & 15 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
import os


print(f"__name__ : {__name__}")
print(f"__file__ : {__file__}")
print(f"os.path.basename(__file__) : {os.path.basename(__file__)}")
print(f"os.path.splitext(os.path.basename(__file__))[0] : {os.path.splitext(os.path.basename(__file__))[0]}")
#print(f"__name__ : {__name__}")
#print(f"__file__ : {__file__}")
#print(f"os.path.basename(__file__) : {os.path.basename(__file__)}")
#print(f"os.path.splitext(os.path.basename(__file__))[0] : {os.path.splitext(os.path.basename(__file__))[0]}")
#print(f"os.path.basename(__file__) : {os.path.basename('/ComfyUI_windows_portable/ComfyUI/custom_nodes/ComfyUI_node_Lilly/__init__.py')}")
#print(f"os.path.splitext(os.path.basename(__file__))[0] : {os.path.splitext(os.path.basename('/ComfyUI_windows_portable/ComfyUI/custom_nodes/ComfyUI_node_Lilly/__init__.py'))[0]}")

wd = os.getcwd()
print("working directory : ", wd)
#wd = os.getcwd()
#print("working directory : ", wd)

if __name__ == os.path.splitext(os.path.basename(__file__))[0] or __name__ =='__main__':
from ConsoleColor import print, console
#if __name__ == os.path.splitext(os.path.basename(__file__))[0] or __name__ =='__main__':
#from ConsoleColor import print, console
#md="custom_nodes.ComfyUI_node_Lilly."
else:
from .ConsoleColor import print, console
#else:
#from .ConsoleColor import print, console
#md="custom_nodes.ComfyUI_node_Lilly."
md="custom_nodes.ComfyUI_node_Lilly."
#print(__file__)
Expand Down Expand Up @@ -80,11 +80,14 @@ def add(name,clist=None):
for c in clist:
NODE_CLASS_MAPPINGS[c]=eval(f"{md}{name}.{c}")

print(f"Load ok : {name}", style="bold green")
except Exception:
console.print_exception()
print(f"Load ok : {name}")
except Exception as e:
print(f"An exception occurred:", e)
#console.print_exception()

console.rule(f" init start ", style="bold green")
#console.rule(f" init start ", style="bold green")
#print(f" init start ")
print(f"### Loading: ComfyUI-node-Lilly")

add("CheckpointLoaderRandom")
add("CheckpointLoaderSimpleText")
Expand All @@ -99,4 +102,5 @@ def add(name,clist=None):
add("TextWildcards")
#add("test")

console.rule(" init end ", style="bold green")
#console.rule(" init end ", style="bold green")
#print(f" init end ")
40 changes: 20 additions & 20 deletions mypath.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import os, glob
import random
from folder_paths import *
if __name__ == os.path.splitext(os.path.basename(__file__))[0] :
from ConsoleColor import print, console
else:
from .ConsoleColor import print, console
#if __name__ == os.path.splitext(os.path.basename(__file__))[0] :
#from ConsoleColor import print, console
#else:
#from .ConsoleColor import print, console

"""
import psutil
Expand All @@ -25,28 +25,28 @@
print()
"""

py_name=os.path.basename(__file__)
print("os.path.basename(__file__) : ",py_name, style="bold CYAN")
#py_name=os.path.basename(__file__)
#print("os.path.basename(__file__) : ",py_name, style="bold CYAN")

absFilePath = os.path.abspath(__file__)
print("os.path.abspath(__file__) : " , absFilePath , style="bold CYAN")
#absFilePath = os.path.abspath(__file__)
#print("os.path.abspath(__file__) : " , absFilePath , style="bold CYAN")

realFilePath = os.path.realpath(__file__)
print("os.path.abspath(__file__) : " + realFilePath , style="bold CYAN")
#realFilePath = os.path.realpath(__file__)
#print("os.path.abspath(__file__) : " + realFilePath , style="bold CYAN")

normpath=os.path.normpath(__file__)
print("os.path.normpath(__file__) : " + normpath , style="bold CYAN")
#normpath=os.path.normpath(__file__)
#print("os.path.normpath(__file__) : " + normpath , style="bold CYAN")

subfolder = os.path.dirname(normpath)
print("os.path.dirname(normpath) : " + subfolder , style="bold CYAN")
#subfolder = os.path.dirname(normpath)
#print("os.path.dirname(normpath) : " + subfolder , style="bold CYAN")

filename = os.path.basename(normpath)
print("os.path.basename(normpath) : " + filename , style="bold CYAN")
#filename = os.path.basename(normpath)
#print("os.path.basename(normpath) : " + filename , style="bold CYAN")

mainFile = os.path.abspath(sys.modules['__main__'].__file__)
print("os.path.abspath(sys.modules\['__main__'].__file__) : " + mainFile ,style="bold CYAN")
mainfolder = os.path.dirname(mainFile)
print("os.path.dirname(mainFile) : " + mainfolder , style="bold CYAN")
#mainFile = os.path.abspath(sys.modules['__main__'].__file__)
#print("os.path.abspath(sys.modules\['__main__'].__file__) : " + mainFile ,style="bold CYAN")
#mainfolder = os.path.dirname(mainFile)
#print("os.path.dirname(mainFile) : " + mainfolder , style="bold CYAN")

def check_name(kind,name,supported_extensions):
for ext in supported_extensions:
Expand Down
11 changes: 6 additions & 5 deletions wildcards.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import re
import fnmatch

if __name__ == os.path.splitext(os.path.basename(__file__))[0] or __name__ =='__main__':
from ConsoleColor import print, console, ccolor
else:
from .ConsoleColor import print, console , ccolor
#if __name__ == os.path.splitext(os.path.basename(__file__))[0] or __name__ =='__main__':
#from ConsoleColor import print, console, ccolor
#else:
#from .ConsoleColor import print, console , ccolor
#print(__file__)
#print(os.path.basename(__file__))
#print(os.getcwd())
Expand All @@ -33,7 +33,8 @@ class wildcards:
# 가져올 파일 목록
card_path = os.path.join(os.path.dirname(__file__), "..", "..", "wildcards", "**", "*.txt")
#card_path=f"{os.getcwd()}\\wildcards\\**\\*.txt"
print(f"wildcards card_path : ", card_path , style="bold CYAN")
#print(f"wildcards card_path : ", card_path , style="bold CYAN")
print(f"wildcards card_path : ", card_path)

# 정규식
#resub = re.compile(r"(\{)([^\{\}]*)(\})")
Expand Down