Comfy-Org / Comfy-Org/ComfyUI_frontend

[Bug] Upload widgets do not have their linked widgets (preview and upload button) promoted alongside them when attached to subgraph input

Open
#4,841 0 comments 1 reaction 1 assignee Claimed by @christian-byrne View on GitHub
area:previews area:subgraph area:widgets verified bug
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 3h
Merged PRs (30d)
495

Description

Currently the widgets that have flags like `image_upload`, `video_upload`, `animated_image_upload`, `audio_upload` get an *input* added at runtime when the node def is being registered (in `beforeRegisterNodeDef` hook):

https://github.com/Comfy-Org/ComfyUI_frontend/blob/95ab88693c78d84bda7978063bdbbc2c9d67eed1/src/extensions/core/uploadImage.ts.

The "real" widget (not added at runtime) is just the COMBO file selection. In the ideal design, when this COMBO is promoted to a subgraph node, the preview and upload button widgets are promoted along with it.

However, various challenges arise:

- Need to check the static node definition when creating added promoted widgets
- The actual preview widget implementation also relies on checking the node definition, but the subgraph node naturally will not have the same special flags
- Need to handle cleanup when the subgraph node is removed
- Need to handle cleaning up the runtime widgets when the input is disconnected (file combo is demoted)

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-4841-Bug-Upload-widgets-do-not-have-their-linked-widgets-preview-and-upload-button-prom-2496d73d36508151a62bc704b5b9ace4) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.