fix: In the share feature, only image formats are allowed.

This commit is contained in:
Dr.Lt.Data 2023-11-11 07:53:44 +09:00
parent 0c11c30731
commit 2bc7167ada
3 changed files with 8 additions and 3 deletions

View File

@ -14,7 +14,7 @@ import concurrent
import ssl import ssl
from urllib.parse import urlparse from urllib.parse import urlparse
version = "V1.0" version = "V1.0.1"
print(f"### Loading: ComfyUI-Manager ({version})") print(f"### Loading: ComfyUI-Manager ({version})")

View File

@ -603,7 +603,7 @@ app.registerExtension({
const supported_nodes_string = SUPPORTED_OUTPUT_NODE_TYPES.join(", "); const supported_nodes_string = SUPPORTED_OUTPUT_NODE_TYPES.join(", ");
alert(`No supported output node found (${supported_nodes_string}). To share this workflow, please add an output node to your graph and re-run your prompt.`); alert(`No supported output node found (${supported_nodes_string}). To share this workflow, please add an output node to your graph and re-run your prompt.`);
} else { } else {
alert("To share this, first run a prompt. Once it's done, click 'Share'."); alert("To share this, first run a prompt. Once it's done, click 'Share'.\n\nNOTE: Images of the Share target can only be selected in the PreviewImage, SaveImage, and VHS_VideoCombine nodes. In the case of VHS_VideoCombine, only the image/gif and image/webp formats are supported.");
} }
return; return;
} }

View File

@ -88,6 +88,11 @@ export function getPotentialOutputsAndOutputNodes(nodes) {
const widgetValue = node.widgets[j].value; const widgetValue = node.widgets[j].value;
const parsedURLVals = widgetValue.params; const parsedURLVals = widgetValue.params;
if(!parsedURLVals.format.startsWith('image')) {
// video isn't supported format
continue;
}
// ensure that the parsedURLVals have 'filename', 'subfolder', 'type', and 'format' properties // ensure that the parsedURLVals have 'filename', 'subfolder', 'type', and 'format' properties
if (parsedURLVals.hasOwnProperty("filename") && parsedURLVals.hasOwnProperty("subfolder") && parsedURLVals.hasOwnProperty("type") && parsedURLVals.hasOwnProperty("format")) { if (parsedURLVals.hasOwnProperty("filename") && parsedURLVals.hasOwnProperty("subfolder") && parsedURLVals.hasOwnProperty("type") && parsedURLVals.hasOwnProperty("format")) {
if (parsedURLVals.type !== "output") { if (parsedURLVals.type !== "output") {
@ -509,7 +514,7 @@ export class ShareDialog extends ComfyDialog {
const supported_nodes_string = SUPPORTED_OUTPUT_NODE_TYPES.join(", "); const supported_nodes_string = SUPPORTED_OUTPUT_NODE_TYPES.join(", ");
alert(`No supported output node found (${supported_nodes_string}). To share this workflow, please add an output node to your graph and re-run your prompt.`); alert(`No supported output node found (${supported_nodes_string}). To share this workflow, please add an output node to your graph and re-run your prompt.`);
} else { } else {
alert("To share this, first run a prompt. Once it's done, click 'Share'."); alert("To share this, first run a prompt. Once it's done, click 'Share'.\n\nNOTE: Images of the Share target can only be selected in the PreviewImage, SaveImage, and VHS_VideoCombine nodes. In the case of VHS_VideoCombine, only the image/gif and image/webp formats are supported.");
} }
this.selectedOutputIndex = 0; this.selectedOutputIndex = 0;
this.close(); this.close();