Diffusers documentation

Uzak çıkarım

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.42.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

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

< >

( endpoint: strtensor: 'torch.Tensor'processor: 'VaeImageProcessor' | 'VideoProcessor' | None = Nonedo_scaling: bool = Truescaling_factor: float | None = Noneshift_factor: float | None = Noneoutput_type: Literal['mp4', 'pil', 'pt'] = 'pil'return_type: Literal['mp4', 'pil', 'pt'] = 'pil'image_format: Literal['png', 'jpg'] = 'jpg'partial_postprocess: bool = Falseinput_tensor_type: Literal['binary'] = 'binary'output_tensor_type: Literal['binary'] = 'binary'height: int | None = Nonewidth: int | None = None )

Parametreler

  • endpoint (str) — Remote Decode için uç nokta.
  • tensor (torch.Tensor) — Çözümlenecek tensör.
  • 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ŞI. Bunun 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ı) — Ölçeklendirme, örneğin latents / self.vae.config.scaling_factor.
    • SD v1: 0.18215
    • SD XL: 0.13025
    • Flux: 0.3611 None ise, girdi ölçekleme uygulanmış olarak geçirilmelidir.
  • shift_factor (float, isteğe bağlı) — Geçirildiğinde kaydırma uygulanır, örn. latents + self.vae.config.shift_factor.
    • Flux: 0.1159 None ise, girdi ölçekleme uygulanmış olarak geçirilmelidir.
  • output_type ("mp4" veya "pil" veya "pt", default “) — Uç nokta çıktı türü. Değişebilir. Tercih ettiğiniz tür hakkında geri bildirim iletin.

    "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 postprocesseduint8` image tensor.

    Öneriler: "pt" ve partial_postprocess=True tam kalite için en küçük aktarımdır. "pt" ve partial_postprocess=False üçüncü taraf kodlarla en uyumlu olanıdır. "pil" ve image_format="jpg" genel olarak en küçük aktarımdır.

  • return_type ("mp4" veya "pil" veya "pt", default “) — İşlevin dönüş türü.

    "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 tensör float16 veya bfloat16 tipindedir ve normalizasyonu geri alınmamıştır. partial_postprocess=True durumunda tensör uint8 tipindedir ve normalizasyonu geri alınmıştı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.

VAE çözümlemesini uzaktan çalıştırmaya olanak tanıyan Hugging Face Hibrit Çıkarım.

remote_encode

diffusers.utils.remote_utils.remote_encode

< >

( endpoint: strimage: 'torch.Tensor' | Image.Imagescaling_factor: float | None = Noneshift_factor: float | None = None )

Parametreler

  • endpoint (str) — Remote Decode için uç nokta.
  • image (torch.Tensor veya PIL.Image.Image) — Kodlanacak görüntü.
  • scaling_factor (float, isteğe bağlı) — Ölçekleme, örneğin latents * self.vae.config.scaling_factor.
    • SD v1: 0.18215
    • SD XL: 0.13025
    • Flux: 0.3611 None ise, girdi ölçekleme uygulanmış olarak geçirilmelidir.
  • shift_factor (float, isteğe bağlı) — Geçirildiğinde kaydırma uygulanır, örn. latents - self.vae.config.shift_factor.
    • Flux: 0.1159 None ise, girdi ölçekleme uygulanmış olarak geçirilmelidir.

VAE kodlamayı uzaktan çalıştırmaya izin veren Hugging Face Hibrit Çıkarım.

Update on GitHub