#
# Apache Lisansı, 2.0 Sürümü ("Lisans") altında lisanslanmıştır;
# bu dosyayı, Lisansa uygun olarak kullanabilirsiniz.
# Lisansın bir kopyasını şu adresten edinebilirsiniz
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Uygulanabilir yasa gerektirmedikçe veya yazılı olarak anlaşılmadıkça, yazılım
# Lisans kapsamında dağıtılan, "OLDUĞU GİBİ" esasına göre dağıtılır,
# HİÇBİR TÜR AÇIK VEYA ZIMMİ GARANTİ VEYA ŞART İÇERMEZ.
# İzinleri ve
# lisans kapsamındaki kısıtlamalar. -->

  
    
      
    
    
  

# LTX-Video

[LTX-Video](https://huggingface.co/Lightricks/LTX-Video), metin ve görüntülerden yüksek çözünürlüklü videoların hızlı ve gerçek zamanlı olarak üretilmesi için tasarlanmış bir difüzyon dönüştürücüsüdür. LTX-Video'nun ana özelliği Video-VAE'dir. Video-VAE, daha yüksek piksel-temsil sıkıştırma oranına (1:192) sahiptir; bu da daha verimli video veri işleme ve daha hızlı üretim hızı sağlar. Üretim sırasında ince detayların kaybolmasını desteklemek ve önlemek için Video-VAE çözücü, temsil-piksel dönüşümünü *ve* son gürültü azaltma adımını gerçekleştirir.

Tüm orijinal LTX-Video checkpoint'lerini [Lightricks](https://huggingface.co/Lightricks) kuruluşu altında bulabilirsiniz.

> [!TIP]
> Diğer video oluşturma görevlerine ait daha fazla örnek için sağ kenar çubuğundaki LTX-Video modellerine tıklayın.

Aşağıdaki örnek, bellek veya çıkarım hızı için optimize edilmiş bir video üretmenin nasıl yapılacağını gösterir.

Çeşitli bellek tasarrufu teknikleri hakkında daha fazla ayrıntı için [Bellek kullanımını azaltma](../../optimization/memory) kılavuzuna bakın.

Aşağıdaki LTX-Video modeli ~10GB VRAM gerektirir.

```py
import torch
from diffusers import LTXPipeline, AutoModel
from diffusers.hooks import apply_group_offloading
from diffusers.utils import export_to_video

# fp8 layerwise weight-casting
transformer = AutoModel.from_pretrained(
    "Lightricks/LTX-Video",
    subfolder="transformer",
    dtype=torch.bfloat16
)
transformer.enable_layerwise_casting(
    storage_dtype=torch.float8_e4m3fn, compute_dtype=torch.bfloat16
)

pipeline = LTXPipeline.from_pretrained("Lightricks/LTX-Video", transformer=transformer, dtype=torch.bfloat16)

# group-offloading
onload_device = torch.device("cuda")
offload_device = torch.device("cpu")
pipeline.transformer.enable_group_offload(onload_device=onload_device, offload_device=offload_device, offload_type="leaf_level", use_stream=True)
apply_group_offloading(pipeline.text_encoder, onload_device=onload_device, offload_type="block_level", num_blocks_per_group=2)
apply_group_offloading(pipeline.vae, onload_device=onload_device, offload_type="leaf_level")

prompt = """
A woman with long brown hair and light skin smiles at another woman with long blonde hair.
The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek.
The camera angle is a close-up, focused on the woman with brown hair's face. The lighting is warm and 
natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage
"""
negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"

video = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    width=768,
    height=512,
    num_frames=161,
    decode_timestep=0.03,
    decode_noise_scale=0.025,
    num_inference_steps=50,
).frames[0]
export_to_video(video, "output.mp4", fps=24)
```

[Derleme](../../optimization/fp16#torchcompile) ilk seferde yavaştır ancak pipeline'a yapılan sonraki çağrılar daha hızlıdır. [Önbelleğe alma](../../optimization/cache), ara çıktıları saklayıp yeniden kullanarak çıkarımı hızlandırabilir.

```py
import torch
from diffusers import LTXPipeline
from diffusers.utils import export_to_video

pipeline = LTXPipeline.from_pretrained(
    "Lightricks/LTX-Video", dtype=torch.bfloat16
)

# torch.compile
pipeline.transformer.to(memory_format=torch.channels_last)
pipeline.transformer = torch.compile(
    pipeline.transformer, mode="max-autotune", fullgraph=True
)

prompt = """
A woman with long brown hair and light skin smiles at another woman with long blonde hair.
The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek.
The camera angle is a close-up, focused on the woman with brown hair's face. The lighting is warm and 
natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage
"""
negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"

video = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    width=768,
    height=512,
    num_frames=161,
    decode_timestep=0.03,
    decode_noise_scale=0.025,
    num_inference_steps=50,
).frames[0]
export_to_video(video, "output.mp4", fps=24)
```

## Notlar

- [LTX-Video](https://github.com/Lightricks/LTX-Video) deposundan üretim için aşağıdaki önerilen ayarlara başvurun.

  - Dönüştürücü, VAE ve metin kodlayıcı için önerilen dtype `torch.bfloat16`'dır. VAE ve metin kodlayıcı ayrıca `torch.float32` veya `torch.float16` olabilir.
  - LTX-Video'nun guidance-distilled varyantları için `guidance_scale` değerini `1.0` olarak ayarlayın. Diğer herhangi bir model için iyi bir üretim kalitesi elde etmek amacıyla `guidance_scale` değeri, `5.0` gibi daha yüksek bir değere ayarlanmalıdır.
  - Zaman adımı farkındalıklı VAE varyantları (LTX-Video 0.9.1 ve üzeri) için `decode_timestep` değerini `0.05` ve `image_cond_noise_scale` değerini `0.025` olarak ayarlayın.
  - Birden fazla koşullandırma görseli ve videosu arasında interpolasyonu destekleyen varyantlar (LTX-Video 0.9.5 ve üzeri) için en iyi sonuçları almak benzer görseller ve videolar kullanın. Koşullandırma girdilerinden sapma, üretilen videoda ani geçişlere yol açabilir.

- LTX-Video 0.9.7, uzamsal latent bir yükseltici ve 13B parametreli bir dönüştürücü içerir. Çıkarım sırasında, düşük çözünürlüklü bir video önce hızla oluşturulur ve ardından yükseltilip iyileştirilir.

  
  Örnek kodu göster

  ```py
  import torch
  from diffusers import LTXConditionPipeline, LTXLatentUpsamplePipeline
  from diffusers.pipelines.ltx.pipeline_ltx_condition import LTXVideoCondition
  from diffusers.utils import export_to_video, load_video

  pipeline = LTXConditionPipeline.from_pretrained("Lightricks/LTX-Video-0.9.7-dev", dtype=torch.bfloat16)
  pipeline_upsample = LTXLatentUpsamplePipeline.from_pretrained("Lightricks/ltxv-spatial-upscaler-0.9.7", vae=pipeline.vae, dtype=torch.bfloat16)
  pipeline.to("cuda")  # or "mps", "xpu", "cpu"
  pipe_upsample.to("cuda")
  pipeline.vae.enable_tiling()

  def round_to_nearest_resolution_acceptable_by_vae(height, width):
      height = height - (height % pipeline.vae_temporal_compression_ratio)
      width = width - (width % pipeline.vae_temporal_compression_ratio)
      return height, width

  video = load_video(
      "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cosmos/cosmos-video2world-input-vid.mp4"
  )[:21]  # only use the first 21 frames as conditioning
  condition1 = LTXVideoCondition(video=video, frame_index=0)

  prompt = """
  The video depicts a winding mountain road covered in snow, with a single vehicle 
  traveling along it. The road is flanked by steep, rocky cliffs and sparse vegetation. 
  The landscape is characterized by rugged terrain and a river visible in the distance. 
  The scene captures the solitude and beauty of a winter drive through a mountainous region.
  """
  negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"
  expected_height, expected_width = 768, 1152
  downscale_factor = 2 / 3
  num_frames = 161

  # 1. Generate video at smaller resolution
  # Text-only conditioning is also supported without the need to pass `conditions`
  downscaled_height, downscaled_width = int(expected_height * downscale_factor), int(expected_width * downscale_factor)
  downscaled_height, downscaled_width = round_to_nearest_resolution_acceptable_by_vae(downscaled_height, downscaled_width)
  latents = pipeline(
      conditions=[condition1],
      prompt=prompt,
      negative_prompt=negative_prompt,
      width=downscaled_width,
      height=downscaled_height,
      num_frames=num_frames,
      num_inference_steps=30,
      decode_timestep=0.05,
      decode_noise_scale=0.025,
      image_cond_noise_scale=0.0,
      guidance_scale=5.0,
      guidance_rescale=0.7,
      generator=torch.Generator().manual_seed(0),
      output_type="latent",
  ).frames

  # 2. Upscale generated video using latent upsampler with fewer inference steps
  # The available latent upsampler upscales the height/width by 2x
  upscaled_height, upscaled_width = downscaled_height * 2, downscaled_width * 2
  upscaled_latents = pipe_upsample(
      latents=latents,
      output_type="latent"
  ).frames

  # 3. Denoise the upscaled video with few steps to improve texture (optional, but recommended)
  video = pipeline(
      conditions=[condition1],
      prompt=prompt,
      negative_prompt=negative_prompt,
      width=upscaled_width,
      height=upscaled_height,
      num_frames=num_frames,
      denoise_strength=0.4,  # Effectively, 4 inference steps out of 10
      num_inference_steps=10,
      latents=upscaled_latents,
      decode_timestep=0.05,
      decode_noise_scale=0.025,
      image_cond_noise_scale=0.0,
      guidance_scale=5.0,
      guidance_rescale=0.7,
      generator=torch.Generator().manual_seed(0),
      output_type="pil",
  ).frames[0]

  # 4. Downscale the video to the expected resolution
  video = [frame.resize((expected_width, expected_height)) for frame in video]

  export_to_video(video, "output.mp4", fps=24)
  ```

  

- LTX-Video 0.9.7 damıtılmış modeli, üretimi hızlandırmak için rehberlik ve zaman adımı damıtması uygulanmıştır. İyi üretim kalitesi için `guidance_scale`'ın `1.0` olarak ayarlanması ve `num_inference_steps`'in `4` ile `10` arasında bir değere ayarlanması gerekir. En iyi sonuçlar için aşağıdaki özel zaman adımlarını da kullanmalısınız.

  - Upscaling için hazırlık amacıyla temel model çıkarımı: `[1000, 993, 987, 981, 975, 909, 725, 0.03]`.
  - Yaklaştırma: `[1000, 909, 725, 421, 0]`.

  
  Örnek kodu göster

  ```py
  import torch
  from diffusers import LTXConditionPipeline, LTXLatentUpsamplePipeline
  from diffusers.pipelines.ltx.pipeline_ltx_condition import LTXVideoCondition
  from diffusers.utils import export_to_video, load_video

  pipeline = LTXConditionPipeline.from_pretrained("Lightricks/LTX-Video-0.9.7-distilled", dtype=torch.bfloat16)
  pipe_upsample = LTXLatentUpsamplePipeline.from_pretrained("Lightricks/ltxv-spatial-upscaler-0.9.7", vae=pipeline.vae, dtype=torch.bfloat16)
  pipeline.to("cuda")  # or "mps", "xpu", "cpu"
  pipe_upsample.to("cuda")
  pipeline.vae.enable_tiling()

  def round_to_nearest_resolution_acceptable_by_vae(height, width):
      height = height - (height % pipeline.vae_spatial_compression_ratio)
      width = width - (width % pipeline.vae_spatial_compression_ratio)
      return height, width

  prompt = """
  artistic anatomical 3d render, utlra quality, human half full male body with transparent 
  skin revealing structure instead of organs, muscular, intricate creative patterns, 
  monochromatic with backlighting, lightning mesh, scientific concept art, blending biology 
  with botany, surreal and ethereal quality, unreal engine 5, ray tracing, ultra realistic, 
  16K UHD, rich details. camera zooms out in a rotating fashion
  """
  negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"
  expected_height, expected_width = 768, 1152
  downscale_factor = 2 / 3
  num_frames = 161

  # 1. Generate video at smaller resolution
  downscaled_height, downscaled_width = int(expected_height * downscale_factor), int(expected_width * downscale_factor)
  downscaled_height, downscaled_width = round_to_nearest_resolution_acceptable_by_vae(downscaled_height, downscaled_width)
  latents = pipeline(
      prompt=prompt,
      negative_prompt=negative_prompt,
      width=downscaled_width,
      height=downscaled_height,
      num_frames=num_frames,
      timesteps=[1000, 993, 987, 981, 975, 909, 725, 0.03],
      decode_timestep=0.05,
      decode_noise_scale=0.025,
      image_cond_noise_scale=0.0,
      guidance_scale=1.0,
      guidance_rescale=0.7,
      generator=torch.Generator().manual_seed(0),
      output_type="latent",
  ).frames

  # 2. Upscale generated video using latent upsampler with fewer inference steps
  # The available latent upsampler upscales the height/width by 2x
  upscaled_height, upscaled_width = downscaled_height * 2, downscaled_width * 2
  upscaled_latents = pipe_upsample(
      latents=latents,
      adain_factor=1.0,
      output_type="latent"
  ).frames

  # 3. Denoise the upscaled video with few steps to improve texture (optional, but recommended)
  video = pipeline(
      prompt=prompt,
      negative_prompt=negative_prompt,
      width=upscaled_width,
      height=upscaled_height,
      num_frames=num_frames,
      denoise_strength=0.999,  # Effectively, 4 inference steps out of 5
      timesteps=[1000, 909, 725, 421, 0],
      latents=upscaled_latents,
      decode_timestep=0.05,
      decode_noise_scale=0.025,
      image_cond_noise_scale=0.0,
      guidance_scale=1.0,
      guidance_rescale=0.7,
      generator=torch.Generator().manual_seed(0),
      output_type="pil",
  ).frames[0]

  # 4. Downscale the video to the expected resolution
  video = [frame.resize((expected_width, expected_height)) for frame in video]

  export_to_video(video, "output.mp4", fps=24)
  ```

  

- LTX-Video 0.9.8 damıtılmış modeli, 0.9.7 varyantına benzerdir. Rehberlik ve zaman adımı damıtılmıştır ve yukarıdaki gibi benzer çıkarım kodu kullanılabilir. Bu sürümün bir iyileştirmesi, çok uzun videoların oluşturulmasını desteklemesidir. Ayrıca, `tone_map_compression_ratio` parametresi kullanılarak oluşturulan videonun kalitesini artırmak için ton eşlemesinin (tone mapping) kullanılmasını destekler. `0.6` varsayılan değeri önerilmektedir.

  
  Örnek kodu göster

  ```python
  import torch
  from diffusers import LTXConditionPipeline, LTXLatentUpsamplePipeline
  from diffusers.pipelines.ltx.pipeline_ltx_condition import LTXVideoCondition
  from diffusers.models.latent_upscaler import LTXLatentUpsamplerModel
  from diffusers.utils import export_to_video, load_video

  pipeline = LTXConditionPipeline.from_pretrained("Lightricks/LTX-Video-0.9.8-13B-distilled", dtype=torch.bfloat16)
  # TODO: Update the checkpoint here once updated in LTX org
  upsampler = LTXLatentUpsamplerModel.from_pretrained("a-r-r-o-w/LTX-0.9.8-Latent-Upsampler", dtype=torch.bfloat16)
  pipe_upsample = LTXLatentUpsamplePipeline(vae=pipeline.vae, latent_upsampler=upsampler).to(torch.bfloat16)
  pipeline.to("cuda")  # or "mps", "xpu", "cpu"
  pipe_upsample.to("cuda")
  pipeline.vae.enable_tiling()

  def round_to_nearest_resolution_acceptable_by_vae(height, width):
      height = height - (height % pipeline.vae_spatial_compression_ratio)
      width = width - (width % pipeline.vae_spatial_compression_ratio)
      return height, width

  prompt = """The camera pans over a snow-covered mountain range, revealing a vast expanse of snow-capped peaks and valleys.The mountains are covered in a thick layer of snow, with some areas appearing almost white while others have a slightly darker, almost grayish hue. The peaks are jagged and irregular, with some rising sharply into the sky while others are more rounded. The valleys are deep and narrow, with steep slopes that are also covered in snow. The trees in the foreground are mostly bare, with only a few leaves remaining on their branches. The sky is overcast, with thick clouds obscuring the sun. The overall impression is one of peace and tranquility, with the snow-covered mountains standing as a testament to the power and beauty of nature."""
  # prompt = """A woman walks away from a white Jeep parked on a city street at night, then ascends a staircase and knocks on a door. The woman, wearing a dark jacket and jeans, walks away from the Jeep parked on the left side of the street, her back to the camera; she walks at a steady pace, her arms swinging slightly by her sides; the street is dimly lit, with streetlights casting pools of light on the wet pavement; a man in a dark jacket and jeans walks past the Jeep in the opposite direction; the camera follows the woman from behind as she walks up a set of stairs towards a building with a green door; she reaches the top of the stairs and turns left, continuing to walk towards the building; she reaches the door and knocks on it with her right hand; the camera remains stationary, focused on the doorway; the scene is captured in real-life footage."""
  negative_prompt = "bright colors, symbols, graffiti, watermarks, worst quality, inconsistent motion, blurry, jittery, distorted"
  expected_height, expected_width = 480, 832
  downscale_factor = 2 / 3
  # num_frames = 161
  num_frames = 361

  # 1. Generate video at smaller resolution
  downscaled_height, downscaled_width = int(expected_height * downscale_factor), int(expected_width * downscale_factor)
  downscaled_height, downscaled_width = round_to_nearest_resolution_acceptable_by_vae(downscaled_height, downscaled_width)
  latents = pipeline(
      prompt=prompt,
      negative_prompt=negative_prompt,
      width=downscaled_width,
      height=downscaled_height,
      num_frames=num_frames,
      timesteps=[1000, 993, 987, 981, 975, 909, 725, 0.03],
      decode_timestep=0.05,
      decode_noise_scale=0.025,
      image_cond_noise_scale=0.0,
      guidance_scale=1.0,
      guidance_rescale=0.7,
      generator=torch.Generator().manual_seed(0),
      output_type="latent",
  ).frames

  # 2. Upscale generated video using latent upsampler with fewer inference steps
  # The available latent upsampler upscales the height/width by 2x
  upscaled_height, upscaled_width = downscaled_height * 2, downscaled_width * 2
  upscaled_latents = pipe_upsample(
      latents=latents,
      adain_factor=1.0,
      tone_map_compression_ratio=0.6,
      output_type="latent"
  ).frames

  # 3. Denoise the upscaled video with few steps to improve texture (optional, but recommended)
  video = pipeline(
      prompt=prompt,
      negative_prompt=negative_prompt,
      width=upscaled_width,
      height=upscaled_height,
      num_frames=num_frames,
      denoise_strength=0.999,  # Effectively, 4 inference steps out of 5
      timesteps=[1000, 909, 725, 421, 0],
      latents=upscaled_latents,
      decode_timestep=0.05,
      decode_noise_scale=0.025,
      image_cond_noise_scale=0.0,
      guidance_scale=1.0,
      guidance_rescale=0.7,
      generator=torch.Generator().manual_seed(0),
      output_type="pil",
  ).frames[0]

  # 4. Downscale the video to the expected resolution
  video = [frame.resize((expected_width, expected_height)) for frame in video]

  export_to_video(video, "output.mp4", fps=24)
  ```

  

- LTX-Video, [load_lora_weights()](/docs/diffusers/main/tr/api/loaders/lora#diffusers.loaders.LTXVideoLoraLoaderMixin.load_lora_weights) ile LoRA'ları destekler.

  
  Örnek kodu göster

  ```py
  import torch
  from diffusers import LTXConditionPipeline
  from diffusers.utils import export_to_video, load_image

  pipeline = LTXConditionPipeline.from_pretrained(
      "Lightricks/LTX-Video-0.9.5", dtype=torch.bfloat16
  )

  pipeline.load_lora_weights("Lightricks/LTX-Video-Cakeify-LoRA", adapter_name="cakeify")
  pipeline.set_adapters("cakeify")

  # use "CAKEIFY" to trigger the LoRA
  prompt = "CAKEIFY a person using a knife to cut a cake shaped like a Pikachu plushie"
  image = load_image("https://huggingface.co/Lightricks/LTX-Video-Cakeify-LoRA/resolve/main/assets/images/pikachu.png")

  video = pipeline(
      prompt=prompt,
      image=image,
      width=576,
      height=576,
      num_frames=161,
      decode_timestep=0.03,
      decode_noise_scale=0.025,
      num_inference_steps=50,
  ).frames[0]
  export_to_video(video, "output.mp4", fps=26)
  ```

  

- LTX-Video, [loaders.FromOriginalModelMixin.from_single_file()](/docs/diffusers/main/tr/api/loaders/single_file#diffusers.loaders.FromOriginalModelMixin.from_single_file) veya [loaders.FromSingleFileMixin.from_single_file()](/docs/diffusers/main/tr/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file) ile [GGUF checkpoint](../../quantization/gguf) gibi tek dosyalardan yükleme destekler.

  
  Örnek kodu göster

  ```py
  import torch
  from diffusers.utils import export_to_video
  from diffusers import LTXPipeline, AutoModel, GGUFQuantizationConfig

  transformer = AutoModel.from_single_file(
      "https://huggingface.co/city96/LTX-Video-gguf/blob/main/ltx-video-2b-v0.9-Q3_K_S.gguf"
      quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
      dtype=torch.bfloat16
  )
  pipeline = LTXPipeline.from_pretrained(
      "Lightricks/LTX-Video",
      transformer=transformer,
      dtype=torch.bfloat16
  )
  ```

  

## LTXI2VLongMultiPromptPipeline[[diffusers.LTXI2VLongMultiPromptPipeline]]

#### diffusers.LTXI2VLongMultiPromptPipeline[[diffusers.LTXI2VLongMultiPromptPipeline]]

```python
diffusers.LTXI2VLongMultiPromptPipeline(scheduler: FlowMatchEulerDiscreteScheduler, vae: AutoencoderKLLTXVideo, text_encoder: T5EncoderModel, tokenizer: T5TokenizerFast, transformer: LTXVideoTransformer3DModel)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_i2v_long_multi_prompt.py#L389)

**Parametreler:**

transformer ([LTXVideoTransformer3DModel](/docs/diffusers/main/tr/api/models/ltx_video_transformer3d#diffusers.LTXVideoTransformer3DModel)) : Kodlanmış video latentlerini gürültüden arındırmak için kullanılan koşullu Transformer mimarisi.

scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/tr/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler) veya `LTXEulerAncestralRFScheduler`) : Kodlanmış görüntü latentlerini gürültüden arındırmak için `transformer` ile birlikte kullanılacak bir zamanlayıcı.

vae ([AutoencoderKLLTXVideo](/docs/diffusers/main/tr/api/models/autoencoderkl_ltx_video#diffusers.AutoencoderKLLTXVideo)) : Görüntüleri latent temsillere kodlamak ve latent temsillerden görüntülere çözmek için kullanılan Varyasyonel Oto-Kodlayıcı (VAE) Modeli.

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel), özellikle [google/t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl) varyantı.

tokenizer (`T5TokenizerFast`) : [T5TokenizerFast](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast) sınıfının tokenizer'ı.

ComfyUI uyumluluğuna sahip, uzun süreli I2V (görselden videoya) çoklu istemli iş akışı.

Öne çıkan özellikler:
- Sadece zamansal kayan pencere örneklemesi (uzamsal H/W bölme yok); pencereler arasında otoregresif füzyon.
- Pencere başlarında yumuşak geçişlere sahip pencere başına çoklu istemli segmentasyon.
- I2V için token başına maske ile ilk kare sert koşullandırma.
- Zaman penceresi ve VAE karoları ile çözümlenme yoluyla VRAM kontrolü.

Referans: https://github.com/Lightricks/LTX-Video

#### __call__[[diffusers.LTXI2VLongMultiPromptPipeline.__call__]]

```python
__call__(prompt: str | list[str] = None, negative_prompt: str | list[str] | None = None, prompt_segments: list[dict[str, Any]] | None = None, height: int = 512, width: int = 704, num_frames: int = 161, frame_rate: float = 25, guidance_scale: float = 1.0, guidance_rescale: float = 0.0, num_inference_steps: int | None = 8, sigmas: list[float, torch.Tensor] | None = None, generator: torch.Generator | list[torch.Generator] | None = None, seed: int | None = 0, cond_image: 'PIL.Image.Image' | torch.Tensor | None = None, cond_strength: float = 0.5, latents: torch.Tensor | None = None, temporal_tile_size: int = 80, temporal_overlap: int = 24, temporal_overlap_cond_strength: float = 0.5, adain_factor: float = 0.25, guidance_latents: torch.Tensor | None = None, guiding_strength: float = 1.0, negative_index_latents: torch.Tensor | None = None, negative_index_strength: float = 1.0, skip_steps_sigma_threshold: float | None = 1, decode_timestep: float | None = 0.05, decode_noise_scale: float | None = 0.025, decode_horizontal_tiles: int = 4, decode_vertical_tiles: int = 4, decode_overlap: int = 3, output_type: str | None = 'latent', return_dict: bool = True, attention_kwargs: dict[str, Any] | None = None, callback_on_step_end: Callable[[int, int], None] | None = None, callback_on_step_end_tensor_inputs: list[str] = ['latents'], max_sequence_length: int = 128)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_i2v_long_multi_prompt.py#L935)

**Parametreler:**

prompt (`str` veya `list[str]`, *isteğe bağlı*) : Her pencere için pozitif metin istemi(leri). Tek bir dize '|' içeriyorsa, kısımlar çubuklara göre bölünür.

negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : İstenmeyen içeriği bastırmak için negatif istem(ler).

prompt_segments (`list[dict]`, *isteğe bağlı*) : Pencere başına istemleri geçersiz kılmak için {"start_window", "end_window", "text"} içeren segment eşlemesi.

height (`int`, varsayılan `512`) : Piksel cinsinden çıktı görüntü yüksekliği; 32'ye bölünebilir olmalıdır.

width (`int`, varsayılan `704`) : Piksel cinsinden çıktı görüntü genişliği; 32'ye bölünebilir olmalıdır.

num_frames (`int`, varsayılan `161`) : Çıktı kare sayısı (çözümlenmiş piksel uzayında).

frame_rate (`float`, varsayılan `25`) : Saniye başına kare sayısı; `video_coords` içindeki zaman koordinatlarını normalize etmek için kullanılır.

guidance_scale (`float`, varsayılan `1.0`) : CFG ölçeği; > 1 değerleri sınıflandırıcı-özgürlüklü yönlendirmeyi etkinleştirir.

guidance_rescale (`float`, varsayılan `0.0`) : CFG altında aşırı pozlamayı azaltmak için isteğe bağlı yeniden ölçekleme (bkz. `rescale_noise_cfg`).

num_inference_steps (`int`, *isteğe bağlı*, varsayılan `8`) : Pencere başına gürültü azaltma adımları. `sigmas` sağlanıyorsa yok sayılır.

sigmas (`list[float]` veya `torch.Tensor`, *isteğe bağlı*) : Pencere başına açık sigma zamanlaması; ayarlanırsa `num_inference_steps` değerini geçersiz kılar.

generator (`torch.Generator` veya `list[torch.Generator]`, *isteğe bağlı*) : Stokastisiteyi kontrol eder; liste kabul edilir ancak yalnızca ilk öğe kullanılır (batch=1).

seed (`int`, *isteğe bağlı*, varsayılan `0`) : Verilirse, küresel latentler için paylaşılan üreteci tohumlar ve her zaman penceresi için `seed + w_start` ile pencereye özgü bir üreteç türetir.

cond_image (`PIL.Image.Image` veya `torch.Tensor`, *isteğe bağlı*) : Koşullandırma görüntüsü; `cond_strength > 0` olduğunda token başına maske ile 0. kareyi sabitler.

cond_strength (`float`, varsayılan `0.5`) : İlk kare sert koşullandırma gücü (daha küçük cond_mask ⇒ daha güçlü koruma).

latents (`torch.Tensor`, *isteğe bağlı*) : Başlangıç latentleri [B, C_lat, F_lat, H_lat, W_lat]; None ise `randn_tensor` ile örneklenir.

temporal_tile_size (`int`, varsayılan `80`) : Zaman penceresi boyutu (çözümlenmiş kare cinsinden); içsel olarak VAE zaman sıkıştırması ile ölçeklenir.

temporal_overlap (`int`, varsayılan `24`) : Ardışık pencereler arasındaki örtüşme (çözümlenmiş kare cinsinden); içsel olarak sıkıştırma ile ölçeklenir.

temporal_overlap_cond_strength (`float`, varsayılan `0.5`) : Yeni pencere başına önceki pencere kuyruğu latentlerini enjekte etmek için kullanılan güç.

adain_factor (`float`, varsayılan `0.25`) : Çapraz pencere tutarlılığı için AdaIN normalizasyon gücü (0 devre dışı bırakır).

guidance_latents (`torch.Tensor`, *isteğe bağlı*) : Pencere başına enjekte edilen referans latentler; sonraki pencereler için uzunluk, örtüşme tarafından kısaltılır.

guiding_strength (`float`, varsayılan `1.0`) : `guidance_latents` için enjeksiyon gücü.

negative_index_latents (`torch.Tensor`, *isteğe bağlı*) : "negatif indeks" semantiği için pencere başına eklenen tek kareli latent.

negative_index_strength (`float`, varsayılan `1.0`) : `negative_index_latents` için enjeksiyon gücü.

skip_steps_sigma_threshold (`float`, *isteğe bağlı*, varsayılan `1`) : Sigma değeri bu eşiği aşan adımları atlar.

decode_timestep (`float`, *isteğe bağlı*, varsayılan `0.05`) : Çözme zamanı zaman adımı (VAE timestep_conditioning'i destekliyorsa).

decode_noise_scale (`float`, *isteğe bağlı*, varsayılan `0.025`) : Çözme zamanı gürültü karışım ölçeği (VAE timestep_conditioning'i destekliyorsa).

decode_horizontal_tiles (`int`, varsayılan `4`) : VAE çözme sırasında yatay karoların sayısı.

decode_vertical_tiles (`int`, varsayılan `4`) : VAE çözme sırasında dikey karoların sayısı.

decode_overlap (`int`, varsayılan `3`) : VAE çözme sırasında karolar arasındaki örtüşme (latent piksel cinsinden).

output_type (`str`, *isteğe bağlı*, varsayılan `"latent"`) : Üretilen videonun çıktı biçimi. "latent", "pt", "np" veya "pil" arasında seçim yapın. "latent" seçilirse, çözülmeden latentler döndürülür.

return_dict (`bool`, *isteğe bağlı*, varsayılan `True`) : Düz bir tuple yerine `~pipelines.ltx.LTXPipelineOutput` döndürülecek mi?

attention_kwargs (`dict`, *isteğe bağlı*) : Transformer'a iletilecek ek dikkat parametreleri.

callback_on_step_end (`PipelineCallback` veya `MultiPipelineCallbacks`, *isteğe bağlı*) : Adım başına geri çağrı kancası.

callback_on_step_end_tensor_inputs (`list[str]`, varsayılan `["latents"]`) : Geri çağrıya (callback) aktarılacak locals() anahtarları.

max_sequence_length (`int`, varsayılan `128`) : İstem kodlaması için Tokenizer maksimum uzunluğu.

**Dönüş:** `~pipelines.ltx.LTXPipelineOutput` veya `tuple`

`return_dict` `True` ise `~pipelines.ltx.LTXPipelineOutput` döndürülür, aksi halde ilk öğesi üretilen karelerin listesini içeren bir `tuple` döndürülür. Çıktı biçimi `output_type` değerine bağlıdır:
- "latent"/"pt": `torch.Tensor` [B, C, F, H, W]; "latent" normalize edilmiş latent uzayda, "pt" ise VAE çıktı uzayındadır.
- "np": `np.ndarray` işlenmiş.
- "pil": `list[PIL.Image.Image]` PIL görüntüleri listesi.

Zaman kayan pencereleri ve çoklu istem zamanlaması kullanarak görüntüden videoya bir dizi oluşturun.

Örnekler:
```py
>>> import torch
>>> from diffusers import LTXEulerAncestralRFScheduler, LTXI2VLongMultiPromptPipeline

>>> pipe = LTXI2VLongMultiPromptPipeline.from_pretrained("LTX-Video-0.9.8-13B-distilled")
>>> # For ComfyUI parity, swap in the RF scheduler (keeps the original config).
>>> pipe.scheduler = LTXEulerAncestralRFScheduler.from_config(pipe.scheduler.config)
>>> pipe = pipe.to("cuda").to(dtype=torch.bfloat16)
>>> # Example A: get decoded frames (PIL)
>>> out = pipe(
...     prompt="a chimpanzee walks | a chimpanzee eats",
...     num_frames=161,
...     height=512,
...     width=704,
...     temporal_tile_size=80,
...     temporal_overlap=24,
...     output_type="pil",
...     return_dict=True,
... )
>>> frames = out.frames[0]  # list of PIL.Image.Image
>>> # Example B: get latent video and decode later (saves VRAM during sampling)
>>> out_latent = pipe(prompt="a chimpanzee walking", output_type="latent", return_dict=True).frames
>>> frames = pipe.vae_decode_tiled(out_latent, output_type="pil")[0]
```

Şekiller: Gizli boyutlar (otomatik oluşturulduğunda):
- F_lat = (num_frames - 1) // vae_temporal_compression_ratio + 1
- H_lat = height // vae_spatial_compression_ratio
- W_lat = width // vae_spatial_compression_ratio

Notlar:
- Seeding: `seed` sağlandığında, her zaman penceresi `seed + w_start` ile tohumlanmış yerel bir üreteç kullanır; bir üreteç geçirilmediyse ortak üreteç, küresel latentler için bir kez tohumlanır, aksi halde geçirilen üreteç yeniden kullanılır.
- CFG: isteğe bağlı `guidance_rescale` ile birleşik `noise_pred = uncond + w * (text - uncond)`.
- Bellek: denoising tam çerçeve tahminleri yapar (uzamsal karolama yoktur); OOM'den kaçınmak için decoding karolamaya tabi tutulabilir.

#### encode_prompt[[diffusers.LTXI2VLongMultiPromptPipeline.encode_prompt]]

```python
encode_prompt(prompt: str | list[str], negative_prompt: str | list[str] | None = None, do_classifier_free_guidance: bool = True, num_videos_per_prompt: int = 1, prompt_embeds: torch.Tensor | None = None, negative_prompt_embeds: torch.Tensor | None = None, prompt_attention_mask: torch.Tensor | None = None, negative_prompt_attention_mask: torch.Tensor | None = None, max_sequence_length: int = 128, device: torch.device | None = None, dtype: torch.dtype | None = None)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_i2v_long_multi_prompt.py#L552)

**Parametreler:**

prompt (`str` veya `list[str]`, *isteğe bağlı*) : kodlanacak istem

negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmemek için kullanılan istem veya istemler. Tanımlanmazsa, bunun yerine `negative_prompt_embeds` parametresinin geçirilmesi gerekir. Yönlendirme kullanılmadığında (yani `guidance_scale` değeri `1`'den küçükse) yok sayılır.

do_classifier_free_guidance (`bool`, *isteğe bağlı*, varsayılan `True`) : Sınıflandırıcı serbest yönlendirmenin (classifier free guidance) kullanılıp kullanılmayacağı.

num_videos_per_prompt (`int`, *opsiyonel*, varsayılan 1) : Her istem için oluşturulması gereken video sayısı. Sonuç gömme vektörlerinin yerleştirileceği torch cihazı

prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından oluşturulur.

negative_prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş negatif metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, negative_prompt_embeds, `negative_prompt` girdi argümanından oluşturulur.

device : (`torch.device`, *isteğe bağlı*): torch cihazı

dtype : (`torch.dtype`, *isteğe bağlı*): torch dtype

İsteği metin kodlayıcı gizli durumlarına kodlar.

#### prepare_latents[[diffusers.LTXI2VLongMultiPromptPipeline.prepare_latents]]

```python
prepare_latents(batch_size: int, num_channels_latents: int, height: int, width: int, num_frames: int, device: torch.device, generator: torch.Generator | None, dtype: torch.dtype = torch.float32, latents: torch.Tensor | None = None, cond_latents: torch.Tensor | None = None, cond_strength: float = 0.0, negative_index_latents: torch.Tensor | None = None)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_i2v_long_multi_prompt.py#L694)

**Dönüş:**

latents, negative_index_latents, latent_num_frames, latent_height, latent_width

Temel latentleri hazırlayın ve isteğe bağlı olarak ilk kare koşullama latentlerini enjekte edin.

#### vae_decode_tiled[[diffusers.LTXI2VLongMultiPromptPipeline.vae_decode_tiled]]

```python
vae_decode_tiled(latents: torch.Tensor, decode_timestep: float | None = None, decode_noise_scale: float | None = None, horizontal_tiles: int = 4, vertical_tiles: int = 4, overlap: int = 3, last_frame_fix: bool = True, generator: torch.Generator | None = None, output_type: str = 'pt', auto_denormalize: bool = True, compute_dtype: torch.dtype = torch.float32, enable_vae_tiling: bool = False)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_i2v_long_multi_prompt.py#L738)

**Parametreler:**

latents : [B, C_latent, F_latent, H_latent, W_latent]

decode_timestep : İsteğe bağlı çözme zaman adımı (yalnızca VAE timestep_conditioning destekliyorsa geçerlidir)

decode_noise_scale : İsteğe bağlı çözme gürültüsü interpolasyonu (yalnızca VAE timestep_conditioning'i destekliyorsa geçerlidir)

horizontal_tiles, vertical_tiles : Yatay/dikey olarak karo sayısı (>= 1)

overlap : Gizli uzayda örtüşme (gizli piksellerde, >= 0)

last_frame_fix : "Son kareyi tekrarla" düzeltmesini etkinleştirip etkinleştirmeyeceği

generator : Rastgele üreteç (decode_noise_scale gürültüsü için kullanılır)

output_type : "latent" | "pt" | "np" | "pil" - "latent": latent değişkenleri değiştirilmeden döndürür (aşağı akış işleme için faydalıdır) - "pt": VAE çıktı uzayındaki tensörü döndürür - "np"/"pil": VideoProcessor.postprocess_video ile işlenmiş çıktıları döndürür

auto_denormalize : True ise, `latents` içine LTX de-normalizasyonu uygulanır (önerilir)

compute_dtype : Karo birleştirme sırasında kullanılan hassasiyet (varsayılan float32; dikiş bulanıklığını önemli ölçüde azaltır)

enable_vae_tiling : True ise, karoları VAE'nin yerleşik `tiled_decode` işlevine devredin (`vae.use_tiling` ayarlanır).

**Dönüş:** `- If output_type="latent"`

girdi `latents` değerini değiştirmeden döndürür
- output_type="pt" ise: [B, C, F, H, W] döndürür (değerler yaklaşık [-1, 1] aralığındadır)
- output_type="np"/"pil" ise: postprocess_video aracılığıyla işlenmiş çıktıları döndürür

Diffusers tarzında uygulanan, ComfyUI ile uyumlu VAE tabanlı uzamsal karolalı çözümleme.
- Çakışan karoları doğrusal olarak tüyler ve karıştırarak dikişleri önleyin.
- İsteğe bağlı last_frame_fix: çözümlenmeden önce son latent kareyi kopyalayın, ardından sonundan time_scale_factor kareyi atın.
- timestep_conditioning ve decode_noise_scale enjeksiyonunu destekler.
- Varsayılan olarak, "normalized latents" (gürültüden arındırma çıktısı) içsel olarak de-normalize edilir (auto_denormalize=True).
- Tile fusion, bulanıklık ve renk kaymalarını azaltmak için compute_dtype (varsayılan olarak float32) içinde hesaplanır.

## LTXPipeline[[diffusers.LTXPipeline]]

#### diffusers.LTXPipeline[[diffusers.LTXPipeline]]

```python
diffusers.LTXPipeline(scheduler: FlowMatchEulerDiscreteScheduler, vae: AutoencoderKLLTXVideo, text_encoder: T5EncoderModel, tokenizer: T5Tokenizer, transformer: LTXVideoTransformer3DModel)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx.py#L170)

**Parametreler:**

transformer ([LTXVideoTransformer3DModel](/docs/diffusers/main/tr/api/models/ltx_video_transformer3d#diffusers.LTXVideoTransformer3DModel)) : Kodlanmış video latentlerini gürültüden arındırmak için kullanılan koşullu Transformer mimarisi.

scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/tr/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler)) : Kodlanmış görüntü latentlerini gürültüden arındırmak için `transformer` ile birlikte kullanılacak bir zamanlayıcı.

vae ([AutoencoderKLLTXVideo](/docs/diffusers/main/tr/api/models/autoencoderkl_ltx_video#diffusers.AutoencoderKLLTXVideo)) : Görüntüleri latent temsillere kodlamak ve latent temsillerden görüntülere çözmek için kullanılan Varyasyonel Oto-Kodlayıcı (VAE) Modeli.

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel), özellikle [google/t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl) varyantı.

tokenizer (`CLIPTokenizer`) : [CLIPTokenizer](https://huggingface.co/docs/transformers/en/model_doc/clip#transformers.CLIPTokenizer) sınıfının tokenizer'ı.

tokenizer (`T5TokenizerFast`) : [T5TokenizerFast](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast) sınıfının ikinci Tokenizer'ı.

Metinden videoya üretim için Pipeline.

Referans: https://github.com/Lightricks/LTX-Video

#### __call__[[diffusers.LTXPipeline.__call__]]

```python
__call__(prompt: str | list[str] = None, negative_prompt: str | list[str] | None = None, height: int = 512, width: int = 704, num_frames: int = 161, frame_rate: int = 25, num_inference_steps: int = 50, timesteps: list = None, guidance_scale: float = 3, guidance_rescale: float = 0.0, num_videos_per_prompt: int | None = 1, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, latents: typing.Optional[torch.Tensor] = None, prompt_embeds: typing.Optional[torch.Tensor] = None, prompt_attention_mask: typing.Optional[torch.Tensor] = None, negative_prompt_embeds: typing.Optional[torch.Tensor] = None, negative_prompt_attention_mask: typing.Optional[torch.Tensor] = None, decode_timestep: float | list[float] = 0.0, decode_noise_scale: float | list[float] | None = None, output_type: str | None = 'pil', return_dict: bool = True, attention_kwargs: dict[str, typing.Any] | None = None, callback_on_step_end: typing.Optional[typing.Callable[[int, int], NoneType]] = None, callback_on_step_end_tensor_inputs: list = ['latents'], max_sequence_length: int = 128)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx.py#L535)

**Parametreler:**

prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmek için istem veya istemler. Tanımlanmamışsa, bunun yerine `prompt_embeds` geçirilmelidir.

negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmemek için kullanılan istem veya istemler. Tanımlanmamışsa bunun yerine `negative_prompt_embeds` parametresinin geçirilmesi gerekir. Yönlendirme kullanılmadığında (`guidance_scale < 1`) yok sayılır.

height (`int`, varsayılan `512`) : Üretilen görüntünün piksel cinsinden yüksekliği. En iyi sonuçlar için varsayılan olarak 480 olarak ayarlanır.

width (`int`, varsayılan `704`) : Üretilen görüntünün piksel cinsinden genişliği. En iyi sonuçlar için bu değer varsayılan olarak 848 olarak ayarlanır.

num_frames (`int`, varsayılan `161`) : Üretilecek video kare sayısı

frame_rate (`int`, varsayılan `25`) : Üretilen videonun hedef kare hızı.

num_inference_steps (`int`, *isteğe bağlı*, varsayılan 50) : Gürültü azaltma adım sayısı. Daha fazla gürültü azaltma adımı genellikle daha yavaş çıkarım pahasına daha yüksek kaliteli bir görüntüye yol açar.

timesteps (`list[int]`, *isteğe bağlı*) : `set_timesteps` metodunda `timesteps` argümanını destekleyen zamanlayıcılarla gürültü azaltma süreci için kullanılacak özel zaman adımları. Tanımlanmamışsa, `num_inference_steps` geçirildiğinde varsayılan davranış kullanılacaktır. Azalan sırada olmalıdır.

guidance_scale (`float`, varsayılan `3 `) : [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598)'de tanımlanan yönlendirme ölçeği. `guidance_scale`, [Imagen Paper](https://huggingface.co/papers/2205.11487)'deki 2. denklemindeki `w` olarak tanımlanır. Yönlendirme ölçeği, `guidance_scale > 1` olarak ayarlanarak etkinleştirilir. Daha yüksek yönlendirme ölçeği, genellikle daha düşük görüntü kalitesi pahasına, `prompt` ile yakından ilişkili görüntülerin üretilmesini teşvik eder.

guidance_rescale (`float`, *opsiyonel*, varsayılan 0.0) : [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) makalesinde önerilen guidance rescale faktörü. `guidance_scale`, [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) makalesindeki 16. denklemde `φ` olarak tanımlanmıştır. Guidance rescale faktörü, sıfır terminal SNR kullanıldığında aşırı pozlamayı düzeltmelidir.

num_videos_per_prompt (`int`, *isteğe bağlı*, varsayılan 1) : Her istem için üretilecek video sayısı.

generator (`torch.Generator` veya `list[torch.Generator]`, *isteğe bağlı*) : Üretimi deterministik hale getirmek için bir veya [torch üreteci(leri)](https://pytorch.org/docs/stable/generated/torch.Generator.html) listesi.

latents (`torch.Tensor`, *isteğe bağlı*) : Görsel üretimi için girdi olarak kullanılacak, Gauss dağılımından örneklenen önceden oluşturulmuş gürültülü latentler. Farklı istemlerle aynı üretimi ayarlamak için kullanılabilir. Sağlanmazsa, sağlanan rastgele `generator` kullanılarak örneklem yoluyla bir latent tensörü oluşturulur.

prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından oluşturulur.

prompt_attention_mask (`torch.Tensor`, *isteğe bağlı*) : Metin gömme (embedding) için önceden oluşturulmuş dikkat maskesi (attention mask).

negative_prompt_embeds (`torch.FloatTensor`, *isteğe bağlı*) : Önceden oluşturulmuş negatif metin gömme değerleri. PixArt-Sigma için bu negatif istem "" olmalıdır. Sağlanmazsa, negative_prompt_embeds, `negative_prompt` girdi argümanından oluşturulur.

negative_prompt_attention_mask (`torch.FloatTensor`, *isteğe bağlı*) : Negatif metin gömme vektörleri için önceden oluşturulmuş dikkat maskesi.

decode_timestep (`float`, varsayılan `0.0`) : Üretilen videonun çözümlendiği zaman adımı.

decode_noise_scale (`float`, varsayılan `None`) : Çözme zaman adımında rastgele gürültü ile gürültüsü azaltılmış latentler arasındaki interpolasyon katsayısı.

output_type (`str`, *isteğe bağlı*, varsayılan `"pil"`) : Üretilen görüntünün çıktı biçimi. [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` veya `np.array` arasında seçim yapın.

return_dict (`bool`, *isteğe bağlı*, varsayılan `True`) : Düz bir tuple yerine `~pipelines.ltx.LTXPipelineOutput` döndürülecek mi?

attention_kwargs (`dict`, *isteğe bağlı*) : Belirtilirse, [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py) içinde `self.processor` altında tanımlanan `AttentionProcessor`'a iletilen bir kwargs sözlüğü.

callback_on_step_end (`Callable`, *isteğe bağlı*) : Çıkarım sırasında her gürültü azaltma adımının sonunda çağrılan bir işlev. İşlev aşağıdaki argümanlarla çağrılır: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. `callback_kwargs`, `callback_on_step_end_tensor_inputs` tarafından belirtilen tüm tensörlerin listesini içerir.

callback_on_step_end_tensor_inputs (`list`, *isteğe bağlı*) : `callback_on_step_end` işlevi için girdi tensörlerinin listesi. Listede belirtilen tensörler, `callback_kwargs` argümanı olarak geçirilir. Yalnızca pipeline sınıfınızın `._callback_tensor_inputs` özniteliğinde listelenen değişkenleri dahil edebilirsiniz.

max_sequence_length (`int` varsayılan olarak `128 `) : `prompt` ile kullanılacak maksimum dizi uzunluğu.

**Dönüş:** `~pipelines.ltx.LTXPipelineOutput` veya `tuple`

`return_dict` `True` ise `~pipelines.ltx.LTXPipelineOutput` döndürülür, aksi halde ilk öğesi üretilen görsellerin listesini içeren bir `tuple` döndürülür.

Üretim için pipeline çağrıldığında tetiklenen işlev.

Örnekler:
```py
>>> import torch
>>> from diffusers import LTXPipeline
>>> from diffusers.utils import export_to_video

>>> pipe = LTXPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16)
>>> pipe.to("cuda")

>>> prompt = "A woman with long brown hair and light skin smiles at another woman with long blonde hair. The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek. The camera angle is a close-up, focused on the woman with brown hair's face. The lighting is warm and natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage"
>>> negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"

>>> video = pipe(
...     prompt=prompt,
...     negative_prompt=negative_prompt,
...     width=704,
...     height=480,
...     num_frames=161,
...     num_inference_steps=50,
... ).frames[0]
>>> export_to_video(video, "output.mp4", fps=24)
```

#### encode_prompt[[diffusers.LTXPipeline.encode_prompt]]

```python
encode_prompt(prompt: str | list[str], negative_prompt: str | list[str] | None = None, do_classifier_free_guidance: bool = True, num_videos_per_prompt: int = 1, prompt_embeds: typing.Optional[torch.Tensor] = None, negative_prompt_embeds: typing.Optional[torch.Tensor] = None, prompt_attention_mask: typing.Optional[torch.Tensor] = None, negative_prompt_attention_mask: typing.Optional[torch.Tensor] = None, max_sequence_length: int = 128, device: typing.Optional[torch.device] = None, dtype: typing.Optional[torch.dtype] = None)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx.py#L283)

**Parametreler:**

prompt (`str` veya `list[str]`, *isteğe bağlı*) : kodlanacak istem

negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmemek için kullanılan istem veya istemler. Tanımlanmazsa, bunun yerine `negative_prompt_embeds` parametresinin geçirilmesi gerekir. Yönlendirme kullanılmadığında (yani `guidance_scale` değeri `1`'den küçükse) yok sayılır.

do_classifier_free_guidance (`bool`, *isteğe bağlı*, varsayılan `True`) : Sınıflandırıcı serbest yönlendirmenin (classifier free guidance) kullanılıp kullanılmayacağı.

num_videos_per_prompt (`int`, *opsiyonel*, varsayılan 1) : Her istem için oluşturulması gereken video sayısı. Sonuç gömme vektörlerinin yerleştirileceği torch cihazı

prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından oluşturulur.

negative_prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş negatif metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, negative_prompt_embeds, `negative_prompt` girdi argümanından oluşturulur.

device : (`torch.device`, *isteğe bağlı*): torch cihazı

dtype : (`torch.dtype`, *isteğe bağlı*): torch dtype

İsteği metin kodlayıcı gizli durumlarına kodlar.

## LTXImageToVideoPipeline[[diffusers.LTXImageToVideoPipeline]]

#### diffusers.LTXImageToVideoPipeline[[diffusers.LTXImageToVideoPipeline]]

```python
diffusers.LTXImageToVideoPipeline(scheduler: FlowMatchEulerDiscreteScheduler, vae: AutoencoderKLLTXVideo, text_encoder: T5EncoderModel, tokenizer: T5Tokenizer, transformer: LTXVideoTransformer3DModel)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py#L189)

**Parametreler:**

transformer ([LTXVideoTransformer3DModel](/docs/diffusers/main/tr/api/models/ltx_video_transformer3d#diffusers.LTXVideoTransformer3DModel)) : Kodlanmış video latentlerini gürültüden arındırmak için kullanılan koşullu Transformer mimarisi.

scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/tr/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler)) : Kodlanmış görüntü latentlerini gürültüden arındırmak için `transformer` ile birlikte kullanılacak bir zamanlayıcı.

vae ([AutoencoderKLLTXVideo](/docs/diffusers/main/tr/api/models/autoencoderkl_ltx_video#diffusers.AutoencoderKLLTXVideo)) : Görüntüleri latent temsillere kodlamak ve latent temsillerden görüntülere çözmek için kullanılan Varyasyonel Oto-Kodlayıcı (VAE) Modeli.

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel), özellikle [google/t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl) varyantı.

tokenizer (`CLIPTokenizer`) : [CLIPTokenizer](https://huggingface.co/docs/transformers/en/model_doc/clip#transformers.CLIPTokenizer) sınıfının tokenizer'ı.

tokenizer (`T5TokenizerFast`) : [T5TokenizerFast](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast) sınıfının ikinci Tokenizer'ı.

Görselden video üretimi için pipeline.

Referans: https://github.com/Lightricks/LTX-Video

#### __call__[[diffusers.LTXImageToVideoPipeline.__call__]]

```python
__call__(image: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor]] = None, prompt: str | list[str] = None, negative_prompt: str | list[str] | None = None, height: int = 512, width: int = 704, num_frames: int = 161, frame_rate: int = 25, num_inference_steps: int = 50, timesteps: list = None, guidance_scale: float = 3, guidance_rescale: float = 0.0, num_videos_per_prompt: int | None = 1, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, latents: typing.Optional[torch.Tensor] = None, prompt_embeds: typing.Optional[torch.Tensor] = None, prompt_attention_mask: typing.Optional[torch.Tensor] = None, negative_prompt_embeds: typing.Optional[torch.Tensor] = None, negative_prompt_attention_mask: typing.Optional[torch.Tensor] = None, decode_timestep: float | list[float] = 0.0, decode_noise_scale: float | list[float] | None = None, output_type: str | None = 'pil', return_dict: bool = True, attention_kwargs: dict[str, typing.Any] | None = None, callback_on_step_end: typing.Optional[typing.Callable[[int, int], NoneType]] = None, callback_on_step_end_tensor_inputs: list = ['latents'], max_sequence_length: int = 128)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py#L596)

**Parametreler:**

image (`PipelineImageInput`) : Üretimi koşullandırmak için girdi olarak kullanılan görüntü. Bir görüntü, görüntü listesi veya `torch.Tensor` olmalıdır.

prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmek için istem veya istemler. Tanımlanmamışsa, bunun yerine `prompt_embeds` geçirilmelidir.

negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmemek için kullanılan istem veya istemler. Tanımlanmamışsa bunun yerine `negative_prompt_embeds` parametresinin geçirilmesi gerekir. Yönlendirme kullanılmadığında (`guidance_scale < 1`) yok sayılır.

height (`int`, varsayılan `512`) : Üretilen görüntünün piksel cinsinden yüksekliği. En iyi sonuçlar için varsayılan olarak 480 olarak ayarlanır.

width (`int`, varsayılan `704`) : Üretilen görüntünün piksel cinsinden genişliği. En iyi sonuçlar için bu değer varsayılan olarak 848 olarak ayarlanır.

num_frames (`int`, varsayılan `161`) : Üretilecek video kare sayısı

frame_rate (`int`, varsayılan `25`) : Üretilen videonun hedef kare hızı.

num_inference_steps (`int`, *isteğe bağlı*, varsayılan 50) : Gürültü azaltma adım sayısı. Daha fazla gürültü azaltma adımı genellikle daha yavaş çıkarım pahasına daha yüksek kaliteli bir görüntüye yol açar.

timesteps (`list[int]`, *isteğe bağlı*) : `set_timesteps` metodunda `timesteps` argümanını destekleyen zamanlayıcılarla gürültü azaltma süreci için kullanılacak özel zaman adımları. Tanımlanmamışsa, `num_inference_steps` geçirildiğinde varsayılan davranış kullanılacaktır. Azalan sırada olmalıdır.

guidance_scale (`float`, varsayılan `3 `) : [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598)'de tanımlanan yönlendirme ölçeği. `guidance_scale`, [Imagen Paper](https://huggingface.co/papers/2205.11487)'deki 2. denklemindeki `w` olarak tanımlanır. Yönlendirme ölçeği, `guidance_scale > 1` olarak ayarlanarak etkinleştirilir. Daha yüksek yönlendirme ölçeği, genellikle daha düşük görüntü kalitesi pahasına, `prompt` ile yakından ilişkili görüntülerin üretilmesini teşvik eder.

guidance_rescale (`float`, *opsiyonel*, varsayılan 0.0) : [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) makalesinde önerilen guidance rescale faktörü. `guidance_scale`, [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) makalesindeki 16. denklemde `φ` olarak tanımlanmıştır. Guidance rescale faktörü, sıfır terminal SNR kullanıldığında aşırı pozlamayı düzeltmelidir.

num_videos_per_prompt (`int`, *isteğe bağlı*, varsayılan 1) : Her istem için üretilecek video sayısı.

generator (`torch.Generator` veya `list[torch.Generator]`, *isteğe bağlı*) : Üretimi deterministik hale getirmek için bir veya [torch üreteci(leri)](https://pytorch.org/docs/stable/generated/torch.Generator.html) listesi.

latents (`torch.Tensor`, *isteğe bağlı*) : Görsel üretimi için girdi olarak kullanılacak, Gauss dağılımından örneklenen önceden oluşturulmuş gürültülü latentler. Farklı istemlerle aynı üretimi ayarlamak için kullanılabilir. Sağlanmazsa, sağlanan rastgele `generator` kullanılarak örneklem yoluyla bir latent tensörü oluşturulur.

prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından oluşturulur.

prompt_attention_mask (`torch.Tensor`, *isteğe bağlı*) : Metin gömme (embedding) için önceden oluşturulmuş dikkat maskesi (attention mask).

negative_prompt_embeds (`torch.FloatTensor`, *isteğe bağlı*) : Önceden oluşturulmuş negatif metin gömme değerleri. PixArt-Sigma için bu negatif istem "" olmalıdır. Sağlanmazsa, negative_prompt_embeds, `negative_prompt` girdi argümanından oluşturulur.

negative_prompt_attention_mask (`torch.FloatTensor`, *isteğe bağlı*) : Negatif metin gömme vektörleri için önceden oluşturulmuş dikkat maskesi.

decode_timestep (`float`, varsayılan `0.0`) : Üretilen videonun çözümlendiği zaman adımı.

decode_noise_scale (`float`, varsayılan `None`) : Çözme zaman adımında rastgele gürültü ile gürültüsü azaltılmış latentler arasındaki interpolasyon katsayısı.

output_type (`str`, *isteğe bağlı*, varsayılan `"pil"`) : Üretilen görüntünün çıktı biçimi. [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` veya `np.array` arasında seçim yapın.

return_dict (`bool`, *isteğe bağlı*, varsayılan `True`) : Düz bir tuple yerine `~pipelines.ltx.LTXPipelineOutput` döndürülecek mi?

attention_kwargs (`dict`, *isteğe bağlı*) : Belirtilirse, [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py) içinde `self.processor` altında tanımlanan `AttentionProcessor`'a iletilen bir kwargs sözlüğü.

callback_on_step_end (`Callable`, *isteğe bağlı*) : Çıkarım sırasında her gürültü azaltma adımının sonunda çağrılan bir işlev. İşlev aşağıdaki argümanlarla çağrılır: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. `callback_kwargs`, `callback_on_step_end_tensor_inputs` tarafından belirtilen tüm tensörlerin listesini içerir.

callback_on_step_end_tensor_inputs (`list`, *isteğe bağlı*) : `callback_on_step_end` işlevi için girdi tensörlerinin listesi. Listede belirtilen tensörler, `callback_kwargs` argümanı olarak geçirilir. Yalnızca pipeline sınıfınızın `._callback_tensor_inputs` özniteliğinde listelenen değişkenleri dahil edebilirsiniz.

max_sequence_length (`int` varsayılan olarak `128 `) : `prompt` ile kullanılacak maksimum dizi uzunluğu.

**Dönüş:** `~pipelines.ltx.LTXPipelineOutput` veya `tuple`

`return_dict` `True` ise `~pipelines.ltx.LTXPipelineOutput` döndürülür, aksi halde ilk öğesi üretilen görsellerin listesini içeren bir `tuple` döndürülür.

Üretim için pipeline çağrıldığında tetiklenen işlev.

Örnekler:
```py
>>> import torch
>>> from diffusers import LTXImageToVideoPipeline
>>> from diffusers.utils import export_to_video, load_image

>>> pipe = LTXImageToVideoPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16)
>>> pipe.to("cuda")

>>> image = load_image(
...     "https://huggingface.co/datasets/a-r-r-o-w/tiny-meme-dataset-captioned/resolve/main/images/8.png"
... )
>>> prompt = "A young girl stands calmly in the foreground, looking directly at the camera, as a house fire rages in the background. Flames engulf the structure, with smoke billowing into the air. Firefighters in protective gear rush to the scene, a fire truck labeled '38' visible behind them. The girl's neutral expression contrasts sharply with the chaos of the fire, creating a poignant and emotionally charged scene."
>>> negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"

>>> video = pipe(
...     image=image,
...     prompt=prompt,
...     negative_prompt=negative_prompt,
...     width=704,
...     height=480,
...     num_frames=161,
...     num_inference_steps=50,
... ).frames[0]
>>> export_to_video(video, "output.mp4", fps=24)
```

#### encode_prompt[[diffusers.LTXImageToVideoPipeline.encode_prompt]]

```python
encode_prompt(prompt: str | list[str], negative_prompt: str | list[str] | None = None, do_classifier_free_guidance: bool = True, num_videos_per_prompt: int = 1, prompt_embeds: typing.Optional[torch.Tensor] = None, negative_prompt_embeds: typing.Optional[torch.Tensor] = None, prompt_attention_mask: typing.Optional[torch.Tensor] = None, negative_prompt_attention_mask: typing.Optional[torch.Tensor] = None, max_sequence_length: int = 128, device: typing.Optional[torch.device] = None, dtype: typing.Optional[torch.dtype] = None)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py#L306)

**Parametreler:**

prompt (`str` veya `list[str]`, *isteğe bağlı*) : kodlanacak istem

negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmemek için kullanılan istem veya istemler. Tanımlanmazsa, bunun yerine `negative_prompt_embeds` parametresinin geçirilmesi gerekir. Yönlendirme kullanılmadığında (yani `guidance_scale` değeri `1`'den küçükse) yok sayılır.

do_classifier_free_guidance (`bool`, *isteğe bağlı*, varsayılan `True`) : Sınıflandırıcı serbest yönlendirmenin (classifier free guidance) kullanılıp kullanılmayacağı.

num_videos_per_prompt (`int`, *opsiyonel*, varsayılan 1) : Her istem için oluşturulması gereken video sayısı. Sonuç gömme vektörlerinin yerleştirileceği torch cihazı

prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından oluşturulur.

negative_prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş negatif metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, negative_prompt_embeds, `negative_prompt` girdi argümanından oluşturulur.

device : (`torch.device`, *isteğe bağlı*): torch cihazı

dtype : (`torch.dtype`, *isteğe bağlı*): torch dtype

İsteği metin kodlayıcı gizli durumlarına kodlar.

## LTXConditionPipeline[[diffusers.LTXConditionPipeline]]

#### diffusers.LTXConditionPipeline[[diffusers.LTXConditionPipeline]]

```python
diffusers.LTXConditionPipeline(scheduler: FlowMatchEulerDiscreteScheduler, vae: AutoencoderKLLTXVideo, text_encoder: T5EncoderModel, tokenizer: T5Tokenizer, transformer: LTXVideoTransformer3DModel)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py#L252)

**Parametreler:**

transformer ([LTXVideoTransformer3DModel](/docs/diffusers/main/tr/api/models/ltx_video_transformer3d#diffusers.LTXVideoTransformer3DModel)) : Kodlanmış video latentlerini gürültüden arındırmak için kullanılan koşullu Transformer mimarisi.

scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/tr/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler)) : Kodlanmış görüntü latentlerini gürültüden arındırmak için `transformer` ile birlikte kullanılacak bir zamanlayıcı.

vae ([AutoencoderKLLTXVideo](/docs/diffusers/main/tr/api/models/autoencoderkl_ltx_video#diffusers.AutoencoderKLLTXVideo)) : Görüntüleri latent temsillere kodlamak ve latent temsillerden görüntülere çözmek için kullanılan Varyasyonel Oto-Kodlayıcı (VAE) Modeli.

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel), özellikle [google/t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl) varyantı.

tokenizer (`CLIPTokenizer`) : [CLIPTokenizer](https://huggingface.co/docs/transformers/en/model_doc/clip#transformers.CLIPTokenizer) sınıfının tokenizer'ı.

tokenizer (`T5TokenizerFast`) : [T5TokenizerFast](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast) sınıfının ikinci Tokenizer'ı.

Metin/görsel/video'dan video üretimi için pipeline.

Referans: https://github.com/Lightricks/LTX-Video

#### __call__[[diffusers.LTXConditionPipeline.__call__]]

```python
__call__(conditions: diffusers.pipelines.ltx.pipeline_ltx_condition.LTXVideoCondition | list[diffusers.pipelines.ltx.pipeline_ltx_condition.LTXVideoCondition] = None, image: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor], list[typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor]]]] = None, video: list = None, frame_index: int | list[int] = 0, strength: float | list[float] = 1.0, denoise_strength: float = 1.0, prompt: str | list[str] = None, negative_prompt: str | list[str] | None = None, height: int = 512, width: int = 704, num_frames: int = 161, frame_rate: int = 25, num_inference_steps: int = 50, timesteps: list = None, guidance_scale: float = 3, guidance_rescale: float = 0.0, image_cond_noise_scale: float = 0.15, num_videos_per_prompt: int | None = 1, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, latents: typing.Optional[torch.Tensor] = None, prompt_embeds: typing.Optional[torch.Tensor] = None, prompt_attention_mask: typing.Optional[torch.Tensor] = None, negative_prompt_embeds: typing.Optional[torch.Tensor] = None, negative_prompt_attention_mask: typing.Optional[torch.Tensor] = None, decode_timestep: float | list[float] = 0.0, decode_noise_scale: float | list[float] | None = None, output_type: str | None = 'pil', return_dict: bool = True, attention_kwargs: dict[str, typing.Any] | None = None, callback_on_step_end: typing.Optional[typing.Callable[[int, int], NoneType]] = None, callback_on_step_end_tensor_inputs: list = ['latents'], max_sequence_length: int = 256)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py#L848)

**Parametreler:**

conditions (`list[LTXVideoCondition], *optional*`) : Video üretimi için kare koşullandırma öğelerinin listesi. Sağlanmazsa, koşullar `image`, `video`, `frame_index` ve `strength` kullanılarak oluşturulur.

image (`PipelineImageInput` veya `list[PipelineImageInput]`, *isteğe bağlı*) : Video üretimini koşullandırmak için kullanılacak görüntü veya görüntüler. Sağlanmazsa, `video` veya `conditions` parametresinin geçirilmesi gerekir.

video (`list[PipelineImageInput]`, *isteğe bağlı*) : Video üretimini koşullandırmak için kullanılacak video. Sağlanmazsa, `image` veya `conditions` parametrelerinden birinin geçirilmesi gerekir.

frame_index (`int` veya `list[int]`, *isteğe bağlı*) : Görüntünün veya videonun video üretimini koşullu olarak etkileyeceği kare indeksi veya kare indeksleri. Sağlanmazsa, `conditions` parametresinin geçirilmesi gerekir.

strength (`float` veya `list[float]`, *isteğe bağlı*) : Koşullandırma etkisinin gücü veya güçleri. Verilmezse, `conditions` parametresinin geçirilmesi gerekir.

denoise_strength (`float`, varsayılan `1.0`) : Düzenleme için latente eklenen gürültünün şiddeti. Daha yüksek şiddet, latente daha fazla gürültü eklenmesine ve dolayısıyla orijinal video ile üretilen video arasında daha fazla farka yol açar. Bu, video-dan-video düzenleme için faydalıdır.

prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmek için istem veya istemler. Tanımlanmamışsa, bunun yerine `prompt_embeds` geçirilmelidir.

negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmemek için kullanılan istem veya istemler. Tanımlanmamışsa bunun yerine `negative_prompt_embeds` parametresinin geçirilmesi gerekir. Yönlendirme kullanılmadığında (`guidance_scale < 1`) yok sayılır.

height (`int`, varsayılan `512`) : Üretilen görüntünün piksel cinsinden yüksekliği. En iyi sonuçlar için varsayılan olarak 480 olarak ayarlanır.

width (`int`, varsayılan `704`) : Üretilen görüntünün piksel cinsinden genişliği. En iyi sonuçlar için bu değer varsayılan olarak 848 olarak ayarlanır.

num_frames (`int`, varsayılan `161`) : Üretilecek video kare sayısı

frame_rate (`int`, varsayılan `25`) : Üretilen videonun hedef kare hızı.

num_inference_steps (`int`, *isteğe bağlı*, varsayılan 50) : Gürültü azaltma adım sayısı. Daha fazla gürültü azaltma adımı genellikle daha yavaş çıkarım pahasına daha yüksek kaliteli bir görüntüye yol açar.

timesteps (`list[int]`, *isteğe bağlı*) : `set_timesteps` metodunda `timesteps` argümanını destekleyen zamanlayıcılarla gürültü azaltma süreci için kullanılacak özel zaman adımları. Tanımlanmamışsa, `num_inference_steps` geçirildiğinde varsayılan davranış kullanılacaktır. Azalan sırada olmalıdır.

guidance_scale (`float`, varsayılan `3 `) : [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598)'de tanımlanan yönlendirme ölçeği. `guidance_scale`, [Imagen Paper](https://huggingface.co/papers/2205.11487)'deki 2. denklemindeki `w` olarak tanımlanır. Yönlendirme ölçeği, `guidance_scale > 1` olarak ayarlanarak etkinleştirilir. Daha yüksek yönlendirme ölçeği, genellikle daha düşük görüntü kalitesi pahasına, `prompt` ile yakından ilişkili görüntülerin üretilmesini teşvik eder.

guidance_rescale (`float`, *opsiyonel*, varsayılan 0.0) : [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) makalesinde önerilen guidance rescale faktörü. `guidance_scale`, [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) makalesindeki 16. denklemde `φ` olarak tanımlanmıştır. Guidance rescale faktörü, sıfır terminal SNR kullanıldığında aşırı pozlamayı düzeltmelidir.

image_cond_noise_scale (`float`, varsayılan `0.15`) : Koşullandırma görüntüsü latentlerine eklenen gürültünün ölçeği.

num_videos_per_prompt (`int`, *isteğe bağlı*, varsayılan 1) : Her istem için üretilecek video sayısı.

generator (`torch.Generator` veya `list[torch.Generator]`, *isteğe bağlı*) : Üretimi deterministik hale getirmek için bir veya [torch üreteci(leri)](https://pytorch.org/docs/stable/generated/torch.Generator.html) listesi.

latents (`torch.Tensor`, *isteğe bağlı*) : Görsel üretimi için girdi olarak kullanılacak, Gauss dağılımından örneklenen önceden oluşturulmuş gürültülü latentler. Farklı istemlerle aynı üretimi ayarlamak için kullanılabilir. Sağlanmazsa, sağlanan rastgele `generator` kullanılarak örneklem yoluyla bir latent tensörü oluşturulur.

prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından oluşturulur.

prompt_attention_mask (`torch.Tensor`, *isteğe bağlı*) : Metin gömme (embedding) için önceden oluşturulmuş dikkat maskesi (attention mask).

negative_prompt_embeds (`torch.FloatTensor`, *isteğe bağlı*) : Önceden oluşturulmuş negatif metin gömme değerleri. PixArt-Sigma için bu negatif istem "" olmalıdır. Sağlanmazsa, negative_prompt_embeds, `negative_prompt` girdi argümanından oluşturulur.

negative_prompt_attention_mask (`torch.FloatTensor`, *isteğe bağlı*) : Negatif metin gömme vektörleri için önceden oluşturulmuş dikkat maskesi.

decode_timestep (`float`, varsayılan `0.0`) : Üretilen videonun çözümlendiği zaman adımı.

decode_noise_scale (`float`, varsayılan `None`) : Çözme zaman adımında rastgele gürültü ile gürültüsü azaltılmış latentler arasındaki interpolasyon katsayısı.

output_type (`str`, *isteğe bağlı*, varsayılan `"pil"`) : Üretilen görüntünün çıktı biçimi. [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` veya `np.array` arasında seçim yapın.

return_dict (`bool`, *isteğe bağlı*, varsayılan `True`) : Düz bir tuple yerine `~pipelines.ltx.LTXPipelineOutput` döndürülecek mi?

attention_kwargs (`dict`, *isteğe bağlı*) : Belirtilirse, [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py) içinde `self.processor` altında tanımlanan `AttentionProcessor`'a iletilen bir kwargs sözlüğü.

callback_on_step_end (`Callable`, *isteğe bağlı*) : Çıkarım sırasında her gürültü azaltma adımının sonunda çağrılan bir işlev. İşlev aşağıdaki argümanlarla çağrılır: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. `callback_kwargs`, `callback_on_step_end_tensor_inputs` tarafından belirtilen tüm tensörlerin listesini içerir.

callback_on_step_end_tensor_inputs (`list`, *isteğe bağlı*) : `callback_on_step_end` işlevi için girdi tensörlerinin listesi. Listede belirtilen tensörler, `callback_kwargs` argümanı olarak geçirilir. Yalnızca pipeline sınıfınızın `._callback_tensor_inputs` özniteliğinde listelenen değişkenleri dahil edebilirsiniz.

max_sequence_length (`int` varsayılan olarak `128 `) : `prompt` ile kullanılacak maksimum dizi uzunluğu.

**Dönüş:** `~pipelines.ltx.LTXPipelineOutput` veya `tuple`

`return_dict` `True` ise `~pipelines.ltx.LTXPipelineOutput` döndürülür, aksi halde ilk öğesi üretilen görsellerin listesini içeren bir `tuple` döndürülür.

Üretim için pipeline çağrıldığında tetiklenen işlev.

Örnekler:
```py
>>> import torch
>>> from diffusers.pipelines.ltx.pipeline_ltx_condition import LTXConditionPipeline, LTXVideoCondition
>>> from diffusers.utils import export_to_video, load_video, load_image

>>> pipe = LTXConditionPipeline.from_pretrained("Lightricks/LTX-Video-0.9.5", torch_dtype=torch.bfloat16)
>>> pipe.to("cuda")

>>> # Load input image and video
>>> video = load_video(
...     "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cosmos/cosmos-video2world-input-vid.mp4"
... )
>>> image = load_image(
...     "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cosmos/cosmos-video2world-input.jpg"
... )

>>> # Create conditioning objects
>>> condition1 = LTXVideoCondition(
...     image=image,
...     frame_index=0,
... )
>>> condition2 = LTXVideoCondition(
...     video=video,
...     frame_index=80,
... )

>>> prompt = "The video depicts a long, straight highway stretching into the distance, flanked by metal guardrails. The road is divided into multiple lanes, with a few vehicles visible in the far distance. The surrounding landscape features dry, grassy fields on one side and rolling hills on the other. The sky is mostly clear with a few scattered clouds, suggesting a bright, sunny day. And then the camera switch to a winding mountain road covered in snow, with a single vehicle traveling along it. The road is flanked by steep, rocky cliffs and sparse vegetation. The landscape is characterized by rugged terrain and a river visible in the distance. The scene captures the solitude and beauty of a winter drive through a mountainous region."
>>> negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"

>>> # Generate video
>>> generator = torch.Generator("cuda").manual_seed(0)
>>> # Text-only conditioning is also supported without the need to pass `conditions`
>>> video = pipe(
...     conditions=[condition1, condition2],
...     prompt=prompt,
...     negative_prompt=negative_prompt,
...     width=768,
...     height=512,
...     num_frames=161,
...     num_inference_steps=40,
...     generator=generator,
... ).frames[0]

>>> export_to_video(video, "output.mp4", fps=24)
```

#### add_noise_to_image_conditioning_latents[[diffusers.LTXConditionPipeline.add_noise_to_image_conditioning_latents]]

```python
add_noise_to_image_conditioning_latents(t: float, init_latents: Tensor, latents: Tensor, noise_scale: float, conditioning_mask: Tensor, generator, eps = 1e-06)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py#L646)

Sert koşullama latentlerine zaman adımı bağımlısı gürültü ekleyin. Bu, özellikle tek bir kareye koşullandığında hareket sürekliliğine yardımcı olur.

#### encode_prompt[[diffusers.LTXConditionPipeline.encode_prompt]]

```python
encode_prompt(prompt: str | list[str], negative_prompt: str | list[str] | None = None, do_classifier_free_guidance: bool = True, num_videos_per_prompt: int = 1, prompt_embeds: typing.Optional[torch.Tensor] = None, negative_prompt_embeds: typing.Optional[torch.Tensor] = None, prompt_attention_mask: typing.Optional[torch.Tensor] = None, negative_prompt_attention_mask: typing.Optional[torch.Tensor] = None, max_sequence_length: int = 256, device: typing.Optional[torch.device] = None, dtype: typing.Optional[torch.dtype] = None)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py#L369)

**Parametreler:**

prompt (`str` veya `list[str]`, *isteğe bağlı*) : kodlanacak istem

negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmemek için kullanılan istem veya istemler. Tanımlanmazsa, bunun yerine `negative_prompt_embeds` parametresinin geçirilmesi gerekir. Yönlendirme kullanılmadığında (yani `guidance_scale` değeri `1`'den küçükse) yok sayılır.

do_classifier_free_guidance (`bool`, *isteğe bağlı*, varsayılan `True`) : Sınıflandırıcı serbest yönlendirmenin (classifier free guidance) kullanılıp kullanılmayacağı.

num_videos_per_prompt (`int`, *opsiyonel*, varsayılan 1) : Her istem için oluşturulması gereken video sayısı. Sonuç gömme vektörlerinin yerleştirileceği torch cihazı

prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından oluşturulur.

negative_prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş negatif metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, negative_prompt_embeds, `negative_prompt` girdi argümanından oluşturulur.

device : (`torch.device`, *isteğe bağlı*): torch cihazı

dtype : (`torch.dtype`, *isteğe bağlı*): torch dtype

İsteği metin kodlayıcı gizli durumlarına kodlar.

#### trim_conditioning_sequence[[diffusers.LTXConditionPipeline.trim_conditioning_sequence]]

```python
trim_conditioning_sequence(start_frame: int, sequence_num_frames: int, target_num_frames: int)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py#L629)

**Parametreler:**

start_frame (int) : Sıradaki ilk kare için hedef kare numarası.

sequence_num_frames (int) : Sıradaki kare sayısı.

target_num_frames (int) : Üretilen videodaki hedef kare sayısı.

**Dönüş:** `int`

güncellenmiş dizi uzunluğu

Koşullandırma dizisini izin verilen kare sayısına kırpın.

## LTXLatentUpsamplePipeline[[diffusers.LTXLatentUpsamplePipeline]]

#### diffusers.LTXLatentUpsamplePipeline[[diffusers.LTXLatentUpsamplePipeline]]

```python
diffusers.LTXLatentUpsamplePipeline(vae: AutoencoderKLLTXVideo, latent_upsampler: LTXLatentUpsamplerModel)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_latent_upsample.py#L44)

#### __call__[[diffusers.LTXLatentUpsamplePipeline.__call__]]

```python
__call__(video: list[typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor]]] | None = None, height: int = 512, width: int = 704, latents: typing.Optional[torch.Tensor] = None, decode_timestep: float | list[float] = 0.0, decode_noise_scale: float | list[float] | None = None, adain_factor: float = 0.0, tone_map_compression_ratio: float = 0.0, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, output_type: str | None = 'pil', return_dict: bool = True)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_latent_upsample.py#L188)

**Parametreler:**

video (`list[PipelineImageInput]`, *isteğe bağlı*) : Yukarı örneklemeye alınacak giriş video kareleri. `latents` ile karşılıklı olarak dışlayıcıdır.

height (`int`, varsayılan `512`) : Yukarı örneklenmiş çıktının piksel cinsinden yüksekliği.

width (`int`, varsayılan `704`) : Yukarı örneklenmiş çıktının piksel cinsinden genişliği.

latents (`torch.Tensor`, *isteğe bağlı*) : Upsample edilecek önceden kodlanmış video latentleri. `video` ile karşılıklı olarak dışlayıcıdır.

decode_timestep (`float` veya `list[float]`, varsayılan `0.0`) : Yukarı örneklenen latentlerin çözümlendiği zaman adımı.

decode_noise_scale (`float` veya `list[float]`, *isteğe bağlı*) : Çözme zaman adımında rastgele gürültü ile gürültüsü azaltılmış latentler arasındaki interpolasyon katsayısı.

adain_factor (`float`, varsayılan `0.0`) : Yukarı örneklenen latentlere uygulanan AdaIN istatistiksel eşleştirmenin gücü.

tone_map_compression_ratio (`float`, varsayılan `0.0`) : Örneklemesi artırılmış latentlerin ton eşlemesinde kullanılan sıkıştırma oranı. [0, 1] aralığında olmalıdır.

generator (`torch.Generator` veya `list[torch.Generator]`, *isteğe bağlı*) : Üretimi deterministik hale getirmek için bir [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html).

output_type (`str`, *isteğe bağlı*, varsayılan `"pil"`) : Üretilen videonun çıktı biçimi. `PIL.Image`, `np.array` veya `latent` arasında seçim yapın.

return_dict (`bool`, *isteğe bağlı*, varsayılan `True`) : Düz bir tuple yerine `~pipelines.ltx.LTXPipelineOutput` döndürülecek mi?

**Dönüş:** `~pipelines.ltx.LTXPipelineOutput` veya `tuple`

`return_dict` True ise `~pipelines.ltx.LTXPipelineOutput`, aksi halde bir `tuple`. Tuple döndürüldüğünde, ilk öğe örneklemesi artırılmış video (veya `output_type="latent"` ise latentler) olur.

Latent upsampling için pipeline çağrıldığında çağrılan işlev.

#### adain_filter_latent[[diffusers.LTXLatentUpsamplePipeline.adain_filter_latent]]

```python
adain_filter_latent(latents: Tensor, reference_latents: Tensor, factor: float = 1.0)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_latent_upsample.py#L94)

**Parametreler:**

latents (`torch.Tensor`) : Normalize edilecek girdi latentleri

reference_latents (`torch.Tensor`) : Stil istatistiklerini sağlayan referans latentler.

factor (`float`) : Orijinal ve dönüştürülmüş latent arasındaki karışım faktörü. Aralık: -10.0 ile 10.0, Varsayılan: 1.0

**Dönüş:** `torch.Tensor`

Dönüştürülmüş gizli tensör

Referans latent tensörden gelen istatistiklere dayanarak, bir latent tensöre Adaptif Örnek Normalizasyonu (AdaIN) uygular.

#### tone_map_latents[[diffusers.LTXLatentUpsamplePipeline.tone_map_latents]]

```python
tone_map_latents(latents: Tensor, compression: float)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_latent_upsample.py#L122)

**Parametreler:**

latents : torch.Tensor İsteğe bağlı şekle sahip girdi latent tensörü. Yaklaşık olarak [-1, 1] veya [0, 1] aralığında olması beklenir.

compression : float [0, 1] aralığında sıkıştırma gücü. - 0.0: Ton eşleme yok (kimlik dönüşümü) - 1.0: Tam sıkıştırma etkisi

**Dönüş:**

torch.Tensor Girdi ile aynı şekle sahip ton eşlemeli latent tensör.

Sigmoid tabanlı bir sıkıştırma kullanarak gizli değerlerin dinamik aralığını algısal olarak pürüzsüz bir şekilde azaltmak için doğrusal olmayan bir ton eşleme fonksiyonu uygular.

Bu, özellikle `compression` faktörü ile dinamik davranışı kontrol ederken, yüksek varyanslı latentleri düzenlemek veya üretim sırasında çıktıları koşullandırmak için kullanışlıdır.

## LTXPipelineOutput[[diffusers.pipelines.ltx.pipeline_output.LTXPipelineOutput]]

#### diffusers.pipelines.ltx.pipeline_output.LTXPipelineOutput[[diffusers.pipelines.ltx.pipeline_output.LTXPipelineOutput]]

```python
diffusers.pipelines.ltx.pipeline_output.LTXPipelineOutput(frames: Tensor)
```

[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_output.py#L9)

**Parametreler:**

frames (`torch.Tensor`, `np.ndarray` veya list[list[PIL.Image.Image]]) : video çıktıları listesi - `batch_size,` uzunluğunda iç içe geçmiş bir liste olabilir; her alt liste, `num_frames.` uzunluğunda gürültüsü azaltılmış PIL görüntü dizileri içerir. Ayrıca `(batch_size, num_frames, channels, height, width)` biçiminde bir NumPy dizi veya Torch tensörü de olabilir.

LTX pipeline'leri için çıktı sınıfı.

