Transform your ordinary photos into enchanting Studio Ghibli style artwork using Fal.ai's Ghiblify API.
-
Ensure you have your FAL API key set in your
.envfile:FAL_KEY=your_api_key_here -
Install dependencies (already done):
bun install
bun index.ts <image-file># Process an image
bun index.ts photo.jpg- JPEG (.jpg, .jpeg)
- PNG (.png)
- WebP (.webp)
- GIF (.gif)
- BMP (.bmp)
Maximum file size: 50MB
Generated images are saved in the ./output/ directory with the naming pattern:
ghiblified_<original_filename>.png
The application follows a clean architecture with separation of concerns:
src/types.ts- Type definitionssrc/utils/- Utility functions (validation, upload, download, CLI parsing)src/services/- API service layerindex.ts- Main application orchestration
The tool handles various error scenarios:
- Missing or invalid files
- Unsupported file formats
- File size limits
- Network issues
- API errors
- Missing environment variables
This project is licensed under the MIT License - see the LICENSE file for details.