-
Notifications
You must be signed in to change notification settings - Fork 523
Closed
Labels
Description
Summary
After saving a mask in the mask editor, the Load Image node shows a blank image. Switching to another workflow tab and back fixes it (visual refresh/reactivity bug).
Reported in: Comfy-Org/ComfyUI#12918
Root Cause
In useMaskEditorSaver.ts, updateNodeWithServerReferences uses a fragile double-write pattern:
imageWidget.callback?.(widgetValue)triggers theuseImageUploadWidgetcallback- The callback calls
setNodeOutputs(node, annotatedString)whereannotatedString="clipspace/clipspace-painted-masked-xxx.png [input]" setNodeOutputs→createOutputs→parseFilePathkeeps[input]in the filename → creates outputs with filename"clipspace-painted-masked-xxx.png [input]"(does not exist on server)- Then
updateNodeImages(node)is called to overwriteimageswith correctnode.images updateNodeImagesusesnodeIdToNodeLocatorId(node.id)(depends onactiveSubgraph.value), whilesetNodeOutputsusesnodeToNodeLocatorId(node)(usesnode.graph). If these produce different locator IDs, the correction writes to a different key and the broken output remains
Tab switching fixes it because restoreOutputs replaces the entire reactive ref, forcing re-evaluation.
Fix
Replace the double-write with a single correct call to setNodeOutputs using createAnnotatedPath to format the path properly, ensuring consistent locator ID usage and correct filename parsing.
┆Issue is synchronized with this Notion page by Unito
Reactions are currently unavailable