Skip to content

Commit 308baa8

Browse files
authored
Add text-to-video page (#1672)
1 parent fb669fb commit 308baa8

File tree

8 files changed

+120
-3
lines changed

8 files changed

+120
-3
lines changed

docs/inference-providers/_toctree.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
title: Feature Extraction
2525
- local: tasks/text-to-image
2626
title: Text to Image
27+
- local: tasks/text-to-video
28+
title: Text to Video
2729
- title: Other Tasks
2830
sections:
2931
- local: tasks/audio-classification

docs/inference-providers/tasks/fill-mask.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ Explore all available models and find the one that suits you best [here](https:/
3131
### Using the API
3232

3333

34-
No snippet available for this task.
34+
<InferenceSnippet
35+
pipeline=fill-mask
36+
providersMapping={ {"hf-inference":{"modelId":"Rostlab/prot_bert","providerModelId":"Rostlab/prot_bert"}} }
37+
/>
3538

3639

3740

docs/inference-providers/tasks/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@
3232
</p>
3333
</a>
3434

35+
<a class="!no-underline border dark:border-gray-700 p-5 rounded-lg shadow hover:shadow-lg"
36+
href="./text-to-video">
37+
<div class="w-full text-center bg-gradient-to-br from-indigo-400 to-indigo-500 rounded-lg py-1.5 font-semibold mb-5 text-white text-lg leading-relaxed">
38+
Text to Video
39+
</div><p class="text-gray-700">
40+
Generate an video based on a given text prompt.
41+
</p>
42+
</a>
43+
3544
</div>
3645
</div>
3746

docs/inference-providers/tasks/text-classification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Explore all available models and find the one that suits you best [here](https:/
3737

3838
<InferenceSnippet
3939
pipeline=text-classification
40-
providersMapping={ {"hf-inference":{"modelId":"cardiffnlp/twitter-roberta-base-sentiment-latest","providerModelId":"cardiffnlp/twitter-roberta-base-sentiment-latest"}} }
40+
providersMapping={ {"hf-inference":{"modelId":"ProsusAI/finbert","providerModelId":"ProsusAI/finbert"}} }
4141
/>
4242

4343

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<!---
2+
This markdown file has been generated from a script. Please do not edit it directly.
3+
For more details, check out:
4+
- the `generate.ts` script: https://github.com/huggingface/hub-docs/blob/main/scripts/inference-providers/scripts/generate.ts
5+
- the task template defining the sections in the page: https://github.com/huggingface/hub-docs/tree/main/scripts/inference-providers/templates/task/text-to-video.handlebars
6+
- the input jsonschema specifications used to generate the input markdown table: https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/tasks/text-to-video/spec/input.json
7+
- the output jsonschema specifications used to generate the output markdown table: https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/tasks/text-to-video/spec/output.json
8+
- the snippets used to generate the example:
9+
- curl: https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/snippets/curl.ts
10+
- python: https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/snippets/python.ts
11+
- javascript: https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/snippets/js.ts
12+
- the "tasks" content for recommended models: https://huggingface.co/api/tasks
13+
--->
14+
15+
## Text to Video
16+
17+
Generate an video based on a given text prompt.
18+
19+
<Tip>
20+
21+
For more details about the `text-to-video` task, check out its [dedicated page](https://huggingface.co/tasks/text-to-video)! You will find examples and related materials.
22+
23+
</Tip>
24+
25+
### Recommended models
26+
27+
- [tencent/HunyuanVideo](https://huggingface.co/tencent/HunyuanVideo): A strong model for consistent video generation.
28+
- [Lightricks/LTX-Video](https://huggingface.co/Lightricks/LTX-Video): A text-to-video model with high fidelity motion and strong prompt adherence.
29+
- [Wan-AI/Wan2.1-T2V-1.3B](https://huggingface.co/Wan-AI/Wan2.1-T2V-1.3B): A robust model for video generation.
30+
31+
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=text-to-video&sort=trending).
32+
33+
### Using the API
34+
35+
36+
<InferenceSnippet
37+
pipeline=text-to-video
38+
providersMapping={ {"fal-ai":{"modelId":"Wan-AI/Wan2.1-T2V-14B","providerModelId":"fal-ai/wan-t2v"},"hf-inference":{"modelId":"AdamLucek/Wan2.1-T2V-14B-OldBookIllustrations","providerModelId":"black-forest-labs/FLUX.1-dev"},"novita":{"modelId":"Wan-AI/Wan2.1-T2V-14B","providerModelId":"wan-t2v"},"replicate":{"modelId":"Wan-AI/Wan2.1-T2V-14B","providerModelId":"wavespeedai/wan-2.1-t2v-480p"}} }
39+
/>
40+
41+
42+
43+
### API specification
44+
45+
#### Request
46+
47+
| Payload | | |
48+
| :--- | :--- | :--- |
49+
| **inputs*** | _string_ | The input text data (sometimes called "prompt") |
50+
| **parameters** | _object_ | |
51+
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num_frames** | _number_ | The num_frames parameter determines how many video frames are generated. |
52+
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;guidance_scale** | _number_ | A higher guidance scale value encourages the model to generate videos closely linked to the text prompt, but values too high may cause saturation and other artifacts. |
53+
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;negative_prompt** | _string[]_ | One or several prompt to guide what NOT to include in video generation. |
54+
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num_inference_steps** | _integer_ | The number of denoising steps. More denoising steps usually lead to a higher quality video at the expense of slower inference. |
55+
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;seed** | _integer_ | Seed for the random number generator. |
56+
57+
58+
Some options can be configured by passing headers to the Inference API. Here are the available headers:
59+
60+
| Headers | | |
61+
| :--- | :--- | :--- |
62+
| **authorization** | _string_ | Authentication header in the form `'Bearer: hf_****'` when `hf_****` is a personal user access token with Inference API permission. You can generate one from [your settings page](https://huggingface.co/settings/tokens). |
63+
| **x-use-cache** | _boolean, default to `true`_ | There is a cache layer on the inference API to speed up requests we have already seen. Most models can use those results as they are deterministic (meaning the outputs will be the same anyway). However, if you use a nondeterministic model, you can set this parameter to prevent the caching mechanism from being used, resulting in a real new query. Read more about caching [here](../parameters#caching]). |
64+
| **x-wait-for-model** | _boolean, default to `false`_ | If the model is not ready, wait for it instead of receiving 503. It limits the number of requests required to get your inference done. It is advised to only set this flag to true after receiving a 503 error, as it will limit hanging in your application to known places. Read more about model availability [here](../overview#eligibility]). |
65+
66+
For more information about Inference API headers, check out the parameters [guide](../parameters).
67+
68+
#### Response
69+
70+
| Body | |
71+
| :--- | :--- | :--- |
72+
| **video** | _unknown_ | The generated video returned as raw bytes in the payload. |
73+

docs/inference-providers/tasks/translation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Explore all available models and find the one that suits you best [here](https:/
3434

3535
<InferenceSnippet
3636
pipeline=translation
37-
providersMapping={ {"hf-inference":{"modelId":"facebook/mbart-large-50-many-to-many-mmt","providerModelId":"facebook/mbart-large-50-many-to-many-mmt"}} }
37+
providersMapping={ {"hf-inference":{"modelId":"facebook/nllb-200-distilled-600M","providerModelId":"facebook/nllb-200-distilled-600M"}} }
3838
/>
3939

4040

scripts/inference-providers/scripts/generate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const TASKS: PipelineType[] = [
2121
"text-classification",
2222
"text-generation",
2323
"text-to-image",
24+
"text-to-video",
2425
"token-classification",
2526
"translation",
2627
"zero-shot-classification",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Text to Video
2+
3+
Generate an video based on a given text prompt.
4+
5+
{{{tips.linksToTaskPage.text-to-video}}}
6+
7+
### Recommended models
8+
9+
{{#each recommendedModels.text-to-video}}
10+
- [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}}
11+
{{/each}}
12+
13+
{{{tips.listModelsLink.text-to-video}}}
14+
15+
### Using the API
16+
17+
{{{snippets.text-to-video}}}
18+
19+
### API specification
20+
21+
#### Request
22+
23+
{{{specs.text-to-video.input}}}
24+
25+
{{{constants.specsHeaders}}}
26+
27+
#### Response
28+
29+
{{{specs.text-to-video.output}}}

0 commit comments

Comments
 (0)