Skip to content

Commit 2c572f7

Browse files
committed
make style
1 parent f80ef6d commit 2c572f7

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

src/diffusers/utils/remote_utils.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,45 +76,42 @@ def remote_decode(
7676
processor (`VaeImageProcessor` or `VideoProcessor`, *optional*):
7777
Used with `return_type="pt"`, and `return_type="pil"` for Video models.
7878
do_scaling (`bool`, default `True`, *optional*):
79-
When `True` scaling e.g. `latents / self.vae.config.scaling_factor` is
80-
applied remotely. If `False`, input must be passed with scaling applied.
79+
When `True` scaling e.g. `latents / self.vae.config.scaling_factor` is applied remotely. If `False`, input
80+
must be passed with scaling applied.
8181
output_type (`"mp4"` or `"pil"` or `"pt", default `"pil"):
8282
**Endpoint** output type. Subject to change. Report feedback on preferred type.
8383
84-
`"mp4": Supported by video models. Endpoint returns `bytes` of video.
85-
`"pil"`: Supported by image and video models.
86-
Image models: Endpoint returns `bytes` of an image in `image_format`.
87-
Video models: Endpoint returns `torch.Tensor` with partial `postprocessing` applied.
84+
`"mp4": Supported by video models. Endpoint returns `bytes` of video. `"pil"`: Supported by image and video
85+
models.
86+
Image models: Endpoint returns `bytes` of an image in `image_format`. Video models: Endpoint returns
87+
`torch.Tensor` with partial `postprocessing` applied.
8888
Requires `processor` as a flag (any `None` value will work).
8989
`"pt"`: Support by image and video models. Endpoint returns `torch.Tensor`.
9090
With `partial_postprocess=True` the tensor is postprocessed `uint8` image tensor.
9191
9292
Recommendations:
93-
`"pt"` with `partial_postprocess=True` is the smallest transfer for full quality.
94-
`"pt"` with `partial_postprocess=False` is the most compatible with third party code.
95-
`"pil"` with `image_format="jpg"` is the smallest transfer overall.
93+
`"pt"` with `partial_postprocess=True` is the smallest transfer for full quality. `"pt"` with
94+
`partial_postprocess=False` is the most compatible with third party code. `"pil"` with
95+
`image_format="jpg"` is the smallest transfer overall.
9696
9797
return_type (`"mp4"` or `"pil"` or `"pt", default `"pil"):
9898
**Function** return type.
9999
100-
`"mp4": Function returns `bytes` of video.
101-
`"pil"`: Function returns `PIL.Image.Image`.
102-
With `output_type="pil" no further processing is applied.
103-
With `output_type="pt" a `PIL.Image.Image` is created.
104-
`partial_postprocess=False` `processor` is required.
105-
`partial_postprocess=True` `processor` is **not** required.
100+
`"mp4": Function returns `bytes` of video. `"pil"`: Function returns `PIL.Image.Image`.
101+
With `output_type="pil" no further processing is applied. With `output_type="pt" a `PIL.Image.Image` is
102+
created.
103+
`partial_postprocess=False` `processor` is required. `partial_postprocess=True` `processor` is
104+
**not** required.
106105
`"pt"`: Function returns `torch.Tensor`.
107-
`processor` is **not** required.
108-
`partial_postprocess=False` tensor is `float16` or `bfloat16`, without denormalization.
109-
`partial_postprocess=True` tensor is `uint8`, denormalized.
106+
`processor` is **not** required. `partial_postprocess=False` tensor is `float16` or `bfloat16`, without
107+
denormalization. `partial_postprocess=True` tensor is `uint8`, denormalized.
110108
111109
image_format (`"png"` or `"jpg"`, default `jpg`):
112110
Used with `output_type="pil"`. Endpoint returns `jpg` or `png`.
113111
114112
partial_postprocess (`bool`, default `False`):
115-
Used with `output_type="pt"`.
116-
`partial_postprocess=False` tensor is `float16` or `bfloat16`, without denormalization.
117-
`partial_postprocess=True` tensor is `uint8`, denormalized.
113+
Used with `output_type="pt"`. `partial_postprocess=False` tensor is `float16` or `bfloat16`, without
114+
denormalization. `partial_postprocess=True` tensor is `uint8`, denormalized.
118115
119116
input_tensor_type (`"base64"` or `"binary"`, default `"base64"`):
120117
With `"base64"` `tensor` is sent to endpoint base64 encoded. `"binary"` reduces overhead and transfer.

0 commit comments

Comments
 (0)