-
Notifications
You must be signed in to change notification settings - Fork 371
[feature] Add text and PDF file upload support #3947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
94a2aa2
to
eca9e3d
Compare
3bdcb68
to
53ccd4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires changes to core in followup:
- Update node typings
- Add
upload/text-file
route handler
Adds allow_batch configuration support to text upload widgets, enabling multiple file uploads when specified. Changes include: - Support for allow_batch input specification - Batch file processing with uploadTextFiles function - Value transform logic for single vs array outputs - Dynamic button text (file/files) based on batch mode - Translation keys for plural file selection
Co-authored-by: filtered <[email protected]>
- Use proper discriminated unions instead of manual type checking - Replace 'any' types with 'unknown' for better type safety - Update naming: TEXTUPLOAD → TEXT_FILE_UPLOAD, text_upload → text_file_upload - Extract constants for maintainability (SUPPORTED_FILE_TYPES, TEXT_FILE_UPLOAD) - Convert to V2 widget pattern with ComfyWidgetConstructorV2 - Self-documenting function names replacing comments - Clean error handling with proper type guards Addresses all PR review feedback for improved code quality and consistency.
648e17f
to
1989561
Compare
It might be better to generalize this process. That is, we make an API whereby nodes can declare they want to support upload connected to a specific COMBO widget, while also specifying the mimetype and fileextension list (same format as the Otherwise, we will be adding all this boiler plate for each new input file type, which will be harder to propogate bug fixes across. |
Replace this PR with #4071 after it has been implemented. |
Will be redone in Vue Nodes more easily, no longer necessary. |
Adds support for text file uploads in ComfyUI nodes, similar to how image and video uploads are handled. This allows for text files (including PDFs) to be uploaded via a button, drag-and-drop, or clipboard paste.\n\nNodes can use the new 'text_upload: true' flag on combo inputs to enable this functionality.
┆Issue is synchronized with this Notion page by Unito