From 79547efb65ebb41a964ce7686170c4e6c3641eb2 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Sun, 14 Jul 2024 07:04:40 +0100 Subject: [PATCH] New menu fixes - fix send to workflow (#3909) * Fix send to workflow Fix center align of close workflow dialog Better support for elements around canvas * More resilent to extra elements added to body --- web/scripts/ui/menu/workflows.js | 8 +++++++- web/style.css | 25 +++++++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/web/scripts/ui/menu/workflows.js b/web/scripts/ui/menu/workflows.js index afdff538..3b904fb4 100644 --- a/web/scripts/ui/menu/workflows.js +++ b/web/scripts/ui/menu/workflows.js @@ -182,6 +182,11 @@ export class ComfyWorkflowsMenu { * @param {ComfyWorkflow} workflow */ async function sendToWorkflow(img, workflow) { + const openWorkflow = app.workflowManager.openWorkflows.find((w) => w.path === workflow.path); + if (openWorkflow) { + workflow = openWorkflow; + } + await workflow.load(); let options = []; const nodes = app.graph.computeExecutionOrder(false); @@ -214,7 +219,8 @@ export class ComfyWorkflowsMenu { nodeType.prototype["getExtraMenuOptions"] = function (_, options) { const r = getExtraMenuOptions?.apply?.(this, arguments); - if (app.ui.settings.getSettingValue("Comfy.UseNewMenu", false) === true) { + const setting = app.ui.settings.getSettingValue("Comfy.UseNewMenu", false); + if (setting && setting != "Disabled") { const t = /** @type { {imageIndex?: number, overIndex?: number, imgs: string[]} } */ /** @type {any} */ (this); let img; if (t.imageIndex != null) { diff --git a/web/style.css b/web/style.css index e983b652..8ef1d0dd 100644 --- a/web/style.css +++ b/web/style.css @@ -41,7 +41,7 @@ body { background-color: var(--bg-color); color: var(--fg-color); grid-template-columns: auto 1fr auto; - grid-template-rows: auto auto 1fr auto; + grid-template-rows: auto 1fr auto; min-height: -webkit-fill-available; max-height: -webkit-fill-available; min-width: -webkit-fill-available; @@ -49,32 +49,37 @@ body { } .comfyui-body-top { - order: 0; + order: -5; grid-column: 1/-1; z-index: 10; + display: flex; + flex-direction: column; } .comfyui-body-left { - order: 1; + order: -4; z-index: 10; + display: flex; } #graph-canvas { width: 100%; height: 100%; - order: 2; - grid-column: 1/-1; + order: -3; } .comfyui-body-right { - order: 3; + order: -2; z-index: 10; + display: flex; } .comfyui-body-bottom { - order: 4; + order: -1; grid-column: 1/-1; z-index: 10; + display: flex; + flex-direction: column; } .comfy-multiline-input { @@ -408,8 +413,12 @@ dialog::backdrop { background: rgba(0, 0, 0, 0.5); } -.comfy-dialog.comfyui-dialog { +.comfy-dialog.comfyui-dialog.comfy-modal { top: 0; + left: 0; + right: 0; + bottom: 0; + transform: none; } .comfy-dialog.comfy-modal {