Commit Graph
6 Commits
Author SHA1 Message Date
solidlime bd275c4941 Major redesign: Direct file reading for single 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
2026-01-07 21:21:19 +09:00
solidlime f453a4fe47 Improve user guidance for file path input
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.
2026-01-07 21:12:14 +09:00
solidlime f7284990ed Fix: Add WEB_DIRECTORY and simplify JavaScript widget
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.
2026-01-07 21:04:57 +09:00
solidlime aef43bd2f8 Refactor: Simplify file picker and auto-extract folder path
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)
2026-01-07 20:59:15 +09:00
solidlime a990101377 Add preview and file browser features
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
2026-01-07 20:49:47 +09:00
solidlime 1f3bfe02ef Initial implementation of Random Image Picker node
- Single image and folder random selection modes
- Subfolder scanning support
- Resolution output (width/height)
- Seed control for reproducible random selection
- Support for PNG, JPEG, WebP, BMP, GIF formats
2026-01-07 20:09:11 +09:00