mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 05:49:54 +00:00
Add support for image_folder field in node image input spec (#2509)
This commit is contained in:
@@ -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?.()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user