Buckets:
Uzak çıkarım
Uzak çıkarım, çözümleme ve kodlama için yerel üretim gereksinimlerini devretmek üzere bir Inference Endpoint'e erişim sağlar.
remote_decode[[diffusers.utils.remote_decode]]
diffusers.utils.remote_decode[[diffusers.utils.remote_decode]]
diffusers.utils.remote_decode(endpoint: str, tensor: 'torch.Tensor', processor: 'VaeImageProcessor' | 'VideoProcessor' | None = None, do_scaling: bool = True, scaling_factor: float | None = None, shift_factor: float | None = None, output_type: Literal['mp4', 'pil', 'pt'] = 'pil', return_type: Literal['mp4', 'pil', 'pt'] = 'pil', image_format: Literal['png', 'jpg'] = 'jpg', partial_postprocess: bool = False, input_tensor_type: Literal['binary'] = 'binary', output_tensor_type: Literal['binary'] = 'binary', height: int | None = None, width: int | None = None)
Parametreler:
endpoint (str) : Uzaktan Çözümleme (Remote Decode) için uç nokta.
tensor (torch.Tensor) : Çözümlenecek gerginlik (tensor).
processor (VaeImageProcessor veya VideoProcessor, isteğe bağlı) : Video modelleri için return_type="pt" ve return_type="pil" ile kullanılır.
do_scaling (bool, varsayılan True, isteğe bağlı) : KULLANIMDI. yerine scaling_factor/shift_factor geçirin. seçenek kaldırılana kadar ölçekleme yapılmaması için do_scaling=None/do_scaling=False olarak ayarlayın True olduğunda, örneğin latents / self.vae.config.scaling_factor gibi ölçekleme uzaktan uygulanır. False ise, girdi ölçekleme uygulanmış olarak geçirilmelidir.
scaling_factor (float, isteğe bağlı) : Örneğin latents / self.vae.config.scaling_factor şeklinde geçirildiğinde ölçekleme uygulanır. - SD v1: 0.18215 - SD XL: 0.13025 - Flux: 0.3611 None ise, girdinin ölçekleme uygulanmış olarak geçirilmesi gerekir.
shift_factor (float, isteğe bağlı) : Örneğin latents + self.vae.config.shift_factor şeklinde iletildiğinde shift uygulanır. - Flux: 0.1159 None ise, ölçekleme uygulanmış olarak girdi iletilmelidir.
output_type ("mp4" or "pil" or "pt", default "pil") : Endpoint output type. Subject to change. Report feedback on preferred type. "mp4": Supported by video models. Endpoint returns bytesof video."pil": Supported by image and video models. Image models: Endpoint returns bytesof an image inimage_format. Video models: Endpoint returns torch.Tensorwith partialpostprocessingapplied. Requiresprocessoras a flag (anyNonevalue will work)."pt": Support by image and video models. Endpoint returns torch.Tensor. With partial_postprocess=Truethe tensor is postprocesseduint8image tensor. Recommendations:"pt"withpartial_postprocess=Trueis the smallest transfer for full quality."pt"withpartial_postprocess=Falseis the most compatible with third party code."pil"withimage_format="jpg"` is the smallest transfer overall.
return_type ("mp4" or "pil" or "pt", default "pil") : Function return type. "mp4": Function returns bytesof video."pil": Function returns PIL.Image.Image. With output_type="pil" no further processing is applied. With output_type="pt" a PIL.Image.Imageis created.partial_postprocess=False processoris required.partial_postprocess=True processoris **not** required."pt": Function returns torch.Tensor. processoris **not** required.partial_postprocess=Falsetensor isfloat16orbfloat16, without denormalization. partial_postprocess=Truetensor isuint8`, denormalized.
image_format ("png" veya "jpg", varsayılan jpg) : output_type="pil" ile kullanılır. Uç nokta jpg veya png döndürür.
partial_postprocess (bool, varsayılan False) : output_type="pt" ile kullanılır. partial_postprocess=False durumunda tensor float16 veya bfloat16 tipindedir ve normalleştirme işlemi uygulanmaz. partial_postprocess=True durumunda tensor uint8 tipindedir ve normalleştirme işlemi uygulanır.
input_tensor_type ("binary", varsayılan "binary") : Tensor aktarım türü.
output_tensor_type ("binary", varsayılan "binary") : Tensor aktarım türü.
height (int, isteğe bağlı) : "packed" latentler için zorunludur.
width (int, isteğe bağlı) : "packed" latentler için zorunludur.
Dönüş:
output (Image.Image veya list[Image.Image] veya bytes veya torch.Tensor).
VAE çözümlemesini uzaktan çalıştırmaya olanak tanıyan Hugging Face Hibrit Çıkarım.
remote_encode[[diffusers.utils.remote_utils.remote_encode]]
diffusers.utils.remote_utils.remote_encode[[diffusers.utils.remote_utils.remote_encode]]
diffusers.utils.remote_utils.remote_encode(endpoint: str, image: 'torch.Tensor' | Image.Image, scaling_factor: float | None = None, shift_factor: float | None = None)
Parametreler:
endpoint (str) : Uzaktan Çözümleme (Remote Decode) için uç nokta.
image (torch.Tensor veya PIL.Image.Image) : Kodlanacak görüntü.
scaling_factor (float, isteğe bağlı) : Örneğin latents * self.vae.config.scaling_factor şeklinde geçirildiğinde ölçekleme uygulanır. - SD v1: 0.18215 - SD XL: 0.13025 - Flux: 0.3611 None ise, girdinin ölçekleme uygulanmış olarak geçirilmesi gerekir.
shift_factor (float, isteğe bağlı) : Örneğin latents - self.vae.config.shift_factor şeklinde geçirildiğinde kaydırma uygulanır. - Flux: 0.1159 None ise, ölçekleme uygulanmış olarak girdi geçirilmelidir.
Dönüş:
output (torch.Tensor).
VAE kodlamayı uzaktan çalıştırmaya izin veren Hugging Face Hibrit Çıkarım.
Xet Storage Details
- Size:
- 6.13 kB
- Xet hash:
- a3766d8872de12028e6c9fb849b132bbc42bae1fc878049401b7fa21542eb9cd
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.