Skip to content

release 2.2.1; Fix dynamic node inputs lost when loading workflows from images/videos - #67

Merged
StableLlama merged 2 commits into
mainfrom
fix_64
Nov 3, 2026
Merged

StableLlama merged 2 commits into
mainfrom
fix_64

Conversation

@StableLlama

Copy link
Copy Markdown
Owner

Bump release to 2.2.1

Fixes #64

Problem

Loading a workflow by dragging a produced image/video back into ComfyUI
corrupted create DICT / create LIST style nodes: key_1, value_1,
key_2 ... silently disappeared and the container was created with only its
first entry. Loading the same workflow from a .json file worked fine.

Root cause

The workflow that ComfyUI embeds into generated media is serialized by
graphToPrompt() and post-processed with compressWidgetInputSlots(), which
removes every widget input slot that is both unconnected and unlabeled (a
leftover from legacy widget conversion). Normal nodes are unaffected because
their widget slots are re-created from the node definition.

For these dynamic nodes, key_1/value_1/key_2/... only exist because the
extension's JS created those slots, so they were stripped from the embedded
workflow while all their values stayed in widgets_values. On reload only the
connected slots survived, the node was rebuilt as key_0, value_0, value_2
plus one fresh empty pair, and positional widget restoration shifted the
values onto the wrong widgets.

Changes

web/js/dynamicnode.js:

  • Label every dynamically created widget input with its own name, which keeps
    it in the compressed workflow. This is a visual no-op, since the widget
    already displays its name.
  • New onConfigure hook stamps the same label on dynamic inputs restored from
    workflows saved before this change (they carry no label yet), so those
    workflows also survive the next queue.
  • renumberDynamicInputs keeps input and widget labels in sync with the new
    name, so a label never goes stale after clearing a pair.

pyproject.toml / CHANGELOG.md: version 2.2.1.

Testing

Verified in ComfyUI 0.43 (frontend 1.57.4) with the minimal workflow from the
report:

  • Before: the PNG's embedded workflow contained only value_0/value_2; the
    reloaded node came back as key_0=image, value_0='', value_2=image_name, key_1='', value_1=''.
  • After: the embedded workflow keeps all eight slots, dragging that PNG back in
    restores key_0=image, key_1=image_name, value_1=specialsquare, key_2=image_nature with the links on the right rows, the produced prompt
    contains every pair, and the reloaded workflow runs to success.
  • Also checked a generic dynamic node (DataListCreate), the clear/renumber
    path, and that node rendering is unchanged.

Note

Images and videos generated before this fix still carry the lossy embedded
workflow; only newly queued outputs are complete.

#64)

ComfyUI embeds a differently serialized copy of the workflow into the
images/videos a prompt produces: graphToPrompt() runs
compressWidgetInputSlots() on it, which removes every widget input slot
that has no link and no label - a leftover from legacy widget conversion.
For the dynamic nodes of this pack, key_1/value_1/key_2/... only exist
because the JS created those slots, so they were stripped while their
values stayed in widgets_values. On reload only the connected slots
survived, the node was rebuilt as key_0/value_0/value_2 plus one fresh
empty pair, and the positional widget restoration shifted every value
into the wrong widget - the DICT came back with only its first key.

Label dynamically created widget inputs with their own name, so they are
kept in the compressed workflow. This is a visual no-op, as the widget
shows its name anyway. Workflows saved before the label existed carry
none, so onConfigure stamps it on every restored dynamic widget input.
Renumbering now keeps input and widget labels in sync with the new name.

Verified in ComfyUI 0.43 (frontend 1.57.4): loading the PNG produced by
the minimal workflow of the report restores all key/value pairs, that
recreated workflow runs, and clearing a pair still renumbers correctly.
Patch release for the two dynamic input fixes that landed after 2.2.0:
clearing a key/value pair corrupting the node, and workflows recreated from
a produced image/video losing their extra pairs. The changelog section
doubles as the release notes for the Comfy registry, which the publish
workflow extracts from CHANGELOG.md.
@StableLlama
StableLlama merged commit c82cde0 into main Nov 3, 2026
5 checks passed
@StableLlama
StableLlama deleted the fix_64 branch November 3, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"create DICT" node recreated via dragging of produced video/image into ComfyUI is corrupted

1 participant