Image Preprocessing Best Practices
FASHN accepts public image URLs and base64 data URIs. In most cases, use the original image at a stable URL.
Recommended approach
-
Check the endpoint's input requirements
Each endpoint reference has a Technical limitations section covering only endpoint-specific constraints such as file-size, dimension, or aspect-ratio limits. For example, Image to Video lists its minimum dimensions and file-size limit.
-
Do not resize an input merely to match the requested output resolution
A 4K source can be appropriate for a 1K or 2K output. The output
resolutioncontrols the generated result; it is not a general input-size ceiling. Resize only when an endpoint's documented input bounds require it or when you intentionally want a smaller upload. -
Prefer a URL for large images
Use a publicly reachable HTTPS URL that returns the image directly, follows normal redirects, and does not require custom authorization headers. Signed URLs are supported, but they must remain valid until the prediction completes. Set accurate
Content-Typeand, when possible,Content-Lengthresponse headers. -
Choose between signed URLs and base64 based on your privacy needs
Base64 is a privacy-focused option when you prefer not to submit an image URL: request history displays the input as a
<base64>placeholder. Because base64 increases the request size, short-lived signed URLs are generally recommended for better reliability and can provide similar privacy when they remain valid only long enough for the prediction to complete. Base64 data URIs must include the media prefix, such asdata:image/jpeg;base64,.... See Data Retention & Privacy for more details. -
Preserve the original format and quality when possible
JPEG, PNG, and WebP are broadly supported. Avoid converting or recompressing an image unless the endpoint does not accept its format or the file exceeds a documented limit. If you do resize, preserve the aspect ratio and use a high-quality downsampling filter such as LANCZOS or INTER_AREA.