mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-13 17:10:06 +00:00
Fix linked asset widget promotion in vue (#7895)
Asset widgets resolve the list of models by checking the name of the node the widget is contained on. When an asset widget is linked to a subgraph node, a clone is made of the widget and then the clone is used to initialize an asset widget in vue mode. Since the widget no longer holds any form of reference to the original node, asset data fails to resolve. This is fixed by storing the original nodeType as an option on the cloned widget when an asset widget is linked to a subgraph input. | Before | After | | ------ | ----- | | <img width="360" alt="before" src="https://github.com/user-attachments/assets/345f9cc1-da04-44ab-8fed-76379c8528de"/> | <img width="360" alt="after" src="https://github.com/user-attachments/assets/88d1ddaa-56fb-41b3-8d5d-0ded02aaa7d2" />| See also #7563, #7560 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7895-Fix-linked-asset-widget-promotion-in-vue-2e26d73d365081e5b295f6236458b978) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -60,8 +60,9 @@ const combinedProps = computed(() => ({
|
||||
}))
|
||||
|
||||
const getAssetData = () => {
|
||||
if (props.isAssetMode && props.nodeType) {
|
||||
return useAssetWidgetData(toRef(() => props.nodeType))
|
||||
const nodeType = props.widget.options?.nodeType ?? props.nodeType
|
||||
if (props.isAssetMode && nodeType) {
|
||||
return useAssetWidgetData(toRef(nodeType))
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user