修改内容升级

This commit is contained in:
严浪
2025-08-17 10:18:13 +08:00
parent bc44c2402e
commit bc19ee4efb
2 changed files with 4 additions and 24 deletions
+2 -6
View File
@@ -6,15 +6,11 @@ editlist=[{
"changs":[
{
"primit":'''else:
return web.json_response({"error": "no prompt", "node_errors": []}, status=400)''',
error = {''',
"edit":'''elif 'prompt_id' in json_data:
return web.json_response(json_data)
else:
return web.json_response({"error": "no prompt", "node_errors": []}, status=400)'''
},
{
"primit":'''info['display_name'] = nodes.NODE_DISPLAY_NAME_MAPPINGS[node_class] if node_class in nodes.NODE_DISPLAY_NAME_MAPPINGS.keys() else node_class''',
"edit":'''info['display_name'] = self.displayName[node_class] if hasattr(self,'displayName') and node_class in self.displayName.keys() else nodes.NODE_DISPLAY_NAME_MAPPINGS[node_class] if node_class in nodes.NODE_DISPLAY_NAME_MAPPINGS.keys() else node_class'''
error = {'''
}
]
},{
+2 -18
View File
@@ -1172,27 +1172,11 @@ async def handleMessagePost(request):
logging.error('事件处理异常:'+str(e))
return web.Response(status=200)
custom_nodes_path=folder_paths.get_folder_paths('custom_nodes')[0]
custom_nodes_path=os.path.join(custom_nodes_path,'AIGODLIKE-ComfyUI-Translation')
custom_nodes_path=os.path.join(custom_nodes_path,Config().base.get('language','zh-CN'),'Nodes')
NODE_LANGEUAGE_DISPLAY_NAME_MAPPINGS={}
if os.path.exists(custom_nodes_path):
for file in os.listdir(custom_nodes_path):
if file.endswith('.json'):
json_file=os.path.join(custom_nodes_path, file)
if os.path.isfile(json_file):
f = open(json_file,'r', encoding='utf-8')
data = json.load(f)
f.close()
for key in data:
if 'title' in data[key]:
NODE_LANGEUAGE_DISPLAY_NAME_MAPPINGS[key]=data[key]['title']
# custom_nodes_path=folder_paths.get_folder_paths('custom_nodes')[0]
PromptServer.instance.send_sync=types.MethodType(send_sync,PromptServer.instance)
PromptServer.instance.old_trigger_on_prompt=PromptServer.instance.trigger_on_prompt
PromptServer.instance.trigger_on_prompt=types.MethodType(trigger_on_prompt,PromptServer.instance)
if hasattr(PromptServer.instance,"displayName")==False:
setattr(PromptServer.instance,"displayName",NODE_LANGEUAGE_DISPLAY_NAME_MAPPINGS)
if Config().cluster:
if'redis'==Config().cluster["clusterType"] and r: #添加订阅消息
if Config().cluster["isMain"]: