diff --git a/random_image_picker.py b/random_image_picker.py index f64115f..80c3c80 100644 --- a/random_image_picker.py +++ b/random_image_picker.py @@ -31,21 +31,26 @@ class RandomImagePicker: "image": ("STRING", { "default": default_path, "multiline": False, + "dynamicPrompts": False, + "tooltip": "Enter full path to image file (Single mode) or folder (Folder mode). Use 📁 button to help select." }), "folder_mode": ("BOOLEAN", { "default": False, "label_on": "Folder", - "label_off": "Single" + "label_off": "Single", + "tooltip": "Single: Load specific file | Folder: Random from folder" }), "include_subfolders": ("BOOLEAN", { "default": False, "label_on": "ON", - "label_off": "OFF" + "label_off": "OFF", + "tooltip": "Include subfolders when scanning in Folder mode" }), "seed": ("INT", { "default": 0, "min": 0, - "max": 0xffffffffffffffff + "max": 0xffffffffffffffff, + "tooltip": "Random seed for reproducible selection in Folder mode" }), }, } diff --git a/web/random_image_picker.js b/web/random_image_picker.js index ecde3e5..a8c80cb 100644 --- a/web/random_image_picker.js +++ b/web/random_image_picker.js @@ -23,10 +23,23 @@ app.registerExtension({ const imageWidget = node.widgets.find(w => w.name === "image"); if (imageWidget) { - // Update with file name (user needs to provide full path) - imageWidget.value = file.name; - console.log("Selected file:", file.name); - alert(`File selected: ${file.name}\n\nPlease enter the full path to this file in the text field above.`); + // Show selected file name + const fileName = file.name; + console.log("Selected file:", fileName); + + // Show dialog with instructions + const currentPath = imageWidget.value || ""; + const dialogText = `File selected: ${fileName}\n\n` + + `⚠️ IMPORTANT:\n` + + `Due to browser security, the full path cannot be automatically detected.\n\n` + + `Please copy and paste the FULL PATH to this file in the 'image' field above.\n\n` + + `Example:\n` + + `D:\\Images\\${fileName}\n` + + `or\n` + + `C:\\Users\\YourName\\Pictures\\${fileName}\n\n` + + `Current default: ${currentPath || '(not set)'}`; + + alert(dialogText); } } };