Repository navigation
[backport cloud/1.49] fix(workflow): repair the A1111 import lifecycle and report broken installs accurately - #14751
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: ✅ 1783 passed, 0 failed · 4 flaky📊 Browser Reports
📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-08-05T03:08:05.814Z",
"gitSha": "27412119c7b51039138e5809a6eaef0e9177b414",
"branch": "backport-14556-to-cloud-1.49",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2028.6909999999807,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.407000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 407.791,
"heapDeltaBytes": 5033384,
"heapUsedBytes": 73308192,
"domNodes": 20,
"jsHeapTotalBytes": 19779584,
"scriptDurationMs": 17.453000000000003,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-idle",
"durationMs": 2011.634000000015,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.683000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 380.981,
"heapDeltaBytes": 5001244,
"heapUsedBytes": 72978080,
"domNodes": 22,
"jsHeapTotalBytes": 20303872,
"scriptDurationMs": 13.71,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1745.3510000000279,
"styleRecalcs": 72,
"styleRecalcDurationMs": 31.377000000000002,
"layouts": 12,
"layoutDurationMs": 3.093,
"taskDurationMs": 714.1569999999999,
"heapDeltaBytes": -610752,
"heapUsedBytes": 67371708,
"domNodes": 57,
"jsHeapTotalBytes": 20828160,
"scriptDurationMs": 94.692,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1692.655000000002,
"styleRecalcs": 73,
"styleRecalcDurationMs": 27.257,
"layouts": 12,
"layoutDurationMs": 2.862,
"taskDurationMs": 660.8230000000001,
"heapDeltaBytes": -413204,
"heapUsedBytes": 67843732,
"domNodes": 55,
"jsHeapTotalBytes": 21090304,
"scriptDurationMs": 91.906,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1679.460000000006,
"styleRecalcs": 30,
"styleRecalcDurationMs": 14.864999999999998,
"layouts": 6,
"layoutDurationMs": 0.5900000000000001,
"taskDurationMs": 363.80899999999997,
"heapDeltaBytes": 7882676,
"heapUsedBytes": 76127316,
"domNodes": 78,
"jsHeapTotalBytes": 20303872,
"scriptDurationMs": 23.558000000000003,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1707.5989999999592,
"styleRecalcs": 31,
"styleRecalcDurationMs": 13.271,
"layouts": 6,
"layoutDurationMs": 0.485,
"taskDurationMs": 300.558,
"heapDeltaBytes": 8086640,
"heapUsedBytes": 76431772,
"domNodes": 76,
"jsHeapTotalBytes": 20041728,
"scriptDurationMs": 15.374,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 532.3819999999841,
"styleRecalcs": 12,
"styleRecalcDurationMs": 6.809999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 317.13,
"heapDeltaBytes": -12410968,
"heapUsedBytes": 56035300,
"domNodes": 20,
"jsHeapTotalBytes": 22138880,
"scriptDurationMs": 48.45,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "dom-widget-clipping",
"durationMs": 520.9969999999657,
"styleRecalcs": 11,
"styleRecalcDurationMs": 6.401000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 307.924,
"heapDeltaBytes": -12433840,
"heapUsedBytes": 55553792,
"domNodes": 18,
"jsHeapTotalBytes": 22138880,
"scriptDurationMs": 46.525999999999996,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.669999999999998,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "large-graph-idle",
"durationMs": 2020.939999999996,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.054,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 582.9490000000001,
"heapDeltaBytes": 6852916,
"heapUsedBytes": 67928328,
"domNodes": -280,
"jsHeapTotalBytes": 4513792,
"scriptDurationMs": 87.416,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2026.0039999999435,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.258,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 553.825,
"heapDeltaBytes": 8414568,
"heapUsedBytes": 69732444,
"domNodes": -279,
"jsHeapTotalBytes": 4775936,
"scriptDurationMs": 81.045,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2084.214999999972,
"styleRecalcs": 69,
"styleRecalcDurationMs": 14.124,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1014.426,
"heapDeltaBytes": 4876852,
"heapUsedBytes": 64608948,
"domNodes": -283,
"jsHeapTotalBytes": 4739072,
"scriptDurationMs": 326.09499999999997,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2106.8930000000137,
"styleRecalcs": 68,
"styleRecalcDurationMs": 14.872000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1067.416,
"heapDeltaBytes": 4399660,
"heapUsedBytes": 66460860,
"domNodes": -283,
"jsHeapTotalBytes": 4214784,
"scriptDurationMs": 345.455,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3185.4620000000295,
"styleRecalcs": 66,
"styleRecalcDurationMs": 15.452999999999998,
"layouts": 60,
"layoutDurationMs": 8.036999999999999,
"taskDurationMs": 1388.757,
"heapDeltaBytes": -1449612,
"heapUsedBytes": 60454492,
"domNodes": -286,
"jsHeapTotalBytes": 7659520,
"scriptDurationMs": 482.0059999999999,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3137.6999999999953,
"styleRecalcs": 66,
"styleRecalcDurationMs": 13.797,
"layouts": 60,
"layoutDurationMs": 7.0809999999999995,
"taskDurationMs": 1262.8940000000002,
"heapDeltaBytes": -5345660,
"heapUsedBytes": 56243172,
"domNodes": -285,
"jsHeapTotalBytes": 7397376,
"scriptDurationMs": 437.12899999999996,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2017.9469999999924,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.853999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 707.3549999999999,
"heapDeltaBytes": 7897464,
"heapUsedBytes": 69067136,
"domNodes": -285,
"jsHeapTotalBytes": 4775936,
"scriptDurationMs": 110.286,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2021.5759999999818,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.21,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 544.704,
"heapDeltaBytes": 251332,
"heapUsedBytes": 60851912,
"domNodes": -281,
"jsHeapTotalBytes": 4513792,
"scriptDurationMs": 79.43599999999999,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 556.3549999999964,
"styleRecalcs": 47,
"styleRecalcDurationMs": 16.315,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 363.642,
"heapDeltaBytes": -10986220,
"heapUsedBytes": 57183680,
"domNodes": 20,
"jsHeapTotalBytes": 21614592,
"scriptDurationMs": 108.263,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 522.7729999999156,
"styleRecalcs": 48,
"styleRecalcDurationMs": 10.748,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 331.67999999999995,
"heapDeltaBytes": -12226888,
"heapUsedBytes": 55976100,
"domNodes": 22,
"jsHeapTotalBytes": 22138880,
"scriptDurationMs": 98.78,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-idle",
"durationMs": 2021.1990000000242,
"styleRecalcs": 11,
"styleRecalcDurationMs": 9.226,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 385.86199999999997,
"heapDeltaBytes": 4991140,
"heapUsedBytes": 73421636,
"domNodes": 22,
"jsHeapTotalBytes": 20041728,
"scriptDurationMs": 13.193000000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 1997.2009999999045,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.805999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 369.745,
"heapDeltaBytes": 4816688,
"heapUsedBytes": 73067536,
"domNodes": 20,
"jsHeapTotalBytes": 20303872,
"scriptDurationMs": 11.706,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1697.9570000000308,
"styleRecalcs": 76,
"styleRecalcDurationMs": 29.035,
"layouts": 16,
"layoutDurationMs": 3.423,
"taskDurationMs": 645.671,
"heapDeltaBytes": -22172624,
"heapUsedBytes": 46130452,
"domNodes": 20,
"jsHeapTotalBytes": 20168704,
"scriptDurationMs": 76.296,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1702.3020000000315,
"styleRecalcs": 76,
"styleRecalcDurationMs": 29.647,
"layouts": 16,
"layoutDurationMs": 3.458,
"taskDurationMs": 629.855,
"heapDeltaBytes": -4443460,
"heapUsedBytes": 63892164,
"domNodes": 64,
"jsHeapTotalBytes": 21090304,
"scriptDurationMs": 77.30499999999999,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-transition-enter",
"durationMs": 911.4969999999971,
"styleRecalcs": 18,
"styleRecalcDurationMs": 23.35700000000001,
"layouts": 14,
"layoutDurationMs": 9.323000000000002,
"taskDurationMs": 735.2019999999999,
"heapDeltaBytes": 8485720,
"heapUsedBytes": 100992016,
"domNodes": 13673,
"jsHeapTotalBytes": 11272192,
"scriptDurationMs": 22.637000000000004,
"eventListeners": 2373,
"totalBlockingTimeMs": 85,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8204.553999999973,
"styleRecalcs": 250,
"styleRecalcDurationMs": 41.033,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4017.0099999999998,
"heapDeltaBytes": 11649312,
"heapUsedBytes": 70474352,
"domNodes": -281,
"jsHeapTotalBytes": 7098368,
"scriptDurationMs": 1183.871,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8155.7849999999235,
"styleRecalcs": 250,
"styleRecalcDurationMs": 38.244,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3541.638,
"heapDeltaBytes": 9764192,
"heapUsedBytes": 70711880,
"domNodes": -279,
"jsHeapTotalBytes": 5787648,
"scriptDurationMs": 1068.163,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 14880.869000000019,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14869.150000000001,
"heapDeltaBytes": -59817988,
"heapUsedBytes": 154949768,
"domNodes": -8312,
"jsHeapTotalBytes": -14360576,
"scriptDurationMs": 440.473,
"eventListeners": -16391,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 14663.869999999974,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14629.627,
"heapDeltaBytes": -42718172,
"heapUsedBytes": 168332796,
"domNodes": -8312,
"jsHeapTotalBytes": -9375744,
"scriptDurationMs": 489.52799999999996,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17583.340000000022,
"styleRecalcs": 122,
"styleRecalcDurationMs": 15.954000000000024,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17562.791999999998,
"heapDeltaBytes": -49679264,
"heapUsedBytes": 156465400,
"domNodes": -8312,
"jsHeapTotalBytes": -10162176,
"scriptDurationMs": 729.2639999999999,
"eventListeners": -16385,
"totalBlockingTimeMs": 14,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17357.981999999993,
"styleRecalcs": 121,
"styleRecalcDurationMs": 15.444000000000013,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17326.054,
"heapDeltaBytes": -42813896,
"heapUsedBytes": 164584192,
"domNodes": -8312,
"jsHeapTotalBytes": -11997184,
"scriptDurationMs": 755.196,
"eventListeners": -16387,
"totalBlockingTimeMs": 37,
"frameDurationMs": 17.226666666666762,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "workflow-execution",
"durationMs": 468.61999999998716,
"styleRecalcs": 16,
"styleRecalcDurationMs": 17.587,
"layouts": 3,
"layoutDurationMs": 0.5690000000000001,
"taskDurationMs": 111.81500000000001,
"heapDeltaBytes": -15486972,
"heapUsedBytes": 51697652,
"domNodes": 136,
"jsHeapTotalBytes": 7720960,
"scriptDurationMs": 8.407,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.669999999999998,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "workflow-execution",
"durationMs": 439.8400000000038,
"styleRecalcs": 14,
"styleRecalcDurationMs": 17.895,
"layouts": 3,
"layoutDurationMs": 0.538,
"taskDurationMs": 103.494,
"heapDeltaBytes": -15743580,
"heapUsedBytes": 51815544,
"domNodes": 123,
"jsHeapTotalBytes": 7458816,
"scriptDurationMs": 8.171000000000001,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
}
]
} |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## cloud/1.49 #14751 +/- ##
=============================================
Coverage ? 78.73%
=============================================
Files ? 1789
Lines ? 104451
Branches ? 32885
=============================================
Hits ? 82243
Misses ? 21778
Partials ? 430
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Backport of #14556 to
cloud/1.49Automatically created by backport workflow.