Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/huggingface_hub/inference/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,8 @@ def image_to_image(
The model to use for inference. Can be a model ID hosted on the Hugging Face Hub or a URL to a deployed
Inference Endpoint. This parameter overrides the model defined at the instance level. Defaults to None.
target_size (`ImageToImageTargetSize`, *optional*):
The size in pixel of the output image. This parameter is only supported by some providers and for specific models. It will be ignored when unsupported.
The size in pixels of the output image. This parameter is only supported by some providers and for
specific models. It will be ignored when unsupported.

Returns:
`Image`: The translated image.
Expand Down
3 changes: 2 additions & 1 deletion src/huggingface_hub/inference/_generated/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,8 @@ async def image_to_image(
The model to use for inference. Can be a model ID hosted on the Hugging Face Hub or a URL to a deployed
Inference Endpoint. This parameter overrides the model defined at the instance level. Defaults to None.
target_size (`ImageToImageTargetSize`, *optional*):
The size in pixel of the output image. This parameter is only supported by some providers and for specific models. It will be ignored when unsupported.
The size in pixels of the output image. This parameter is only supported by some providers and for
specific models. It will be ignored when unsupported.

Returns:
`Image`: The translated image.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

@dataclass_with_extra
class ImageToImageTargetSize(BaseInferenceType):
"""The size in pixel of the output image."""
"""The size in pixels of the output image. This parameter is only supported by some
providers and for specific models. It will be ignored when unsupported.
"""

height: int
width: int
Expand All @@ -33,7 +35,9 @@ class ImageToImageParameters(BaseInferenceType):
prompt: Optional[str] = None
"""The text prompt to guide the image generation."""
target_size: Optional[ImageToImageTargetSize] = None
"""The size in pixel of the output image. This parameter is only supported by some providers and for specific models. It will be ignored when unsupported."""
"""The size in pixels of the output image. This parameter is only supported by some
providers and for specific models. It will be ignored when unsupported.
"""


@dataclass_with_extra
Expand Down
Loading