1616
1717CONFIGS_DIR = Path (__file__ ).parent .joinpath ("configs" )
1818
19- fooocus_magic_split = [
20- ", extremely" ,
21- ", intricate,"
22- ]
19+ fooocus_magic_split = [", extremely" , ", intricate," ]
2320
2421disallowed_chars_table = str .maketrans ("" , "" , "[]【】()()|::" )
2522
@@ -46,7 +43,9 @@ def __init__(self, model_directory: str):
4643 self .tokenizer = AutoTokenizer .from_pretrained (model_directory )
4744 self .model = AutoModelForCausalLM .from_pretrained (model_directory )
4845
49- positive_tokens = model_directory .joinpath ("positive.txt" ).read_text ().splitlines ()
46+ positive_tokens = (
47+ model_directory .joinpath ("positive.txt" ).read_text ().splitlines ()
48+ )
5049
5150 positive_tokens = []
5251
@@ -86,7 +85,7 @@ def __call__(self, prompt: str, seed: int) -> str:
8685 )
8786
8887 response = self .tokenizer .batch_decode (features , skip_special_tokens = True )
89- result = response [0 ][len (origin ):]
88+ result = response [0 ][len (origin ) :]
9089 result = safe_str (result )
9190 result = result .translate (disallowed_chars_table )
9291 return result
@@ -110,7 +109,7 @@ def INPUT_TYPES(s):
110109 "required" : {
111110 "model_name" : (folder_paths .get_filename_list ("prompt_expansion" ),),
112111 "text" : ("STRING" , {"multiline" : True }),
113- "seed" : ("INT" , {"default" : 0 , "min" : 0 , "max" : 0xFFFFFFFF })
112+ "seed" : ("INT" , {"default" : 0 , "min" : 0 , "max" : 0xFFFFFFFF }),
114113 },
115114 }
116115
@@ -151,4 +150,6 @@ def expand_prompt(model_name: str, text: str, seed: int, log_prompt: str):
151150NODE_CLASS_MAPPINGS = {"Inference_Core_PromptExpansion" : PromptExpansion }
152151
153152# A dictionary that contains human-readable titles for the nodes
154- NODE_DISPLAY_NAME_MAPPINGS = {"Inference_Core_PromptExpansion" : "[Inference.Core] Prompt Expansion" }
153+ NODE_DISPLAY_NAME_MAPPINGS = {
154+ "Inference_Core_PromptExpansion" : "[Inference.Core] Prompt Expansion"
155+ }
0 commit comments