Add code for categories.

This commit is contained in:
comfyanonymous 2023-01-26 01:26:28 -05:00
parent acdc6f42e0
commit eb85896b73
2 changed files with 4 additions and 1 deletions

View File

@ -291,6 +291,9 @@ class PromptServer(BaseHTTPRequestHandler):
info['output'] = obj_class.RETURN_TYPES info['output'] = obj_class.RETURN_TYPES
info['name'] = x #TODO info['name'] = x #TODO
info['description'] = '' info['description'] = ''
info['category'] = 'sd'
if hasattr(obj_class, 'CATEGORY'):
info['category'] = obj_class.CATEGORY
out[x] = info out[x] = info
self.wfile.write(json.dumps(out).encode('utf-8')) self.wfile.write(json.dumps(out).encode('utf-8'))
elif self.path[1:] in os.listdir(self.server.server_dir): elif self.path[1:] in os.listdir(self.server.server_dir):

View File

@ -237,7 +237,7 @@ function onObjectInfo(json) {
MyNode.__json_data = json[key] MyNode.__json_data = json[key]
LiteGraph.registerNodeType(key, MyNode); LiteGraph.registerNodeType(key, MyNode);
MyNode.category = "sd"; //TODO: proper categories MyNode.category = json[key]['category'];
}; };
afterLoadGraph(); afterLoadGraph();