Comfy-Org / Comfy-Org/ComfyUI_frontend
serialize() drops a live size for missing-node placeholders (pos is preserved, size is not)
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
Resizing a missing-node placeholder loses the resize on save.
`LGraphNode.serialize()`, `src/lib/litegraph/src/LGraphNode.ts:1218-1219`:
```ts
if (this.constructor === LGraphNode && this.last_serialization)
return { ...this.last_serialization, mode: o.mode, pos: o.pos }
```
`pos` is overridden from the live value. `size` is not — it comes back out of `last_serialization`, i.e. whatever the workflow file said before the node type went missing.
Verified by execution at `5002fae1b12d44831a21367afa7c0f798f7e7a2c`: a placeholder whose `last_serialization.size` is `[300, 400]`, resized live to `[700, 800]`, serialises as `[300, 400]`. Position round-trips correctly; size does not.
User-visible path: install a workflow that uses a node pack you do not have. ComfyUI creates an `LGraphNode` placeholder with `has_errors = true` and keeps `last_serialization` so the original data is not lost. Drag it — the new position saves. Resize it so its error text is readable — the new size does not.
**Pre-existing.** Byte-identical at the merge base `6532665db9`, so this is not an ECS regression and not a #14246 problem. Filing separately because it is a small, self-contained correctness bug that the geometry review happened to surface: the fix is to add `size: o.size` alongside `pos: o.pos`, if `size` was intended to be preserved from the file rather than from the user.
Worth confirming the intent before changing it — there may be a reason `pos` was singled out that is not in the code.
`git blame` on the line lands on `aff7f2a296` (`#8070`), a 2,238-file / +612,812-line bulk import, so blame does not identify an author here. Leaving this unassigned.
Related: #15620, #15618, #15594, #15577. Found reviewing #14246 (slice C3, layout/geometry).
Contributor guide
Research direction
Start at src/lib/litegraph/src/LGraphNode.ts:1218-1219 and inspect how LGraphNode.serialize() handles missing-node placeholders and their last_serialization data. Confirm the intended preservation behavior, then verify that a live resize is retained when the placeholder is serialized while the original position and workflow data remain intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100