Shrimbly
2b0a9d146d
feat: extend media externalization to support videos and audio
Rename imageStorage.ts to mediaStorage.ts and extend it to handle
all media types (images, videos, audio) to prevent workflow files
from exceeding 500MB.
Key changes:
- Add utility functions isHttpUrl() and isDataUrl()
- Add saveVideoAndGetRef() and saveAudioAndGetRef() helpers
- Add 9 missing node type cases to externalization:
* audioInput - externalize base64 audio
* generate3D - externalize input images
* generateVideo - externalize base64 videos, keep HTTP URLs
* generateAudio - externalize base64 audio, keep HTTP URLs
* imageCompare - externalize both comparison images
* videoStitch - clear transient output video and thumbnails
* easeCurve - clear derived output video
* videoTrim - clear derived output video
* videoFrameGrab - clear derived output image
* glbViewer - externalize captured viewport image
- Add corresponding hydration cases for all new node types
- Update workflowStore.ts to use new function names
- Add ref field copying for video/audio refs on save
Strategy:
- Externalize base64 data URLs (huge size reduction)
- Keep HTTP URLs (small, backward compatible)
- Clear transient/derived content (regenerated on execution)
Expected file size reduction: 500MB+ → <5MB for typical workflows
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
4 months ago