From 967bfce0f3b06bcb7e562b9296960d320e978898 Mon Sep 17 00:00:00 2001 From: Jairo Correa Date: Sun, 26 Mar 2023 21:40:36 -0300 Subject: [PATCH] Optional RETURN_NAMES to set the output name --- server.py | 1 + web/scripts/app.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index e71289cd..80fb2dc7 100644 --- a/server.py +++ b/server.py @@ -152,6 +152,7 @@ class PromptServer(): info = {} info['input'] = obj_class.INPUT_TYPES() info['output'] = obj_class.RETURN_TYPES + info['output_name'] = obj_class.RETURN_NAMES if hasattr(obj_class, 'RETURN_NAMES') else info['output'] info['name'] = x #TODO info['description'] = '' info['category'] = 'sd' diff --git a/web/scripts/app.js b/web/scripts/app.js index a743ef63..e9c86924 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -611,8 +611,10 @@ class ComfyApp { } } - for (const output of nodeData["output"]) { - this.addOutput(output, output); + for (const o in nodeData["output"]) { + const output = nodeData["output"][o]; + const outputName = nodeData["output_name"][o] || output; + this.addOutput(outputName, output); } const s = this.computeSize();