Skip to content

Commit

Permalink
New menu fixes - fix send to workflow (comfyanonymous#3909)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
pythongosssss authored Jul 14, 2024
1 parent a3dffc4 commit 79547ef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
8 changes: 7 additions & 1 deletion web/scripts/ui/menu/workflows.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
25 changes: 17 additions & 8 deletions web/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,45 @@ 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;
max-width: -webkit-fill-available;
}

.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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 79547ef

Please sign in to comment.