Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Summary

Adds support for TIFF files (including multi-page TIFFs) to both the image and document generate CLI commands. Multi-page TIFFs are handled similarly to PDFs - each page/frame is extracted and passed as separate images to the API.

Changes:

  • New vlmrun/common/tiff.py utility for extracting pages from multi-page TIFF files using PIL
  • Added .tif to SUPPORTED_IMAGE_FILETYPES and both .tif/.tiff to SUPPORTED_DOCUMENT_FILETYPES
  • Updated CLI generate image command to handle multi-page TIFFs
  • Updated CLI generate document command to convert TIFFs to images and route through image.generate() instead of document.generate()
  • Version bump to 0.17.18

Review & Testing Checklist for Human

  • Verify version 0.17.18 is correct - This is a significant jump from 0.5.4. Confirm this is the intended version number.
  • Test with actual multi-page TIFF files - The implementation was not tested with real TIFF files. Verify that:
    • Single-page TIFFs work correctly in both image and document commands
    • Multi-page TIFFs correctly extract all frames
    • The extracted images are properly converted to RGB and passed to the API
  • Verify TIFF document routing behavior - TIFFs in the document command are routed through client.image.generate() rather than client.document.generate(). Confirm this is the expected behavior.

Suggested test plan:

# Test single-page TIFF with image command
vlmrun generate image /path/to/single-page.tif --domain document.invoice

# Test multi-page TIFF with image command  
vlmrun generate image /path/to/multi-page.tif --domain document.invoice

# Test multi-page TIFF with document command
vlmrun generate document /path/to/multi-page.tiff --domain document.invoice

Notes

- Add tiff.py utility for extracting pages from multi-page TIFF files
- Add .tif to SUPPORTED_IMAGE_FILETYPES
- Add .tif and .tiff to SUPPORTED_DOCUMENT_FILETYPES
- Update CLI generate.py to handle multi-page TIFFs in both image and document commands
- Update version to 0.17.18

Co-Authored-By: dinesh@vlm.run <dinesh@vlm.run>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants