33PNGINFO_2_LIGHTDIFFUSIONFLOW = {}
44PNGINFO_CN_2_LIGHTDIFFUSIONFLOW = {}
55Image_Components_Key = {}
6+ LoRAs_In_Use = "loras_in_use"
67
78class OutputPrompt_English :
89
@@ -33,11 +34,22 @@ def missing_extensions(ext_list:[]):
3334 error_str += "<b style='color:Orange;'>The above Extension Missing Reminder is for reference only. Please determine the necessary plugins based on your actual needs and specific conditions.</b></p> "
3435 return error_str
3536
37+ def missing_loras (loras_list :[]):
38+ error_str = "Note: <b style='color:Orange;'>Found missing LoRAs.</b></p>"
39+ for lora in loras_list :
40+ error_str += "<p>- <b style='color:Orange;'>" + lora + "</b></p> "
41+ return error_str
42+
3643 def click_to_download (file_name , file_url ):
3744 return f'''<p style="color:Orange;">Click to download \
3845 <a style ='text-decoration:underline;color:cornflowerblue;', target="_blank", href='{ file_url } '> { file_name } </a>
3946 '''
4047
48+ def note_for_save_mode ():
49+ return "Core mode only supports basic parameters for Text-to-Image and Image-to-Image, along with ControlNet parameters. \
50+ The All mode, on the other hand, aims to support as many parameters as possible on the page, \
51+ but the downside is that it may occasionally cause the UI to freeze with an infinite loading circle."
52+
4153class OutputPrompt_Chinese :
4254
4355 def startimport ():
@@ -70,6 +82,12 @@ def missing_extensions(ext_list:[]):
7082 error_str += "<b style='color:Orange;'>以上插件缺失提示仅供参考,请注意辨别实际情况下您所需要安装的插件。</b></p> "
7183 return error_str
7284
85+ def missing_loras (loras_list :[]):
86+ error_str = "注意, <b style='color:Orange;'>发现缺失的LoRA模型:</b></p>"
87+ for lora in loras_list :
88+ error_str += "<p>- <b style='color:Orange;'>" + lora + "</b></p> "
89+ return error_str
90+
7391 def click_to_download (file_name , file_url ):
7492 name = file_name
7593 if (name == "ControlNet Models" ):
@@ -82,12 +100,17 @@ def click_to_download(file_name, file_url):
82100 <a style ='text-decoration:underline;color:cornflowerblue;', target="_blank", href='{ file_url } '> { name } </a>
83101 '''
84102
103+ def note_for_save_mode ():
104+ return "Core模式仅支持文生图和图生图的基本参数+ControlNet参数。All模式则会尽可能多的支持页面上的参数,但是缺点是有概率导致UI卡住,无限转圈。"
105+
106+
85107OutputPrompt = OutputPrompt_English
108+ Flow_Save_mode = "Core"
86109
87110# 改成函数调用,修改配置之后能及时刷新
88111def init ():
89112 global PNGINFO_2_LIGHTDIFFUSIONFLOW ,PNGINFO_CN_2_LIGHTDIFFUSIONFLOW
90- global OutputPrompt ,Image_Components_Key
113+ global OutputPrompt ,Flow_Save_mode , Image_Components_Key
91114 # PNG Info的功能除了主要的选项以外其他的都靠第三方插件的主动支持,后续再考虑能否有优化的办法
92115 #print(parameters_copypaste.paste_fields)
93116 PNGINFO_2_LIGHTDIFFUSIONFLOW = {
@@ -133,40 +156,46 @@ def init():
133156 json_str = f .read ()
134157 webui_settings = json .loads (json_str )
135158
136- successed = False
159+ # 保存模式
160+ try :
161+ Flow_Save_mode = webui_settings ["lightdiffusionflow-mode" ]
162+ except :
163+ Flow_Save_mode = "Core"
164+
165+ language_successed = False
137166 auto_language = False
138167 try :
139168 # 优先读取自己的设置
140169 if (webui_settings ['lightdiffusionflow-language' ] == "default" ):
141170 auto_language = True
142171 elif (webui_settings ['lightdiffusionflow-language' ] == "english" ):
143172 OutputPrompt = OutputPrompt_English
144- successed = True
173+ language_successed = True
145174 else :
146175 OutputPrompt = OutputPrompt_Chinese
147- successed = True
176+ language_successed = True
148177 except :
149178 OutputPrompt = OutputPrompt_English
150179
151180 # 如果是default就读取其他设置配合
152- if (auto_language and not successed ):
181+ if (auto_language and not language_successed ):
153182 # 自带的本地化文件
154183 localization_files = ["zh_CN" , "zh-Hans (Stable) [vladmandic]" , "zh-Hans (Stable)" ,
155184 "zh-Hans (Testing) [vladmandic]" , "zh-Hans (Testing)" ,"chinese-all-1024" ,"chinese-english-1024" ]
156185 try :
157186 # 如果用户使用了中文汉化文件,插件也默认显示中文
158187 localization_files .index (webui_settings ["localization" ])
159188 OutputPrompt = OutputPrompt_Chinese
160- successed = True
189+ language_successed = True
161190 except :
162191 pass
163192
164193 # 第三方翻译插件bilingual-localization
165- if (not successed ):
194+ if (not language_successed ):
166195 try :
167196 if (webui_settings ["bilingual_localization_enabled" ] and webui_settings ["bilingual_localization_file" ] != "None" ):
168197 OutputPrompt = OutputPrompt_Chinese
169- successed = True
198+ language_successed = True
170199 except :
171200 OutputPrompt = OutputPrompt_English
172201 except :
0 commit comments