Repository navigation
[backport core/1.48] fix(workflow): repair the A1111 import lifecycle and report broken installs accurately - #14748
Conversation
…stalls accurately (#14556) Splits out of #14251. Five lifecycle fixes on the A1111 image-import path. 30 production lines. ## What Dropping an A1111-generated PNG parses its `parameters` string and builds a ComfyUI graph from it. The path had four defects that only show up when something goes wrong, plus one that shows up always: 1. **`afterLoadNewGraph` was not awaited.** It suspends before the active workflow is reassigned, so `rootGraph.serialize()` on the next line captured the *outgoing* graph — the new tab was born dirty against a stale baseline. 2. **A rejection escaped an async DOM handler.** `importA1111` awaits `api.getEmbeddings()`, which does not check `resp.ok`. On a 500 with an HTML body it throws, `fileInput.value = ''` never runs, the input still holds the file, re-selecting it fires no `change` event, and Open silently does nothing on every retry. Now: `try`/`catch` with a toast, `finally` resets the input. 3. **Two identical alerts for one file.** The invalid-structure `else` and the parse `catch` each called `showErrorOnFileLoad`, then fell through to the final call at the end of `handleFile`. Those two are the `else` and `catch` of one `try`, so the maximum is two alerts, not three. 4. **`beforeLoadNewGraph()` ran before an import that might bail.** It calls `domWidgetStore.clear()`, and nothing re-registers on a bail path — a workflow with a multiline prompt on screen lost its DOM widget overlays when the user dropped a PNG that did not parse. It now runs immediately before the mutation, and the A1111 path gets the subgraph guard `clean()` already had. 5. **No message at all when required node types are unavailable, and silent corruption of the open workflow.** `importA1111` logged to the console and returned `void`. Because the call was unawaited, `afterLoadNewGraph` then registered the user's *unchanged* graph under the dropped file's name, after `beforeLoadNewGraph` had already cleared `domWidgetStore`. See below. ## The message The seven types this importer needs — `CheckpointLoaderSimple`, `CLIPSetLastLayer`, `CLIPTextEncode`, `KSampler`, `EmptyLatentImage`, `VAEDecode`, `SaveImage` — are all **core nodes**, as are `LoraLoader` and the hires chain. Their absence does not mean a node pack is missing. It means the backend did not load, or the install is broken. So this path deliberately writes nothing to the missing-node panel: no card, no entry, no placeholder. A type that was never added to the graph does not belong in a list of nodes missing *from the graph*, and naming the individual types would read as "install this pack" and send people looking for something that does not exist. ``` "Could not load the workflow because this ComfyUI installation is missing core nodes. Check that the backend started correctly." ``` `importA1111` returns `Promise<'imported' | 'not-a1111' | 'core-nodes-unavailable'>` — three string literals, replacing `Promise<boolean>`. The boolean could not distinguish "bailed and already told the user" from "bailed silently", which is how an ordinary A1111 PNG could vanish with no feedback at all: A1111 omits the `Negative prompt:` line entirely when the negative prompt is empty. The `core-nodes-unavailable` return happens **before** the graph is touched, so a failed import leaves the open workflow intact. `pnginfo.test.ts` asserts that directly. ## What this deliberately does not do `pnginfo.ts` is **+8 −4**, with zero re-indentation (`git diff` and `git diff -w` report the same line count). The nesting in that file is not pretty and it is not this PR's business. An earlier revision restructured it; that diff was 759 lines, ~72% of it re-indentation, and none of it fixed a bug. If it deserves a refactor it deserves a PR where a reviewer sees only that. ## Verification 6 unit tests across `app.test.ts`, `pnginfo.test.ts` and `ui.test.ts`, each mutation-proved. typecheck, lint, format, knip clean. Full unit suite: only pre-existing timeout flakes, confirmed by re-running the same files at the merge base and getting byte-identical results. ## Related - Follow-up to #14251 (closed) - Independent of #14555 and of the narrow submission fix — no ordering constraint
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1769 passed, 0 failed📊 Browser Reports
📦 Bundle Size
⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-05T03:08:12.747Z",
"gitSha": "6c83393ec009bc09c1f39eeecdf60d9dcbd37169",
"branch": "backport-14556-to-core-1.48",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2158.7200000000166,
"styleRecalcs": 8,
"styleRecalcDurationMs": 5.892999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 599.055,
"heapDeltaBytes": -21848192,
"heapUsedBytes": 46167796,
"domNodes": -275,
"jsHeapTotalBytes": 19918848,
"scriptDurationMs": 17.553,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-idle",
"durationMs": 2028.3220000000028,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.6320000000000014,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 467.941,
"heapDeltaBytes": 3838652,
"heapUsedBytes": 71849160,
"domNodes": 20,
"jsHeapTotalBytes": 21102592,
"scriptDurationMs": 14.568999999999999,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1838.8839999999504,
"styleRecalcs": 74,
"styleRecalcDurationMs": 34.594,
"layouts": 12,
"layoutDurationMs": 3.4000000000000004,
"taskDurationMs": 837.466,
"heapDeltaBytes": -14080076,
"heapUsedBytes": 53735724,
"domNodes": -272,
"jsHeapTotalBytes": 20705280,
"scriptDurationMs": 115.547,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1790.9310000000005,
"styleRecalcs": 74,
"styleRecalcDurationMs": 33.842,
"layouts": 12,
"layoutDurationMs": 3.3609999999999993,
"taskDurationMs": 835.097,
"heapDeltaBytes": -14842408,
"heapUsedBytes": 53158024,
"domNodes": -275,
"jsHeapTotalBytes": 21229568,
"scriptDurationMs": 117.52199999999999,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1738.5920000000397,
"styleRecalcs": 32,
"styleRecalcDurationMs": 14.521999999999998,
"layouts": 6,
"layoutDurationMs": 0.4889999999999999,
"taskDurationMs": 354.602,
"heapDeltaBytes": 7288600,
"heapUsedBytes": 75221864,
"domNodes": 78,
"jsHeapTotalBytes": 20316160,
"scriptDurationMs": 17.430999999999994,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1721.151999999961,
"styleRecalcs": 31,
"styleRecalcDurationMs": 15.361000000000002,
"layouts": 6,
"layoutDurationMs": 0.665,
"taskDurationMs": 355.486,
"heapDeltaBytes": 7308576,
"heapUsedBytes": 75173432,
"domNodes": 77,
"jsHeapTotalBytes": 20316160,
"scriptDurationMs": 16.650999999999996,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 594.159999999988,
"styleRecalcs": 11,
"styleRecalcDurationMs": 6.721999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 357.46500000000003,
"heapDeltaBytes": -12176504,
"heapUsedBytes": 55935404,
"domNodes": 18,
"jsHeapTotalBytes": 21102592,
"scriptDurationMs": 59.51500000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 588.4920000000875,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.189000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 374.233,
"heapDeltaBytes": -12614708,
"heapUsedBytes": 55512484,
"domNodes": 18,
"jsHeapTotalBytes": 21364736,
"scriptDurationMs": 57.131,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2011.923999999965,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.856000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 639.121,
"heapDeltaBytes": 5724192,
"heapUsedBytes": 64720452,
"domNodes": -278,
"jsHeapTotalBytes": 4259840,
"scriptDurationMs": 97.246,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2031.1140000000023,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.410000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 661.7429999999999,
"heapDeltaBytes": 6213772,
"heapUsedBytes": 65002800,
"domNodes": -277,
"jsHeapTotalBytes": 4784128,
"scriptDurationMs": 103.88900000000001,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2156.702999999993,
"styleRecalcs": 68,
"styleRecalcDurationMs": 12.023000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1185.557,
"heapDeltaBytes": 1517248,
"heapUsedBytes": 61601160,
"domNodes": -278,
"jsHeapTotalBytes": 5513216,
"scriptDurationMs": 408.67900000000003,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2169.4850000000088,
"styleRecalcs": 69,
"styleRecalcDurationMs": 13.261,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1222.518,
"heapDeltaBytes": 5023028,
"heapUsedBytes": 65499224,
"domNodes": -279,
"jsHeapTotalBytes": 4988928,
"scriptDurationMs": 416.395,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3181.761999999992,
"styleRecalcs": 64,
"styleRecalcDurationMs": 13.048999999999998,
"layouts": 60,
"layoutDurationMs": 6.829999999999999,
"taskDurationMs": 1467.467,
"heapDeltaBytes": -2109648,
"heapUsedBytes": 59700560,
"domNodes": -282,
"jsHeapTotalBytes": 7929856,
"scriptDurationMs": 544.231,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3182.0019999998976,
"styleRecalcs": 65,
"styleRecalcDurationMs": 13.611999999999995,
"layouts": 60,
"layoutDurationMs": 6.688999999999999,
"taskDurationMs": 1444.064,
"heapDeltaBytes": -2778232,
"heapUsedBytes": 58892148,
"domNodes": -281,
"jsHeapTotalBytes": 6356992,
"scriptDurationMs": 508.502,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2037.9080000000158,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.457000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 650.466,
"heapDeltaBytes": 6866496,
"heapUsedBytes": 67458732,
"domNodes": -274,
"jsHeapTotalBytes": 4784128,
"scriptDurationMs": 101.41699999999997,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2026.9169999999122,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.428,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 638.028,
"heapDeltaBytes": 7713584,
"heapUsedBytes": 68694616,
"domNodes": -277,
"jsHeapTotalBytes": 4259840,
"scriptDurationMs": 100.36500000000001,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 572.3810000000071,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.911,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 386.278,
"heapDeltaBytes": -12378012,
"heapUsedBytes": 55885892,
"domNodes": 18,
"jsHeapTotalBytes": 22413312,
"scriptDurationMs": 117.15799999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 581.3139999999066,
"styleRecalcs": 47,
"styleRecalcDurationMs": 10.283,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 389.155,
"heapDeltaBytes": -12336740,
"heapUsedBytes": 55872276,
"domNodes": 20,
"jsHeapTotalBytes": 22413312,
"scriptDurationMs": 117.31299999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 1994.132000000036,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.465999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 441.02200000000005,
"heapDeltaBytes": 3570320,
"heapUsedBytes": 71648892,
"domNodes": 22,
"jsHeapTotalBytes": 20316160,
"scriptDurationMs": 11.852,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2015.4400000000123,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.718000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 473.068,
"heapDeltaBytes": -21714652,
"heapUsedBytes": 46337436,
"domNodes": -273,
"jsHeapTotalBytes": 20443136,
"scriptDurationMs": 13.490999999999998,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1713.1769999999733,
"styleRecalcs": 76,
"styleRecalcDurationMs": 31.330999999999996,
"layouts": 16,
"layoutDurationMs": 3.4050000000000002,
"taskDurationMs": 728.9140000000001,
"heapDeltaBytes": -20795228,
"heapUsedBytes": 47337216,
"domNodes": -273,
"jsHeapTotalBytes": 20443136,
"scriptDurationMs": 77.706,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1713.9530000000605,
"styleRecalcs": 76,
"styleRecalcDurationMs": 31.961999999999996,
"layouts": 16,
"layoutDurationMs": 3.6969999999999996,
"taskDurationMs": 748.038,
"heapDeltaBytes": -20084996,
"heapUsedBytes": 48056972,
"domNodes": -273,
"jsHeapTotalBytes": 21229568,
"scriptDurationMs": 82.05900000000001,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1366.9849999999997,
"styleRecalcs": 19,
"styleRecalcDurationMs": 29.395000000000003,
"layouts": 15,
"layoutDurationMs": 12.399000000000001,
"taskDurationMs": 885.4200000000003,
"heapDeltaBytes": 30895172,
"heapUsedBytes": 99002080,
"domNodes": 13673,
"jsHeapTotalBytes": 16252928,
"scriptDurationMs": 32.502,
"eventListeners": 2375,
"totalBlockingTimeMs": 133,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8172.014999999988,
"styleRecalcs": 249,
"styleRecalcDurationMs": 33.575,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4126.804999999999,
"heapDeltaBytes": 1312040,
"heapUsedBytes": 60658660,
"domNodes": -277,
"jsHeapTotalBytes": 6881280,
"scriptDurationMs": 1324.395,
"eventListeners": -128,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8200.467000000004,
"styleRecalcs": 250,
"styleRecalcDurationMs": 34.939,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4237.689,
"heapDeltaBytes": 10529148,
"heapUsedBytes": 69624632,
"domNodes": -275,
"jsHeapTotalBytes": 6270976,
"scriptDurationMs": 1342.5430000000001,
"eventListeners": -128,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 15488.148000000023,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15431.712,
"heapDeltaBytes": -56243060,
"heapUsedBytes": 171825292,
"domNodes": -8312,
"jsHeapTotalBytes": -7540736,
"scriptDurationMs": 498.282,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 15173.568000000047,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15158.534,
"heapDeltaBytes": -44865020,
"heapUsedBytes": 165792472,
"domNodes": -8310,
"jsHeapTotalBytes": -15142912,
"scriptDurationMs": 494.356,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 19237.51599999997,
"styleRecalcs": 127,
"styleRecalcDurationMs": 12.836000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 19204.913,
"heapDeltaBytes": -68004824,
"heapUsedBytes": 156106196,
"domNodes": -8312,
"jsHeapTotalBytes": -10686464,
"scriptDurationMs": 804.579,
"eventListeners": -16383,
"totalBlockingTimeMs": 41,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 19388.058999999997,
"styleRecalcs": 131,
"styleRecalcDurationMs": 13.77499999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 19366.21,
"heapDeltaBytes": -45845856,
"heapUsedBytes": 176702096,
"domNodes": -8312,
"jsHeapTotalBytes": -7626752,
"scriptDurationMs": 839.2810000000001,
"eventListeners": -16385,
"totalBlockingTimeMs": 67,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 450.00500000003285,
"styleRecalcs": 14,
"styleRecalcDurationMs": 20.151,
"layouts": 4,
"layoutDurationMs": 1.4020000000000001,
"taskDurationMs": 116.55900000000001,
"heapDeltaBytes": -15948480,
"heapUsedBytes": 51022108,
"domNodes": 130,
"jsHeapTotalBytes": 8257536,
"scriptDurationMs": 10.126000000000001,
"eventListeners": 65,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 458.86000000007243,
"styleRecalcs": 13,
"styleRecalcDurationMs": 18.999,
"layouts": 3,
"layoutDurationMs": 0.6609999999999999,
"taskDurationMs": 104.569,
"heapDeltaBytes": -16252164,
"heapUsedBytes": 50700308,
"domNodes": 119,
"jsHeapTotalBytes": 7733248,
"scriptDurationMs": 8.796000000000001,
"eventListeners": 65,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
}
]
} |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## core/1.48 #14748 +/- ##
=============================================
+ Coverage 79.39% 79.53% +0.13%
=============================================
Files 1749 1749
Lines 99605 99617 +12
Branches 32671 31919 -752
=============================================
+ Hits 79082 79228 +146
+ Misses 20123 19988 -135
- Partials 400 401 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Backport of #14556 to
core/1.48Automatically created by backport workflow.