File picker previously embedded base64 image data in the image_data widget, bloating workflow JSON past the 5MiB localStorage limit (Failed to save workflow draft). Now uploads via POST /upload/image with type=temp and stores a small '<path> [temp]' reference; backend resolves it with get_annotated_filepath. Base64 data URLs from older saves still load via backward-compat path.
Changes:
1. Complete widget hiding:
- Added .hidden = true
- Added setTimeout for reliability
- Added serializeValue to preserve data
2. Instant preview on file load:
- Create Image object from base64
- Set node.imgs for preview display
- Call setSizeForImage() and setDirtyCanvas()
- Preview shows immediately without execution
Now has clean UI and instant visual feedback!
Added JavaScript to hide the image_data widget:
- Set type to 'converted-widget'
- Set computeSize to [0, -4] to hide it
The widget still functions (auto-filled by file picker)
but is no longer visible in the UI for cleaner look.
Changes:
- Moved image_data from optional to required (no forceInput)
- image_data is now a multiline STRING widget (auto-filled by file picker)
- Removed alert() and console.log() messages
- Store base64 data in both node.properties and widget.value
This fixes the 'object supporting the buffer API required' error
by ensuring image_data widget exists and can be set by JavaScript.
Changes:
- folder_mode=True: Always use folder_path for random selection
- folder_mode=False: Always use file picker (image_data)
- Auto-switch: File picker automatically sets folder_mode=False
Behavior:
- User clicks 📁 Choose File → auto-switches to Single mode
- folder_mode toggle explicitly controls which input to use
- No more auto-detection ambiguity
- Clear separation between modes
Benefits:
- Predictable behavior based on folder_mode setting
- File picker prioritized by auto-switching to Single mode
- User can maintain folder_path while using file picker
- Cleaner error messages for each mode
Breaking changes:
- Single mode: Now uses file picker with direct browser-based image reading
- Folder mode: Uses manual path input only
- Renamed 'image' parameter to 'folder_path' for clarity
- Added 'image_data' optional parameter for base64 image data
Implementation:
- JavaScript: FileReader API to read image as base64
- Python: Decode base64 and convert to tensor (no file system access needed)
- Better UX: No confusing error messages about missing paths
- Clear separation: File picker for single, text input for folder
Benefits:
- Single mode works without file system paths
- No browser security issues
- Cleaner user experience
- Explicit mode separation
Changes:
- Added tooltips to all input parameters explaining their purpose
- Enhanced alert dialog with detailed instructions and examples
- Shows current default path in the alert
- Better formatting for multi-line instructions
- Added dynamicPrompts: false to image input for better UX
Note: Browser security prevents automatic full path detection.
Users need to manually enter the complete file path after using the file picker.
Critical fixes:
- Added WEB_DIRECTORY = './web' to __init__.py (REQUIRED for ComfyUI to load JS)
- Simplified JavaScript implementation based on working custom nodes
- Removed unnecessary imports (ComfyWidgets)
- Cleaner button implementation that actually registers
This should now properly load the JavaScript widget when ComfyUI starts.
Major changes:
- Changed input parameter from 'path' to 'image' for clarity
- Auto-extract folder path from file selection in folder mode
- Simplified JavaScript widget implementation
- Added OUTPUT_IS_LIST flag for proper output handling
- Improved file selection UI with emoji icons
- Added helpful info widget explaining the modes
Features:
- Single mode: Load selected file directly
- Folder mode: Extract folder from selected file, then pick random image
- Better user feedback with console logging
- More robust path handling (file or directory input)
Features:
- Added OUTPUT_NODE for real-time image preview
- Implemented Browse button with JavaScript widget
- Enhanced path input with placeholder and default value
- Updated README with new feature documentation
Changes:
- random_image_picker.py: Added OUTPUT_NODE, improved INPUT_TYPES
- web/random_image_picker.js: New custom widget for file/folder selection
- README.md: Updated documentation with new features
- .gitignore: Added web directory ignore patterns