More region widget fixes

This commit is contained in:
space-nuko
2023-05-23 17:29:33 -05:00
parent e3c73ce18a
commit a3d4e4bca7
8 changed files with 68 additions and 23 deletions

View File

@@ -356,6 +356,24 @@ export default class ComfyApp {
ComfyApp.registerDefaultSlotHandlers(nodeId, nodeDef)
}
ComfyApp.registerComfyBoxSlotTypes()
}
static registerComfyBoxSlotTypes() {
const reg = (type: string) => {
const lowerType = type.toLowerCase();
if (!LiteGraph.slot_types_in.includes(lowerType)) {
LiteGraph.slot_types_in.push(lowerType);
}
if (!LiteGraph.slot_types_out.includes(type)) {
LiteGraph.slot_types_out.push(type);
}
}
reg("COMFYBOX_IMAGE")
reg("COMFYBOX_IMAGES")
reg("COMFYBOX_REGION")
}
static registerDefaultSlotHandlers(nodeId: string, nodeDef: ComfyNodeDef) {
@@ -771,7 +789,9 @@ export default class ComfyApp {
const promptFilename = get(configState).promptForWorkflowName;
let filename = "workflow.json";
const title = workflow.attrs.title.trim() || "workflow"
let filename = `${title}.json`;
if (promptFilename) {
filename = prompt("Save workflow as:", filename);
if (!filename) return;
@@ -782,7 +802,7 @@ export default class ComfyApp {
else {
const date = new Date();
const formattedDate = date.toISOString().replace(/:/g, '-').replace(/\.\d{3}/g, '').replace('T', '_').replace("Z", "");
filename = `workflow - ${formattedDate}.json`
filename = `${title} - ${formattedDate}.json`
}
const indent = 2