data:image/png;base64,...) for inline file content, but URLs are the universal format that works with every model.
The CDN is the recommended approach for file inputs. You upload once, get a persistent URL, and reuse it across as many inference requests as you need. The SDK automatically handles reliability by falling back between multiple upload endpoints if one is unavailable. If you already host files on S3, GCS, or your own server, you can skip the upload and pass those URLs directly.
Uploading Files
Using Your Own Storage
You don’t have to use fal’s CDN. If you already have files hosted elsewhere, pass those URLs directly. The model’s runner downloads the file from that URL during processing, so the URL must be accessible without additional authentication headers. Presigned URLs from S3, GCS, or R2 work because the auth credentials are embedded in the URL itself:Authorization headers or other credentials will not work as model inputs when calling Model APIs. If your files are behind authentication, download them first and upload to fal’s CDN, or generate a presigned URL with a short expiry. If you are building your own fal App, you can download authenticated files inside your endpoint using download_file with request_headers.
Data URIs
Models also accept base64-encoded data URIs:Upload Details
There are no file type restrictions at the upload level. The SDK handles large files automatically using multipart uploads with chunked transfer. Individual models may enforce their own size and format limits when processing inputs. Check the model’s API page for specifics.
Uploading PIL Images
If you’re working with PIL/Pillow images in Python:Media Expiration
CDN file retention is configurable. You can set expiration per-request using theX-Fal-Object-Lifecycle-Preference header, or configure retention at the account level.
Data Retention and Storage
Configure how long CDN files are retained
File Access Controls
By default, CDN URLs are publicly readable. You can restrict access to specific users, share files with named teammates, or hide files entirely by setting an ACL on the request that produces the file.File Access Controls
Restrict who can access files on the fal CDN with per-user access rules
Building a Serverless App?
If you’re building a fal App and need to handle files inside your endpoint code (returning images, downloading inputs), see the server-side guide:Working with Files
Server-side file handling: download_file, File.from_path, Image.from_pil