Add support for image_folder field in node image input spec (#2509)

This commit is contained in:
bymyself
2025-02-10 22:12:03 -07:00
committed by GitHub
parent a93f57eeb2
commit e4f8d4b8d0
3 changed files with 14 additions and 4 deletions

View File

@@ -433,6 +433,7 @@ export const ComfyWidgets: Record<string, ComfyWidgetConstructor> = {
(w) => w.name === (inputData[1]?.widget ?? 'image')
) as IStringWidget
let uploadWidget
const { image_folder = 'input' } = inputData[1] ?? {}
function showImage(name) {
const img = new Image()
@@ -447,7 +448,7 @@ export const ComfyWidgets: Record<string, ComfyWidgetConstructor> = {
name = name.substring(folder_separator + 1)
}
img.src = api.apiURL(
`/view?filename=${encodeURIComponent(name)}&type=input&subfolder=${subfolder}${app.getPreviewFormatParam()}${app.getRandParam()}`
`/view?filename=${encodeURIComponent(name)}&type=${image_folder}&subfolder=${subfolder}${app.getPreviewFormatParam()}${app.getRandParam()}`
)
node.setSizeForImage?.()
}