Repository navigation
[backport cloud/1.48] fix(workflow): repair the A1111 import lifecycle and report broken installs accurately - #14749
Merged
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
comfy-pr-bot
enabled auto-merge (squash)
August 5, 2026 02:56
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
Contributor
🎭 Playwright: ✅ 1760 passed, 0 failed · 4 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook |
Contributor
🎨 Storybook: 🚧 Building... |
jaeone94
approved these changes
Aug 5, 2026
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## cloud/1.48 #14749 +/- ##
=============================================
Coverage ? 69.48%
=============================================
Files ? 1662
Lines ? 85960
Branches ? 22975
=============================================
Hits ? 59731
Misses ? 26120
Partials ? 109
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #14556 to
cloud/1.48Automatically created by backport workflow.