Skip to content

feat: add 20MB file size limit for uploads#28

Open
AdirAmsalem wants to merge 2 commits intomainfrom
feat/file-size-limit
Open

feat: add 20MB file size limit for uploads#28
AdirAmsalem wants to merge 2 commits intomainfrom
feat/file-size-limit

Conversation

@AdirAmsalem
Copy link
Contributor

Summary

  • Add client-side validation to reject files exceeding 20MB before sending to the API, preventing GPU timeouts from oversized video uploads (Lucy Edit Pro v2v supports up to 5s input)
  • Add FileTooLargeError exception class and MAX_FILE_SIZE constant
  • Add reference_image to FILE_FIELDS in both process and queue clients (was missing)

Changes

  • decart/errors.py — New MAX_FILE_SIZE constant + FileTooLargeError exception
  • decart/process/request.py — Size validation in send_request() after file_input_to_bytes()
  • decart/queue/request.py — Size validation in submit_job() after file_input_to_bytes()
  • decart/client.py — Added reference_image to FILE_FIELDS
  • decart/queue/client.py — Added reference_image to FILE_FIELDS
  • decart/__init__.py — Export FileTooLargeError and MAX_FILE_SIZE
  • tests/test_process.py — 2 new tests (over limit, at limit)
  • tests/test_queue.py — 1 new test (over limit)

Testing

  • 95 tests passing
  • Ruff lint clean
  • Black format clean

Add client-side validation to reject files exceeding 20MB before
sending to the API, preventing GPU timeouts from oversized uploads.

- Add MAX_FILE_SIZE constant and FileTooLargeError exception class
- Validate file size in both process and queue request handlers
- Add reference_image to FILE_FIELDS in process and queue clients
- Export FileTooLargeError and MAX_FILE_SIZE from package root
- Add unit tests for size limit enforcement
Add optional max_file_size field to ModelDefinition so models can
override the default 20MB limit. lucy-restyle-v2v (longform video)
gets a 100MB limit while all other models keep the 20MB default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant