API Reference

This is the api REFERENCE FOR THE tiomagic Python package, which allows you to run the Tio Magic Animation Toolkit

After following setup instructions, at the top of your file add from tiomagic import tm

Configuration

tm.configure(provider=str, gpu=Optional[str], timeout=Optional[str], scaledown_window=Optional[str])

Establishes which provider you will be using. This is required to run any calls.

Note that gpu, timeout, and scaledown_window are options for the Modal provider.

Features

text_to_video

tm.text_to_video(model=str, required_args=Dict[str: Any], **optional_args=Dict[str: Any])

Runs text to video calls on a model with given arguments.

image_to_video

tm.image_to_video(model=str, required_args=Dict[str: Any], **optional_args=Dict[str: Any])

Runs image to video calls on a model with given arguments.

interpolate

tm.interpolate(model=str, required_args=Dict[str: Any], **optional_args=Dict[str: Any])

Runs interpolate (in-between) calls on a model with given arguments.

pose_guidance

tm.pose_guidance(model=str, required_args=Dict[str: Any], **optional_args=Dict[str: Any])

Runs pose guidance calls on a model with given arguments.

check_generation_status

tm.check_generation_status(job_id=str)

Checks and updates the current status of a video generation job. You can find the job_id in generation_log.json. THis method can be called periodically to monitor long-running generation tasks. If you are running on Modal provider, you can also go onto your Modal dashboard to track generation.

If a generation is completed, calling check_generation_status will download the resulting video into output_videos directory.

At the moment, this will only run on the Modal provider. Local providers are all synchronous and will download the resulting video once generation is complete

cancel_job

tm.cancel_job(job_id=str)

Attempts to cancel a running job with the provider. The success of cancellation depends on the provider’s capabilities and the current state of the job. The result can be found in generation_log.json.

At the moment, this will only run on the Modal provider. Local providers are all synchronous.

get_providers

tm.get_providers

List all providers available.

get_models

tm.get_models(feature: str, provider: str)

List all models available for a provider and feature.

get_schema

tm.get_schema(feature: str, model: str)

List schema for particular implementation.

list_implementations

tm.list_implementations()

List all implementatoins available. Models listed and sorted by provider and feature.