Skip to content

Commit 5fef83d

Browse files
JasonHokuclaude
andcommitted
fix: dashboard landing page loading default session instead of showing picker
New nodes now show the session landing page instead of auto-loading "my_session". Uses _configured_from_workflow flag to distinguish fresh nodes from saved workflows. Also fixes session cards Y-axis overflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6d1fcdb commit 5fef83d

2 files changed

Lines changed: 29 additions & 11 deletions

File tree

__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,10 @@ async def get_session_html(request):
401401
session_name = re.sub(r'[^\w\-]', '', session_name)
402402

403403
if not session_name:
404-
return web.Response(status=400, text="Missing session_name")
404+
# No session name — return landing page with empty manifest
405+
empty_manifest = {"items": [], "meta": {"model": "", "positive": "", "negative": ""}, "session_name": ""}
406+
html = get_html_template("", empty_manifest, node_id)
407+
return web.Response(status=200, text=html)
405408

406409
base_dir = os.path.join(folder_paths.get_output_directory(), "benchmarks", session_name)
407410

web/dashboard.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -391,16 +391,31 @@ app.registerExtension({
391391
// Set default size
392392
this.setSize([900, 750]);
393393

394-
// Auto-load session on node creation so the dashboard
395-
// shows content immediately (landing page or session grid)
396-
// instead of a blank black box
397-
const autoLoadSession = getSessionName();
398-
if (autoLoadSession) {
399-
// Small delay to let ComfyUI finish initializing the node
400-
setTimeout(() => {
401-
this.forceLoadSession(autoLoadSession);
402-
}, 500);
403-
}
394+
// Auto-load: show landing page for new nodes, or saved session
395+
// for workflows loaded from disk. onConfigure fires synchronously
396+
// before the setTimeout, so we can use a flag to distinguish.
397+
node._configured_from_workflow = false;
398+
setTimeout(() => {
399+
if (node._configured_from_workflow) {
400+
// Workflow loaded — show the saved session
401+
const savedSession = getSessionName();
402+
if (savedSession) {
403+
this.forceLoadSession(savedSession);
404+
} else {
405+
this.forceLoadSession("");
406+
}
407+
} else {
408+
// Fresh node — show landing page with session cards
409+
this.forceLoadSession("");
410+
}
411+
}, 500);
412+
413+
// onConfigure fires when loading a saved workflow (before setTimeout)
414+
const origOnConfigure = this.onConfigure;
415+
this.onConfigure = function (config) {
416+
if (origOnConfigure) origOnConfigure.apply(this, arguments);
417+
node._configured_from_workflow = true;
418+
};
404419

405420
// Cleanup on node removal
406421
const originalOnRemoved = this.onRemoved;

0 commit comments

Comments
 (0)