Fixed Load Image preview not displaying some files (issue #1158)
diff --git a/web/scripts/widgets.js b/web/scripts/widgets.js
index 45ac9b8962..9755776312 100644
--- a/web/scripts/widgets.js
+++ b/web/scripts/widgets.js
@@ -335,7 +335,7 @@ export const ComfyWidgets = {
 				subfolder = name.substring(0, folder_separator);
 				name = name.substring(folder_separator + 1);
 			}
-			img.src = api.apiURL(`/view?filename=${name}&type=input&subfolder=${subfolder}${app.getPreviewFormatParam()}`);
+			img.src = api.apiURL(`/view?filename=${encodeURIComponent(name)}&type=input&subfolder=${subfolder}${app.getPreviewFormatParam()}`);
 			node.setSizeForImage?.();
 		}
 

Fixed issue #1158.