Classes
Audio
Inherits from: File
Constructor Parameters
Constructor Parameters
CompressedFile
Inherits from: File
Constructor Parameters
Constructor Parameters
Class Variables
Class Variables
Methods
Methods
FalBaseModel
- FIELD_ORDERS: Control field order in JSON schema, useful for nested models.
- Hidden(Field(…)): Mark fields as hidden from OpenAPI schema, useful for hidden params.
Inherits from: BaseModel
Constructor Parameters
Constructor Parameters
Class Variables
Class Variables
File
Inherits from: BaseModel
Constructor Parameters
Constructor Parameters
Class Variables
Class Variables
Methods
Methods
Image
Inherits from: File
Constructor Parameters
Constructor Parameters
Class Variables
Class Variables
ImageSizeConstraints
image_size field via :func:fal.toolkit.ImageSizeField to
surface the model’s size envelope in the OpenAPI schema (under the x-fal
extension), so clients and UIs can validate sizes before a request. These are
documentation hints and are not enforced by the SDK.
Constructor Parameters
Constructor Parameters
Class Variables
Class Variables
ImageValidationConfig
x-fal); the SDK does not enforce them.
Constructor Parameters
Constructor Parameters
Class Variables
Class Variables
ImageValidationOptions
Inherits from: dict
Constructor Parameters
Constructor Parameters
Class Variables
Class Variables
KVStore
Constructor Parameters
Constructor Parameters
Properties
Properties
Methods
Methods
Video
Inherits from: File
Constructor Parameters
Constructor Parameters
FalTookitException
Inherits from: Exception
Constructor Parameters
Constructor Parameters
FileUploadException
Inherits from: FalTookitException
Constructor Parameters
Constructor Parameters
KVStoreException
Inherits from: FalTookitException
Constructor Parameters
Constructor Parameters
DownloadError
Inherits from: Exception
Constructor Parameters
Constructor Parameters
Functions
to_xfal
x-fal schema payload.
Returns:
dict[str, Any]
Hidden
Returns:
_T
Raises:
ValueError: If field has no default or default_factory
get_image_size
Returns:
ImageSize
clone_repository
commit_hash is provided.
If a custom target_dir or repo_name is not specified, a predefined directory is
used for the target directory, and the repository name is determined from the URL.
Returns:
Path
download_file
DownloadError if necessary.
Returns:
Path
Raises:
DownloadError: If an error occurs during the download process.
download_model_weights
download_file function with the provided
URL and the target directory set to a pre-defined location for model weights.
The downloaded model weights are saved in this directory, and the function returns
the full path to the downloaded weights file.
Returns:
Path
get_gpu_type
str
load_inductor_cache
- Sets TORCHINDUCTOR_CACHE_DIR environment variable
- Looks for cached compiled kernels in GPU-specific global storage
- Unpacks the cache to local temporary directory
- Returns a hash of the unpacked directory for change detection
Returns:
str
sync_inductor_cache
- Checks if the local cache has changed (by comparing hashes)
- If changed, creates a zip archive of the new cache
- Saves it to GPU-specific global storage
Returns:
NoneType
synchronized_inductor_cache
Returns:
Iterator[]