Repository navigation
release 2.2.1; Fix dynamic node inputs lost when loading workflows from images/videos - #67
Merged
Merged
Conversation
#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.
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.
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 LISTstyle nodes:key_1,value_1,key_2... silently disappeared and the container was created with only itsfirst entry. Loading the same workflow from a
.jsonfile worked fine.Root cause
The workflow that ComfyUI embeds into generated media is serialized by
graphToPrompt()and post-processed withcompressWidgetInputSlots(), whichremoves 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 theextension's JS created those slots, so they were stripped from the embedded
workflow while all their values stayed in
widgets_values. On reload only theconnected slots survived, the node was rebuilt as
key_0, value_0, value_2plus one fresh empty pair, and positional widget restoration shifted the
values onto the wrong widgets.
Changes
web/js/dynamicnode.js:it in the compressed workflow. This is a visual no-op, since the widget
already displays its name.
onConfigurehook stamps the same label on dynamic inputs restored fromworkflows saved before this change (they carry no label yet), so those
workflows also survive the next queue.
renumberDynamicInputskeeps input and widget labels in sync with the newname, 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:
value_0/value_2; thereloaded node came back as
key_0=image, value_0='', value_2=image_name, key_1='', value_1=''.restores
key_0=image, key_1=image_name, value_1=specialsquare, key_2=image_naturewith the links on the right rows, the produced promptcontains every pair, and the reloaded workflow runs to
success.DataListCreate), the clear/renumberpath, 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.