Skip to content

[Inference Providers] deepinfra: add text-to-video support - #4719

Draft
ovuruska wants to merge 1 commit into
huggingface:mainfrom
ovuruska:deepinfra-text-to-video
Draft

[Inference Providers] deepinfra: add text-to-video support#4719
ovuruska wants to merge 1 commit into
huggingface:mainfrom
ovuruska:deepinfra-text-to-video

Conversation

@ovuruska

Copy link
Copy Markdown
Contributor

What

Adds DeepInfraTextToVideoTask so the deepinfra provider supports text-to-video.

DeepInfra's video generation is asynchronous, so this submits and polls:

  • _prepare_route: /v1/openai/videos (POST submits the job).
  • _prepare_payload_as_dict: forwards prompt; applies prompt/model after caller parameters so neither can be overridden.
  • get_response: reads the job id, polls /v1/openai/videos/{id} until status is succeeded/failed, then downloads data[0].url and returns the video bytes. Raises ValueError on failure/malformed output.

Wired in _providers/__init__.py under deepinfra. Existing tasks untouched.

Test

Added test_text_to_video_{url,payload,model_not_overridable,response} to TestDeepInfraProvider (response test mocks the poll + download). All pass locally.

🤖 Generated with Claude Code

Add DeepInfraTextToVideoTask for DeepInfra's asynchronous video generation:
POST /v1/openai/videos submits the job, then get_response polls
/v1/openai/videos/{id} until it succeeds or fails and returns the resulting
video bytes. prompt/model applied after caller parameters.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant