mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-13 09:00:16 +00:00
fix: refresh image previews on media upload nodes when refreshing node definitions (#9141)
## Summary - When pressing `R` to refresh node definitions, image previews on LoadImage/LoadVideo nodes now update to reflect external file changes - Re-triggers the combo widget callback to regenerate preview URLs with a fresh cache-busting `&rand=` parameter - Extracts `isMediaUploadComboInput` from `uploadImage.ts` to `nodeDefSchema.ts` as a shared utility - Fixes #2082 https://github.com/user-attachments/assets/d18d69ae-6ecd-448d-8d7c-76b2c49fdea5 ## Test plan - [ ] Open a workflow with a LoadImage node and select an image - [ ] Edit and save the image externally (e.g. in an image editor) - [ ] Press `R` to refresh node definitions - [ ] Verify the preview updates to show the edited image
This commit is contained in:
committed by
GitHub
parent
3b5649232d
commit
1f0ca18737
@@ -388,6 +388,16 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
|
||||
}
|
||||
}
|
||||
|
||||
function refreshNodeOutputs(node: LGraphNode) {
|
||||
const locatorId = nodeToNodeLocatorId(node)
|
||||
if (!locatorId) return
|
||||
|
||||
const outputs = app.nodeOutputs[locatorId]
|
||||
if (!outputs) return
|
||||
|
||||
nodeOutputs.value[locatorId] = { ...outputs }
|
||||
}
|
||||
|
||||
function resetAllOutputsAndPreviews() {
|
||||
app.nodeOutputs = {}
|
||||
nodeOutputs.value = {}
|
||||
@@ -433,6 +443,7 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
|
||||
setNodePreviewsByExecutionId,
|
||||
setNodePreviewsByNodeId,
|
||||
updateNodeImages,
|
||||
refreshNodeOutputs,
|
||||
syncLegacyNodeImgs,
|
||||
|
||||
// Cleanup
|
||||
|
||||
Reference in New Issue
Block a user