invoke-ai / invoke-ai/InvokeAI
[enhancement]: Add managed file inputs for custom nodes
- Dominant language
- Python
- Stars
- 28.2k
- Forks
- 3k
- Avg merge
- 6d 5h
- Merged PRs (30d)
- 19
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Contact Details
_No response_
### What should this feature add?
I would like custom nodes to be able to accept user-uploaded document/data files from the browser, without requiring the file to already exist on the InvokeAI server.
A concrete use case is a custom node that accepts a PDF, Markdown file, text file, CSV, JSON, or YAML file and processes it in Python. For example, a node may upload a PDF to an external document-processing service, parse a CSV, or load structured data from JSON/YAML.
Today this is difficult in hosted InvokeAI deployments. A string path only works when the file is already visible to the server, which is not true when a user accesses a remote InvokeAI instance from their own browser. The existing upload flow is image-specific and tied to `ImageField`, image DTOs, thumbnails, and image upload APIs.
A lightweight first version could focus only on node inputs:
- Add a managed `FileField` or equivalent invocation input type
- Let users upload/select/remove a file directly from the node input UI
- Store the uploaded file in a server-managed location
- Pass a stable file reference to the invocation instead of a local path or file contents
- Expose a safe server-side API such as `context.files.get_path(file_id)` or similar
- Validate uploads with extension/MIME allowlists and size limits
### Alternatives
The current alternatives do not solve the hosted custom-node use case:
- Passing a string path only works when the file already exists on the server.
- Reusing `ImageField` is not appropriate because it is image-specific.
- Encoding files into text/base64 values would bloat workflow and queue data.
### Additional Content
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.