Skip to content

Commit f01037c

Browse files
[Bot] Update inference types (#3104)
* Update inference types (automated commit) * fix quality --------- Co-authored-by: Wauplin <[email protected]> Co-authored-by: Lucain Pouget <[email protected]>
1 parent 5834913 commit f01037c

File tree

5 files changed

+97
-0
lines changed

5 files changed

+97
-0
lines changed

docs/source/en/package_reference/inference_types.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,18 @@ This part of the lib is still under development and will be improved in future r
197197

198198

199199

200+
## image_to_video
201+
202+
[[autodoc]] huggingface_hub.ImageToVideoInput
203+
204+
[[autodoc]] huggingface_hub.ImageToVideoOutput
205+
206+
[[autodoc]] huggingface_hub.ImageToVideoParameters
207+
208+
[[autodoc]] huggingface_hub.ImageToVideoTargetSize
209+
210+
211+
200212
## object_detection
201213

202214
[[autodoc]] huggingface_hub.ObjectDetectionBoundingBox

docs/source/ko/package_reference/inference_types.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,18 @@ rendered properly in your Markdown viewer.
196196

197197

198198

199+
## image_to_video[[huggingface_hub.ImageToVideoInput]]
200+
201+
[[autodoc]] huggingface_hub.ImageToVideoInput
202+
203+
[[autodoc]] huggingface_hub.ImageToVideoOutput
204+
205+
[[autodoc]] huggingface_hub.ImageToVideoParameters
206+
207+
[[autodoc]] huggingface_hub.ImageToVideoTargetSize
208+
209+
210+
199211
## object_detection[[huggingface_hub.ObjectDetectionBoundingBox]]
200212

201213
[[autodoc]] huggingface_hub.ObjectDetectionBoundingBox

src/huggingface_hub/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@
372372
"ImageToTextInput",
373373
"ImageToTextOutput",
374374
"ImageToTextParameters",
375+
"ImageToVideoInput",
376+
"ImageToVideoOutput",
377+
"ImageToVideoParameters",
378+
"ImageToVideoTargetSize",
375379
"ObjectDetectionBoundingBox",
376380
"ObjectDetectionInput",
377381
"ObjectDetectionOutputElement",
@@ -660,6 +664,10 @@
660664
"ImageToTextInput",
661665
"ImageToTextOutput",
662666
"ImageToTextParameters",
667+
"ImageToVideoInput",
668+
"ImageToVideoOutput",
669+
"ImageToVideoParameters",
670+
"ImageToVideoTargetSize",
663671
"InferenceApi",
664672
"InferenceClient",
665673
"InferenceEndpoint",
@@ -1370,6 +1378,10 @@ def __dir__():
13701378
ImageToTextInput, # noqa: F401
13711379
ImageToTextOutput, # noqa: F401
13721380
ImageToTextParameters, # noqa: F401
1381+
ImageToVideoInput, # noqa: F401
1382+
ImageToVideoOutput, # noqa: F401
1383+
ImageToVideoParameters, # noqa: F401
1384+
ImageToVideoTargetSize, # noqa: F401
13731385
ObjectDetectionBoundingBox, # noqa: F401
13741386
ObjectDetectionInput, # noqa: F401
13751387
ObjectDetectionOutputElement, # noqa: F401

src/huggingface_hub/inference/_generated/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
ImageToTextOutput,
8686
ImageToTextParameters,
8787
)
88+
from .image_to_video import ImageToVideoInput, ImageToVideoOutput, ImageToVideoParameters, ImageToVideoTargetSize
8889
from .object_detection import (
8990
ObjectDetectionBoundingBox,
9091
ObjectDetectionInput,
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Inference code generated from the JSON schema spec in @huggingface/tasks.
2+
#
3+
# See:
4+
# - script: https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-codegen.ts
5+
# - specs: https://github.com/huggingface/huggingface.js/tree/main/packages/tasks/src/tasks.
6+
from typing import Any, Optional
7+
8+
from .base import BaseInferenceType, dataclass_with_extra
9+
10+
11+
@dataclass_with_extra
12+
class ImageToVideoTargetSize(BaseInferenceType):
13+
"""The size in pixel of the output video frames."""
14+
15+
height: int
16+
width: int
17+
18+
19+
@dataclass_with_extra
20+
class ImageToVideoParameters(BaseInferenceType):
21+
"""Additional inference parameters for Image To Video"""
22+
23+
guidance_scale: Optional[float] = None
24+
"""For diffusion models. A higher guidance scale value encourages the model to generate
25+
videos closely linked to the text prompt at the expense of lower image quality.
26+
"""
27+
negative_prompt: Optional[str] = None
28+
"""One prompt to guide what NOT to include in video generation."""
29+
num_frames: Optional[float] = None
30+
"""The num_frames parameter determines how many video frames are generated."""
31+
num_inference_steps: Optional[int] = None
32+
"""The number of denoising steps. More denoising steps usually lead to a higher quality
33+
video at the expense of slower inference.
34+
"""
35+
prompt: Optional[str] = None
36+
"""The text prompt to guide the video generation."""
37+
seed: Optional[int] = None
38+
"""Seed for the random number generator."""
39+
target_size: Optional[ImageToVideoTargetSize] = None
40+
"""The size in pixel of the output video frames."""
41+
42+
43+
@dataclass_with_extra
44+
class ImageToVideoInput(BaseInferenceType):
45+
"""Inputs for Image To Video inference"""
46+
47+
inputs: str
48+
"""The input image data as a base64-encoded string. If no `parameters` are provided, you can
49+
also provide the image data as a raw bytes payload.
50+
"""
51+
parameters: Optional[ImageToVideoParameters] = None
52+
"""Additional inference parameters for Image To Video"""
53+
54+
55+
@dataclass_with_extra
56+
class ImageToVideoOutput(BaseInferenceType):
57+
"""Outputs of inference for the Image To Video task"""
58+
59+
video: Any
60+
"""The generated video returned as raw bytes in the payload."""

0 commit comments

Comments
 (0)