#
# مرخّص بموجب ترخيص Apache الإصدار 2.0 (المسمى "الترخيص")
# لا يجوز لك استخدام هذا الملف إلا وفقاً لشروط الترخيص.
# يمكنك الحصول على نسخة من الترخيص في
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# ما لم يقتضِ ذلك القانون المعمول به أو ما اتُّفق عليه كتابياً، البرمجيات
# تُوزَّع بموجب الرخصة على أساس "كما هي"،
# بلا أي ضمانات أو شروط من أي نوع، سواء صريحة أو ضمنية.
# راجع الترخيص لمعرفة اللغة المحددة التي تحكم الصلاحيات و
# قيود بموجب الترخيص. -->

  
    
      
    
    
  

# LTX-Video

[LTX-Video](https://huggingface.co/Lightricks/LTX-Video) هو محوّل انتشار مصمم لتوليد فيديوهات عالية الدقة بسرعة وفي الوقت الفعلي من النصوص والصور. الميزة الرئيسية في LTX-Video هي Video-VAE. تتمتع Video-VAE بنسبة ضغط أعلى من البكسل إلى الكمون (1:192) مما يتيح معالجة بيانات الفيديو بكفاءة أكبر وسرعة توليد أسرع. لدعم التفاصيل الدقيقة ومنع فقدانها أثناء التوليد، يقوم فك تشفير Video-VAE بتحويل الكمون إلى بكسل *و* خطوة إزالة الضوضاء الأخيرة.

يمكنك العثور على جميع نقاط التفتيش الأصلية لنموذج LTX-Video تحت منظمة [Lightricks](https://huggingface.co/Lightricks).

> [!TIP]
> انقر على نماذج LTX-Video في الشريط الجانبي الأيمن لمزيد من الأمثلة على مهام توليد الفيديو الأخرى.

يُبيّن المثال أدناه كيفية توليد فيديو مُحسَّن للذاكرة أو لسرعة الاستدلال.

راجع دليل [تقليل استهلاك الذاكرة](../../optimization/memory) لمزيد من التفاصيل حول تقنيات توفير الذاكرة المختلفة.

يتطلب نموذج LTX-Video أدناه حوالي 10 جيجابايت من ذاكرة VRAM.

```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)
```

يكون [التجميع](../../optimization/fp16#torchcompile) بطيئًا في المرة الأولى، لكن الاستدعاءات اللاحقة للخط الأنابيب تكون أسرع. كما قد يسرّع [التخزين المؤقت](../../optimization/cache) الاستدلال من خلال تخزين المخرجات الوسيطة وإعادة استخدامها.

```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)
```

## ملاحظات

- راجع الإعدادات الموصى بها التالية للتوليد من مستودع [LTX-Video](https://github.com/Lightricks/LTX-Video).

  - النوع الموصى به لـ dtype في المحوّل (transformer) وVAE ومشفّر النص هو `torch.bfloat16`. كما يمكن أن يكون VAE ومشفّر النص من النوع `torch.float32` أو `torch.float16`.
  - لإصدارات LTX-Video المُصفاة بالتوجيه، اضبط `guidance_scale` على `1.0`. أما `guidance_scale` لأي نموذج آخر فيجب ضبطه على قيمة أعلى، مثل `5.0`، لضمان جودة توليد جيدة.
  - لأنواع VAE الواعية بخطوة الزمن (LTX-Video 0.9.1 وما بعده)، اضبط `decode_timestep` على `0.05` و`image_cond_noise_scale` على `0.025`.
  - بالنسبة للتحويرات التي تدعم الاستيفاء بين صور وفيديوهات شرطية متعددة (LTX-Video 0.9.5 وما بعده)، استخدم صوراً وفيديوهات مشابهة للحصول على أفضل النتائج. قد يؤدي الانحراف عن مدخلات الشرط إلى انتقالات مفاجئة في الفيديو المولّد.

- يتضمن LTX-Video 0.9.7 مُكبِّرًا كامنًا مكانيًا ومحوّلًا (Transformer) يحتوي على 13 مليار معامل. أثناء الاستدلال، يتم توليد فيديو بدقة منخفضة بسرعة أولاً، ثم يُكبَّر ويُحسَّن.

  
  عرض كود مثال

  ```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 المُقطّر مُقطّر من حيث التوجيه (guidance) والخطوات الزمنية (timestep) لتسريع عملية التوليد. يتطلب ضبط `guidance_scale` على `1.0`، ويجب ضبط `num_inference_steps` بين `4` و`10` للحصول على جودة توليد جيدة. كما ينبغي استخدام الخطوات الزمنية المخصصة التالية للحصول على أفضل النتائج.

  - استدلال النموذج الأساسي للتحضير للتصعيد: `[1000, 993, 987, 981, 975, 909, 725, 0.03]`.
  - التحجيم: `[1000, 909, 725, 421, 0]`.

  
  عرض كود مثال

  ```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 المُقطّر (distilled) النسخة 0.9.7. فهو مُقطّر من حيث التوجيه (guidance) وخطوة الزمن (timestep)، ويمكن استخدام كود استنتاج مشابه لما هو موضح أعلاه. تتمثل تحسينات هذه النسخة في دعمها لتوليد مقاطع فيديو طويلة جدًا. بالإضافة إلى ذلك، تدعم استخدام خرائط النغمة (tone mapping) لتحسين جودة الفيديو المولّد باستخدام معامل `tone_map_compression_ratio`. يُوصى بالقيمة الافتراضية `0.6`.

  
  عرض كود مثال

  ```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 نماذج LoRA من خلال [load_lora_weights()](/docs/diffusers/main/ar/api/loaders/lora#diffusers.loaders.LTXVideoLoraLoaderMixin.load_lora_weights).

  
  عرض كود مثال

  ```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 supports loading from single files, such as [GGUF checkpoints](../../quantization/gguf), with [loaders.FromOriginalModelMixin.from_single_file()](/docs/diffusers/main/ar/api/loaders/single_file#diffusers.loaders.FromOriginalModelMixin.from_single_file) or [loaders.FromSingleFileMixin.from_single_file()](/docs/diffusers/main/ar/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file).

  
  عرض كود مثال

  ```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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_i2v_long_multi_prompt.py#L389)

**المعاملات:**

transformer ([LTXVideoTransformer3DModel](/docs/diffusers/main/ar/api/models/ltx_video_transformer3d#diffusers.LTXVideoTransformer3DModel)) : بنية Transformer شرطية لإزالة الضوضاء من كامنات الفيديو المُرمّزة.

scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/ar/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler) أو `LTXEulerAncestralRFScheduler`) : مُجدوِل يُستخدم بالاقتران مع `transformer` لإزالة الضوضاء من كامنات الصورة المُرمَّزة.

vae ([AutoencoderKLLTXVideo](/docs/diffusers/main/ar/api/models/autoencoderkl_ltx_video#diffusers.AutoencoderKLLTXVideo)) : نموذج الترميز التحويلي التبايني (VAE) لتشفير الصور وفك تشفيرها إلى التمثيلات الكامنة ومنها.

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel)، وتحديداً النسخة [google/t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl).

tokenizer (`T5TokenizerFast`) : مُقسِّم من الفئة [T5TokenizerFast](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast).

خط أنابيب متعدد التوجيهات لتحويل الصور إلى فيديو (I2V) بمدة طويلة، مع توافق كامل مع ComfyUI.

الميزات الرئيسية:
- عينة النافذة المنزلقة الزمنية فقط (بدون تقسيم مكاني للأبعاد H/W)؛ والدمج التلقائي التتابعي عبر النوافذ.
- تجزئة متعددة الموجهات لكل نافذة مع انتقالات سلسة عند رؤوس النوافذ.
- شرط صارم للإطار الأول عبر قناع لكل رمز لتوليد الفيديو من صورة.
- التحكم في ذاكرة الفيديو (VRAM) عبر النافذة الزمنية وفك ترميز VAE على شكل بلاطات.

مرجع: 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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_i2v_long_multi_prompt.py#L935)

**المعاملات:**

prompt (`str` أو `list[str]`، *اختياري*) : نص الموجّه الإيجابي لكل نافذة. إذا احتوت سلسلة واحدة على '|', يتم تقسيم الأجزاء بواسطة علامات العمودية.

negative_prompt (`str` أو `list[str]`، *اختياري*) : موجه(ات) سلبية(ة) لكبح المحتوى غير المرغوب فيه.

prompt_segments (`list[dict]`، *اختياري*) : تعيين المقاطع باستخدام {"start_window", "end_window", "text"} لتجاوز الأوامر لكل نافذة.

height (`int`، القيمة الافتراضية `512`) : ارتفاع الصورة الناتجة بالبكسلات؛ يجب أن يكون قابلاً للقسمة على 32.

width (`int`، القيمة الافتراضية `704`) : عرض الصورة الناتجة بالبكسلات؛ يجب أن يكون قابلاً للقسمة على 32.

num_frames (`int`، القيمة الافتراضية `161`) : عدد الإطارات الناتجة (في فضاء البكسلات المفكوكة).

frame_rate (`float`، القيمة الافتراضية `25`) : عدد الإطارات في الثانية؛ يُستخدم لتطبيع الإحداثيات الزمنية في `video_coords`.

guidance_scale (`float`، القيمة الافتراضية `1.0`) : مقياس CFG؛ القيم > 1 تفعّل التوجيه الحر من التصنيف.

guidance_rescale (`float`، القيمة الافتراضية `0.0`) : إعادة تحجيم اختيارية للتخفيف من الإفراط في التعرض تحت CFG (انظر `rescale_noise_cfg`).

num_inference_steps (`int`، *اختياري*، القيمة الافتراضية `8`) : عدد خطوات إزالة الضوضاء لكل نافذة. يتم تجاهل هذا المعامل إذا تم توفير `sigmas`.

sigmas (`list[float]` أو `torch.Tensor`، *اختياري*) : جدول سيجما صريح لكل نافذة؛ إذا تم ضبطه، يتجاوز `num_inference_steps`.

generator (`torch.Generator` أو `list[torch.Generator]`، *اختياري*) : يتحكم في العشوائية؛ يُقبل استخدام قائمة لكن يُستخدم العنصر الأول فقط (batch=1).

seed (`int`, *اختياري*، القيمة الافتراضية `0`) : إذا تم تقديمه، يُهيّئ المولّد المشترك للقيم الكامنة العالمية ويشتق مولّدًا محليًا لكل نافذة باستخدام `seed + w_start` لكل نافذة زمنية.

cond_image (`PIL.Image.Image` أو `torch.Tensor`، *اختياري*) : صورة الشرط؛ تُثبّت الإطار 0 عبر قناع لكل رمز عندما يكون `cond_strength > 0`.

cond_strength (`float`، القيمة الافتراضية `0.5`) : قوة التكييف الصارم للإطار الأول (كلما كان cond_mask أصغر، كان الحفظ أقوى).

latents (`torch.Tensor`، *اختياري*) : الكمونيات الأولية [B, C_lat, F_lat, H_lat, W_lat]؛ إذا كانت None، يتم أخذها عينات باستخدام `randn_tensor`.

temporal_tile_size (`int`، القيمة الافتراضية `80`) : حجم النافذة الزمنية (بإطار فك الترميز)؛ يتم تحجيمه داخليًا بواسطة ضغط VAE الزمني.

temporal_overlap (`int`، القيمة الافتراضية `24`) : التداخل بين النوافذ المتتالية (بالإطارات المُفكَّكة)؛ يتم تحجيمه داخلياً بواسطة الضغط.

temporal_overlap_cond_strength (`float`، القيمة الافتراضية `0.5`) : قوة حقن كامنات ذيل النافذة السابقة في رأس النافذة الجديدة.

adain_factor (`float`، القيمة الافتراضية `0.25`) : قوة تطبيع AdaIN لتحقيق الاتساق بين النوافذ (0 لتعطيله).

guidance_latents (`torch.Tensor`، *اختياري*) : إحداثيات مرجعية تُحقن في رأس النافذة؛ يتم تقصير طولها بواسطة التداخل للنافذات اللاحقة.

guiding_strength (`float`، القيمة الافتراضية `1.0`) : قوة الحقن لـ `guidance_latents`.

negative_index_latents (`torch.Tensor`، *اختياري*) : كامن لإطار واحد يُضاف في بداية النافذة لدلالات "الفهرس السالب".

negative_index_strength (`float`، القيمة الافتراضية `1.0`) : قوة الحقن لـ `negative_index_latents`.

skip_steps_sigma_threshold (`float`، *اختياري*، القيمة الافتراضية `1`) : تخطي الخطوات التي يتجاوز فيها سيجما هذا الحد.

decode_timestep (`float`، *اختياري*، القيمة الافتراضية `0.05`) : خطوة الزمن أثناء فك الترميز (إذا كان VAE يدعم timestep_conditioning).

decode_noise_scale (`float`، *اختياري*، القيمة الافتراضية `0.025`) : مقياس مزيج الضوضاء أثناء فك الترميز (إذا كان VAE يدعم timestep_conditioning).

decode_horizontal_tiles (`int`، القيمة الافتراضية `4`) : عدد البلاطات الأفقية أثناء فك ترميز VAE.

decode_vertical_tiles (`int`، القيمة الافتراضية `4`) : عدد البلاطات الرأسية أثناء فك ترميز VAE.

decode_overlap (`int`، القيمة الافتراضية `3`) : التداخل (بالبكسلات الكامنة) بين البلاطات أثناء فك ترميز VAE.

output_type (`str`، *اختياري*، القيمة الافتراضية `"latent"`) : صيغة مخرجات الفيديو المولّد. اختر بين "latent" أو "pt" أو "np" أو "pil". إذا كانت "latent"، تُعاد الكمونيات دون فك الترميز.

return_dict (`bool`، *اختياري*، القيمة الافتراضية `True`) : ما إذا كان يجب إرجاع `~pipelines.ltx.LTXPipelineOutput` بدلاً من tuple عادي.

attention_kwargs (`dict`، *اختياري*) : معلمات انتباه إضافية تُمرَّر إلى المحوّل.

callback_on_step_end (`PipelineCallback` أو `MultiPipelineCallbacks`، *اختياري*) : خطاف استدعاء لكل خطوة.

callback_on_step_end_tensor_inputs (`list[str]`، القيمة الافتراضية هي `["latents"]`) : المفاتيح من locals() التي سيتم تمريرها إلى الدالة الاستدعائية.

max_sequence_length (`int`، القيمة الافتراضية هي `128`) : الحد الأقصى لطول المُرمِّز (Tokenizer) لتشفير الاستعلام.

**يعيد:** `~pipelines.ltx.LTXPipelineOutput` أو `tuple`

إذا كان `return_dict` هو `True`، يُعاد `~pipelines.ltx.LTXPipelineOutput`، وإلا يُعاد `tuple` حيث يكون العنصر الأول قائمة تحتوي على الإطارات المولّدة. يعتمد تنسيق المخرجات على `output_type`:
- "latent"/"pt": `torch.Tensor` [B, C, F, H, W]; "latent" في الفضاء الكامن المعيار، و"pt" في فضاء مخرجات VAE.
- "np": `np.ndarray` بعد المعالجة.
- "pil": `list[PIL.Image.Image]` قائمة من صور PIL.

توليد تسلسل صورة إلى فيديو عبر النوافذ الزمنية المنزلقة وجدولة متعددة الموجهات.

أمثلة:
```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]
```

الأشكال: أحجام الكمون (عند التوليد التلقائي):
- F_lat = (num_frames - 1) // vae_temporal_compression_ratio + 1
- H_lat = height // vae_spatial_compression_ratio
- W_lat = width // vae_spatial_compression_ratio

ملاحظات:
- التبذير: عند توفير `seed`، يستخدم كل نافذة زمنية مولّدًا محليًا مبذّرًا بـ `seed + w_start`، بينما يُبذَّر المولّد المشترك مرة واحدة للكائنات الكامنة العالمية إذا لم يُمرَّر مولّد؛ وإلا يُعاد استخدام المولّد المُمرَّر.
- CFG: تنبؤ موحّد للضوضاء `noise_pred = uncond + w * (text - uncond)` مع `guidance_rescale` اختياري.
- الذاكرة: يؤدي إزالة الضوضاء تنبؤات بإطار كامل (بدون تقطيع مكاني)؛ ويمكن تقطيع فك الترميز لتجنب نفاد الذاكرة.

#### 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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_i2v_long_multi_prompt.py#L552)

**المعاملات:**

prompt (`str` أو `list[str]`، *اختياري*) : النص الذي سيتم ترميزه

negative_prompt (`str` أو `list[str]`، *اختياري*) : الموجه أو الموجهات التي لا ينبغي توجيه توليد الصورة بها. إذا لم يُعرَّف، يجب تمرير `negative_prompt_embeds` بدلاً من ذلك. يتم تجاهله عند عدم استخدام التوجيه (أي يتم تجاهله إذا كان `guidance_scale` أقل من `1`).

do_classifier_free_guidance (`bool`، *اختياري*، الافتراضي `True`) : ما إذا كان سيتم استخدام classifier free guidance أم لا.

num_videos_per_prompt (`int`، *اختياري*، القيمة الافتراضية 1) : عدد مقاطع الفيديو التي يجب توليدها لكل موجه. جهاز torch الذي سيتم وضع التضمينات الناتجة عليه

prompt_embeds (`torch.Tensor`، *اختياري*) : تمثيلات نصية مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد تمثيلات النص من معامل الإدخال `prompt`.

negative_prompt_embeds (`torch.Tensor`, *اختياري*) : تمثيلات نصية سالبة مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد negative_prompt_embeds من معامل الإدخال `negative_prompt`.

device : (`torch.device`, *اختياري*): جهاز torch

dtype : (`torch.dtype`, *اختياري*): torch dtype

يقوم بتشفير الموجه إلى حالات مخفية لمشفّر النص.

#### 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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_i2v_long_multi_prompt.py#L694)

**يعيد:**

latents, negative_index_latents, latent_num_frames, latent_height, latent_width

جهّز الكمونيات الأساسية وأدر كمونيات تكييف الإطار الأول اختيارياً.

#### 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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_i2v_long_multi_prompt.py#L738)

**المعاملات:**

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

decode_timestep : خطوة فك الترميز الاختيارية (تكون فعّالة فقط إذا كان VAE يدعم timestep_conditioning)

decode_noise_scale : استيفاء ضوضاء فك الترميز الاختياري (فعال فقط إذا كان VAE يدعم timestep_conditioning)

horizontal_tiles, vertical_tiles : عدد البلاطات أفقيًا/رأسيًا (>= 1)

overlap : التداخل في الفضاء الكامن (بالبكسلات الكامنة، >= 0)

last_frame_fix : ما إذا كان سيتم تفعيل إصلاح "تكرار الإطار الأخير"

generator : مولّد عشوائي (يُستخدم لضوضاء decode_noise_scale)

output_type : "latent" | "pt" | "np" | "pil" - "latent": إرجاع الكمونيات دون تغيير (مفيد للمعالجة اللاحقة) - "pt": إرجاع الموتر في فضاء مخرج VAE - "np"/"pil": مخرجات بعد المعالجة عبر VideoProcessor.postprocess_video

auto_denormalize : إذا كانت القيمة True، يتم تطبيق إزالة تطبيع LTX على `latents` داخليًا (يُوصى بذلك)

compute_dtype : الدقة المستخدمة أثناء دمج البلاطات (الافتراضي float32؛ يقلل بشكل كبير من ضبابية الفواصل)

enable_vae_tiling : إذا كانت القيمة True، فتمنح تفويض التقطيع إلى `tiled_decode` المدمج في VAE (يُعيّن `vae.use_tiling`).

**يعيد:** `- If output_type="latent"`

يعيد `latents` المدخلات دون تغيير
- إذا كان output_type="pt": يُرجع [B, C, F, H, W] (قيم تقريبية ضمن [-1, 1])
- إذا كان output_type="np"/"pil": تُرجع المخرجات بعد المعالجة عبر postprocess_video

فك الترميز المكاني المُقسّم إلى بلاطات (تطابق مع ComfyUI) القائم على VAE، والمُنفَّذ بأسلوب Diffusers.
- اعتماد التدرّج الخطي والمزج بين البلاطات المتراكبة لتجنّب ظهور الفواصل.
- اختياري last_frame_fix: انسخ الإطار الكامن الأخير قبل فك الترميز، ثم احذف time_scale_factor إطارات في النهاية.
- يدعم حقن timestep_conditioning و decode_noise_scale.
- بشكل افتراضي، يتم إلغاء تطبيع "القيم الكامنة المُطبَّعة" (مخرجات إزالة الضوضاء) داخليًا (auto_denormalize=True).
- يتم حساب دمج البلاطات في compute_dtype (الافتراضي هو float32) لتقليل الضبابية وانزياحات الألوان.

## LTXPipeline[[diffusers.LTXPipeline]]

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

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

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx.py#L170)

**المعاملات:**

transformer ([LTXVideoTransformer3DModel](/docs/diffusers/main/ar/api/models/ltx_video_transformer3d#diffusers.LTXVideoTransformer3DModel)) : بنية Transformer شرطية لإزالة الضوضاء من كامنات الفيديو المُرمّزة.

scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/ar/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler)) : مُجدوِل يُستخدم بالاقتران مع `transformer` لإزالة الضوضاء من كامنات الصورة المُرمَّزة.

vae ([AutoencoderKLLTXVideo](/docs/diffusers/main/ar/api/models/autoencoderkl_ltx_video#diffusers.AutoencoderKLLTXVideo)) : نموذج الترميز التحويلي التبايني (VAE) لتشفير الصور وفك تشفيرها إلى التمثيلات الكامنة ومنها.

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel)، وتحديداً النسخة [google/t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl).

tokenizer (`CLIPTokenizer`) : مُقسِّم من الفئة [CLIPTokenizer](https://huggingface.co/docs/transformers/en/model_doc/clip#transformers.CLIPTokenizer).

tokenizer (`T5TokenizerFast`) : مُرمِّز ثانٍ من الفئة [T5TokenizerFast](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast).

خط أنابيب لتوليد الفيديو من النص.

مرجع: 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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx.py#L535)

**المعاملات:**

prompt (`str` أو `list[str]`، *اختياري*) : الأمر أو الأوامر التي تُوجّه توليد الصورة. إذا لم يُعرَّف، يجب تمرير `prompt_embeds` بدلاً من ذلك.

negative_prompt (`str` أو `list[str]`، *اختياري*) : الأمر أو الأوامر التي لا ينبغي أن توجه توليد الصورة. إذا لم يُعرَّف، يجب تمرير `negative_prompt_embeds` بدلاً من ذلك. يتم تجاهله عند عدم استخدام التوجيه (`guidance_scale < 1`).

height (`int`، القيمة الافتراضية هي `512`) : ارتفاع الصورة المولّدة بالبكسل. يتم ضبطه على 480 افتراضيًا للحصول على أفضل النتائج.

width (`int`، القيمة الافتراضية هي `704`) : عرض الصورة المولدة بالبكسلات. يتم ضبط هذا على 848 افتراضيًا للحصول على أفضل النتائج.

num_frames (`int`، القيمة الافتراضية `161`) : عدد إطارات الفيديو التي سيتم توليدها

frame_rate (`int`، القيمة الافتراضية `25`) : معدل الإطارات المستهدف للفيديو المولّد.

num_inference_steps (`int`، *اختياري*، القيمة الافتراضية 50) : عدد خطوات إزالة الضوضاء. تؤدي زيادة عدد خطوات إزالة الضوضاء عادةً إلى صورة ذات جودة أعلى على حساب بطء الاستدلال.

timesteps (`list[int]`، *اختياري*) : خطوات زمنية مخصصة لاستخدامها في عملية إزالة الضوضاء مع المجدولين الذين يدعمون معامل `timesteps` في طريقة `set_timesteps` الخاصة بهم. إذا لم يُعرَّف، فسيتم استخدام السلوك الافتراضي عند تمرير `num_inference_steps`. يجب أن تكون بترتيب تنازلي.

guidance_scale (`float`، القيمة الافتراضية `3 `) : مقياس التوجيه كما هو مُعرَّف في [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598). يُعرَّف `guidance_scale` على أنه `w` من المعادلة 2. في [Imagen Paper](https://huggingface.co/papers/2205.11487). يتم تفعيل مقياس التوجيه عن طريق تعيين `guidance_scale > 1`. يشجع مقياس التوجيه الأعلى على توليد صور مرتبطة ارتباطًا وثيقًا بنص `prompt`، وعادةً على حساب انخفاض جودة الصورة.

guidance_rescale (`float`, *optional*, defaults to 0.0) : Guidance rescale factor proposed by [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) `guidance_scale` is defined as `φ` in equation 16. of [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891). Guidance rescale factor should fix overexposure when using zero terminal SNR.

num_videos_per_prompt (`int`، *اختياري*، القيمة الافتراضية 1) : عدد مقاطع الفيديو التي سيتم توليدها لكل موجه.

generator (`torch.Generator` أو `list[torch.Generator]`، *اختياري*) : مولّد واحد أو قائمة من [مولّدات torch](https://pytorch.org/docs/stable/generated/torch.Generator.html) لجعل التوليد حتميًا.

latents (`torch.Tensor`، *اختياري*) : كامنات ضجيج مُولّدة مسبقًا، مُستخرجة من توزيع غاوسي، تُستخدم كمدخلات لتوليد الصور. يمكن استخدامها لتعديل نفس التوليد باستخدام أوامر مختلفة. إذا لم تُقدَّم، سيتم توليد كامنات من خلال الاستخراج باستخدام `generator` العشوائي المُقدَّم.

prompt_embeds (`torch.Tensor`، *اختياري*) : تمثيلات نصية مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد تمثيلات النص من معامل الإدخال `prompt`.

prompt_attention_mask (`torch.Tensor`، *اختياري*) : قناع انتباه مُولّد مسبقًا لتضمينات النص.

negative_prompt_embeds (`torch.FloatTensor`، *اختياري*) : تمثيلات نصية سالبة مُولّدة مسبقًا. بالنسبة إلى PixArt-Sigma، يجب أن يكون هذا الأمر السلبي "". إذا لم يُقدَّم، فسيتم توليد negative_prompt_embeds من معامل الإدخال `negative_prompt`.

negative_prompt_attention_mask (`torch.FloatTensor`، *اختياري*) : قناع انتباه مُولّد مسبقًا لتضمينات النصوص السلبية.

decode_timestep (`float`، القيمة الافتراضية `0.0`) : خطوة الزمن التي يتم عندها فك ترميز الفيديو المولّد.

decode_noise_scale (`float`، القيمة الافتراضية `None`) : معامل الاستيفاء بين الضوضاء العشوائية واللاتنتات المُزالة الضوضاء عند خطوة فك الترميز.

output_type (`str`، *اختياري*، القيمة الافتراضية `"pil"`) : صيغة الصورة الناتجة عن عملية التوليد. اختر بين [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` أو `np.array`.

return_dict (`bool`، *اختياري*، القيمة الافتراضية `True`) : ما إذا كان يجب إرجاع `~pipelines.ltx.LTXPipelineOutput` بدلاً من tuple عادي.

attention_kwargs (`dict`، *اختياري*) : قاموس kwargs يُمرَّر إلى `AttentionProcessor` إذا تم تحديده، كما هو معرَّف تحت `self.processor` في [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).

callback_on_step_end (`Callable`، *اختياري*) : دالة تُستدعى في نهاية كل خطوة إزالة ضوضاء أثناء الاستدلال. تُستدعى الدالة بالحجج التالية: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. سيتضمن `callback_kwargs` قائمة بجميع المصفوفات كما حددتها `callback_on_step_end_tensor_inputs`.

callback_on_step_end_tensor_inputs (`list`، *اختياري*) : قائمة مدخلات المصفوفات (tensors) لدالة `callback_on_step_end`. سيتم تمرير المصفوفات المحددة في القائمة كحجة `callback_kwargs`. لن تتمكن من تضمين سوى المتغيرات المدرجة في خاصية `._callback_tensor_inputs` لفئة خط الأنابيب (pipeline) الخاص بك.

max_sequence_length (`int` الافتراضي هو `128 `) : أقصى طول تسلسل يُستخدم مع `prompt`.

**يعيد:** `~pipelines.ltx.LTXPipelineOutput` أو `tuple`

إذا كان `return_dict` هو `True`، يُعاد `~pipelines.ltx.LTXPipelineOutput`، وإلا يُعاد `tuple` يكون عنصره الأول قائمة تحتوي على الصور المولّدة.

الدالة التي تُستدعى عند استدعاء خط الأنابيب للتوليد.

أمثلة:
```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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx.py#L283)

**المعاملات:**

prompt (`str` أو `list[str]`، *اختياري*) : النص الذي سيتم ترميزه

negative_prompt (`str` أو `list[str]`، *اختياري*) : الموجه أو الموجهات التي لا ينبغي توجيه توليد الصورة بها. إذا لم يُعرَّف، يجب تمرير `negative_prompt_embeds` بدلاً من ذلك. يتم تجاهله عند عدم استخدام التوجيه (أي يتم تجاهله إذا كان `guidance_scale` أقل من `1`).

do_classifier_free_guidance (`bool`، *اختياري*، الافتراضي `True`) : ما إذا كان سيتم استخدام classifier free guidance أم لا.

num_videos_per_prompt (`int`، *اختياري*، القيمة الافتراضية 1) : عدد مقاطع الفيديو التي يجب توليدها لكل موجه. جهاز torch الذي سيتم وضع التضمينات الناتجة عليه

prompt_embeds (`torch.Tensor`، *اختياري*) : تمثيلات نصية مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد تمثيلات النص من معامل الإدخال `prompt`.

negative_prompt_embeds (`torch.Tensor`, *اختياري*) : تمثيلات نصية سالبة مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد negative_prompt_embeds من معامل الإدخال `negative_prompt`.

device : (`torch.device`, *اختياري*): جهاز torch

dtype : (`torch.dtype`, *اختياري*): torch dtype

يقوم بتشفير الموجه إلى حالات مخفية لمشفّر النص.

## LTXImageToVideoPipeline[[diffusers.LTXImageToVideoPipeline]]

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

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

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py#L189)

**المعاملات:**

transformer ([LTXVideoTransformer3DModel](/docs/diffusers/main/ar/api/models/ltx_video_transformer3d#diffusers.LTXVideoTransformer3DModel)) : بنية Transformer شرطية لإزالة الضوضاء من كامنات الفيديو المُرمّزة.

scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/ar/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler)) : مُجدوِل يُستخدم بالاقتران مع `transformer` لإزالة الضوضاء من كامنات الصورة المُرمَّزة.

vae ([AutoencoderKLLTXVideo](/docs/diffusers/main/ar/api/models/autoencoderkl_ltx_video#diffusers.AutoencoderKLLTXVideo)) : نموذج الترميز التحويلي التبايني (VAE) لتشفير الصور وفك تشفيرها إلى التمثيلات الكامنة ومنها.

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel)، وتحديداً النسخة [google/t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl).

tokenizer (`CLIPTokenizer`) : مُقسِّم من الفئة [CLIPTokenizer](https://huggingface.co/docs/transformers/en/model_doc/clip#transformers.CLIPTokenizer).

tokenizer (`T5TokenizerFast`) : مُرمِّز ثانٍ من الفئة [T5TokenizerFast](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast).

خط أنابيب لتوليد الفيديو من الصور.

مرجع: 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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py#L596)

**المعاملات:**

image (`PipelineImageInput`) : الصورة المدخلة التي تُشترط عليها عملية التوليد. يجب أن تكون صورة، أو قائمة من الصور، أو `torch.Tensor`.

prompt (`str` أو `list[str]`، *اختياري*) : الأمر أو الأوامر التي تُوجّه توليد الصورة. إذا لم يُعرَّف، يجب تمرير `prompt_embeds` بدلاً من ذلك.

negative_prompt (`str` أو `list[str]`، *اختياري*) : الأمر أو الأوامر التي لا ينبغي أن توجه توليد الصورة. إذا لم يُعرَّف، يجب تمرير `negative_prompt_embeds` بدلاً من ذلك. يتم تجاهله عند عدم استخدام التوجيه (`guidance_scale < 1`).

height (`int`، القيمة الافتراضية هي `512`) : ارتفاع الصورة المولّدة بالبكسل. يتم ضبطه على 480 افتراضيًا للحصول على أفضل النتائج.

width (`int`، القيمة الافتراضية هي `704`) : عرض الصورة المولدة بالبكسلات. يتم ضبط هذا على 848 افتراضيًا للحصول على أفضل النتائج.

num_frames (`int`، القيمة الافتراضية `161`) : عدد إطارات الفيديو التي سيتم توليدها

frame_rate (`int`، القيمة الافتراضية `25`) : معدل الإطارات المستهدف للفيديو المولّد.

num_inference_steps (`int`، *اختياري*، القيمة الافتراضية 50) : عدد خطوات إزالة الضوضاء. تؤدي زيادة عدد خطوات إزالة الضوضاء عادةً إلى صورة ذات جودة أعلى على حساب بطء الاستدلال.

timesteps (`list[int]`، *اختياري*) : خطوات زمنية مخصصة لاستخدامها في عملية إزالة الضوضاء مع المجدولين الذين يدعمون معامل `timesteps` في طريقة `set_timesteps` الخاصة بهم. إذا لم يُعرَّف، فسيتم استخدام السلوك الافتراضي عند تمرير `num_inference_steps`. يجب أن تكون بترتيب تنازلي.

guidance_scale (`float`، القيمة الافتراضية `3 `) : مقياس التوجيه كما هو مُعرَّف في [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598). يُعرَّف `guidance_scale` على أنه `w` من المعادلة 2. في [Imagen Paper](https://huggingface.co/papers/2205.11487). يتم تفعيل مقياس التوجيه عن طريق تعيين `guidance_scale > 1`. يشجع مقياس التوجيه الأعلى على توليد صور مرتبطة ارتباطًا وثيقًا بنص `prompt`، وعادةً على حساب انخفاض جودة الصورة.

guidance_rescale (`float`, *optional*, defaults to 0.0) : Guidance rescale factor proposed by [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) `guidance_scale` is defined as `φ` in equation 16. of [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891). Guidance rescale factor should fix overexposure when using zero terminal SNR.

num_videos_per_prompt (`int`، *اختياري*، القيمة الافتراضية 1) : عدد مقاطع الفيديو التي سيتم توليدها لكل موجه.

generator (`torch.Generator` أو `list[torch.Generator]`، *اختياري*) : مولّد واحد أو قائمة من [مولّدات torch](https://pytorch.org/docs/stable/generated/torch.Generator.html) لجعل التوليد حتميًا.

latents (`torch.Tensor`، *اختياري*) : كامنات ضجيج مُولّدة مسبقًا، مُستخرجة من توزيع غاوسي، تُستخدم كمدخلات لتوليد الصور. يمكن استخدامها لتعديل نفس التوليد باستخدام أوامر مختلفة. إذا لم تُقدَّم، سيتم توليد كامنات من خلال الاستخراج باستخدام `generator` العشوائي المُقدَّم.

prompt_embeds (`torch.Tensor`، *اختياري*) : تمثيلات نصية مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد تمثيلات النص من معامل الإدخال `prompt`.

prompt_attention_mask (`torch.Tensor`، *اختياري*) : قناع انتباه مُولّد مسبقًا لتضمينات النص.

negative_prompt_embeds (`torch.FloatTensor`، *اختياري*) : تمثيلات نصية سالبة مُولّدة مسبقًا. بالنسبة إلى PixArt-Sigma، يجب أن يكون هذا الأمر السلبي "". إذا لم يُقدَّم، فسيتم توليد negative_prompt_embeds من معامل الإدخال `negative_prompt`.

negative_prompt_attention_mask (`torch.FloatTensor`، *اختياري*) : قناع انتباه مُولّد مسبقًا لتضمينات النصوص السلبية.

decode_timestep (`float`، القيمة الافتراضية `0.0`) : خطوة الزمن التي يتم عندها فك ترميز الفيديو المولّد.

decode_noise_scale (`float`، القيمة الافتراضية `None`) : معامل الاستيفاء بين الضوضاء العشوائية واللاتنتات المُزالة الضوضاء عند خطوة فك الترميز.

output_type (`str`، *اختياري*، القيمة الافتراضية `"pil"`) : صيغة الصورة الناتجة عن عملية التوليد. اختر بين [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` أو `np.array`.

return_dict (`bool`، *اختياري*، القيمة الافتراضية `True`) : ما إذا كان يجب إرجاع `~pipelines.ltx.LTXPipelineOutput` بدلاً من tuple عادي.

attention_kwargs (`dict`، *اختياري*) : قاموس kwargs يُمرَّر إلى `AttentionProcessor` إذا تم تحديده، كما هو معرَّف تحت `self.processor` في [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).

callback_on_step_end (`Callable`، *اختياري*) : دالة تُستدعى في نهاية كل خطوة إزالة ضوضاء أثناء الاستدلال. تُستدعى الدالة بالحجج التالية: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. سيتضمن `callback_kwargs` قائمة بجميع المصفوفات كما حددتها `callback_on_step_end_tensor_inputs`.

callback_on_step_end_tensor_inputs (`list`، *اختياري*) : قائمة مدخلات المصفوفات (tensors) لدالة `callback_on_step_end`. سيتم تمرير المصفوفات المحددة في القائمة كحجة `callback_kwargs`. لن تتمكن من تضمين سوى المتغيرات المدرجة في خاصية `._callback_tensor_inputs` لفئة خط الأنابيب (pipeline) الخاص بك.

max_sequence_length (`int` الافتراضي هو `128 `) : أقصى طول تسلسل يُستخدم مع `prompt`.

**يعيد:** `~pipelines.ltx.LTXPipelineOutput` أو `tuple`

إذا كان `return_dict` هو `True`، يُعاد `~pipelines.ltx.LTXPipelineOutput`، وإلا يُعاد `tuple` يكون عنصره الأول قائمة تحتوي على الصور المولّدة.

الدالة التي تُستدعى عند استدعاء خط الأنابيب للتوليد.

أمثلة:
```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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py#L306)

**المعاملات:**

prompt (`str` أو `list[str]`، *اختياري*) : النص الذي سيتم ترميزه

negative_prompt (`str` أو `list[str]`، *اختياري*) : الموجه أو الموجهات التي لا ينبغي توجيه توليد الصورة بها. إذا لم يُعرَّف، يجب تمرير `negative_prompt_embeds` بدلاً من ذلك. يتم تجاهله عند عدم استخدام التوجيه (أي يتم تجاهله إذا كان `guidance_scale` أقل من `1`).

do_classifier_free_guidance (`bool`، *اختياري*، الافتراضي `True`) : ما إذا كان سيتم استخدام classifier free guidance أم لا.

num_videos_per_prompt (`int`، *اختياري*، القيمة الافتراضية 1) : عدد مقاطع الفيديو التي يجب توليدها لكل موجه. جهاز torch الذي سيتم وضع التضمينات الناتجة عليه

prompt_embeds (`torch.Tensor`، *اختياري*) : تمثيلات نصية مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد تمثيلات النص من معامل الإدخال `prompt`.

negative_prompt_embeds (`torch.Tensor`, *اختياري*) : تمثيلات نصية سالبة مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد negative_prompt_embeds من معامل الإدخال `negative_prompt`.

device : (`torch.device`, *اختياري*): جهاز torch

dtype : (`torch.dtype`, *اختياري*): torch dtype

يقوم بتشفير الموجه إلى حالات مخفية لمشفّر النص.

## LTXConditionPipeline[[diffusers.LTXConditionPipeline]]

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

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

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py#L252)

**المعاملات:**

transformer ([LTXVideoTransformer3DModel](/docs/diffusers/main/ar/api/models/ltx_video_transformer3d#diffusers.LTXVideoTransformer3DModel)) : بنية Transformer شرطية لإزالة الضوضاء من كامنات الفيديو المُرمّزة.

scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/ar/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler)) : مُجدوِل يُستخدم بالاقتران مع `transformer` لإزالة الضوضاء من كامنات الصورة المُرمَّزة.

vae ([AutoencoderKLLTXVideo](/docs/diffusers/main/ar/api/models/autoencoderkl_ltx_video#diffusers.AutoencoderKLLTXVideo)) : نموذج الترميز التحويلي التبايني (VAE) لتشفير الصور وفك تشفيرها إلى التمثيلات الكامنة ومنها.

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel)، وتحديداً النسخة [google/t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl).

tokenizer (`CLIPTokenizer`) : مُقسِّم من الفئة [CLIPTokenizer](https://huggingface.co/docs/transformers/en/model_doc/clip#transformers.CLIPTokenizer).

tokenizer (`T5TokenizerFast`) : مُرمِّز ثانٍ من الفئة [T5TokenizerFast](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast).

خط أنابيب لتوليد فيديو من نص/صورة/فيديو.

مرجع: 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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py#L848)

**المعاملات:**

conditions (`list[LTXVideoCondition], *optional*`) : قائمة عناصر تكييف الإطارات لتوليد الفيديو. إذا لم تُقدَّم، فسيتم إنشاء الشروط باستخدام `image` و`video` و`frame_index` و`strength`.

image (`PipelineImageInput` أو `list[PipelineImageInput]`، *اختياري*) : الصورة أو الصور التي تُشترط عليها توليد الفيديو. إذا لم تُقدَّم، يجب تمرير `video` أو `conditions`.

video (`list[PipelineImageInput]`، *اختياري*) : الفيديو الذي يُشترط على أساسه توليد الفيديو. إذا لم يُقدَّم، يجب تمرير `image` أو `conditions`.

frame_index (`int` أو `list[int]`، *اختياري*) : فهرس الإطار أو فهارس الإطارات التي سيؤثر فيها الصورة أو الفيديو بشكل شرطي على توليد الفيديو. إذا لم يُقدَّم، يجب تمرير `conditions`.

strength (`float` أو `list[float]`، *اختياري*) : قوة تأثير الشرط أو قواه. إذا لم يُقدَّم، يجب تمرير `conditions`.

denoise_strength (`float`، القيمة الافتراضية `1.0`) : قوة الضوضاء المضافة إلى الكمونيات (latents) للتحرير. كلما زادت القوة، زادت كمية الضوضاء المضافة إلى الكمونيات، مما يؤدي إلى زيادة الفروق بين الفيديو الأصلي والفيديو المولّد. وهذا مفيد لتحرير الفيديو إلى فيديو.

prompt (`str` أو `list[str]`، *اختياري*) : الأمر أو الأوامر التي تُوجّه توليد الصورة. إذا لم يُعرَّف، يجب تمرير `prompt_embeds` بدلاً من ذلك.

negative_prompt (`str` أو `list[str]`، *اختياري*) : الأمر أو الأوامر التي لا ينبغي أن توجه توليد الصورة. إذا لم يُعرَّف، يجب تمرير `negative_prompt_embeds` بدلاً من ذلك. يتم تجاهله عند عدم استخدام التوجيه (`guidance_scale < 1`).

height (`int`، القيمة الافتراضية هي `512`) : ارتفاع الصورة المولّدة بالبكسل. يتم ضبطه على 480 افتراضيًا للحصول على أفضل النتائج.

width (`int`، القيمة الافتراضية هي `704`) : عرض الصورة المولدة بالبكسلات. يتم ضبط هذا على 848 افتراضيًا للحصول على أفضل النتائج.

num_frames (`int`، القيمة الافتراضية `161`) : عدد إطارات الفيديو التي سيتم توليدها

frame_rate (`int`، القيمة الافتراضية `25`) : معدل الإطارات المستهدف للفيديو المولّد.

num_inference_steps (`int`، *اختياري*، القيمة الافتراضية 50) : عدد خطوات إزالة الضوضاء. تؤدي زيادة عدد خطوات إزالة الضوضاء عادةً إلى صورة ذات جودة أعلى على حساب بطء الاستدلال.

timesteps (`list[int]`، *اختياري*) : خطوات زمنية مخصصة لاستخدامها في عملية إزالة الضوضاء مع المجدولين الذين يدعمون معامل `timesteps` في طريقة `set_timesteps` الخاصة بهم. إذا لم يُعرَّف، فسيتم استخدام السلوك الافتراضي عند تمرير `num_inference_steps`. يجب أن تكون بترتيب تنازلي.

guidance_scale (`float`، القيمة الافتراضية `3 `) : مقياس التوجيه كما هو مُعرَّف في [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598). يُعرَّف `guidance_scale` على أنه `w` من المعادلة 2. في [Imagen Paper](https://huggingface.co/papers/2205.11487). يتم تفعيل مقياس التوجيه عن طريق تعيين `guidance_scale > 1`. يشجع مقياس التوجيه الأعلى على توليد صور مرتبطة ارتباطًا وثيقًا بنص `prompt`، وعادةً على حساب انخفاض جودة الصورة.

guidance_rescale (`float`, *optional*, defaults to 0.0) : Guidance rescale factor proposed by [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) `guidance_scale` is defined as `φ` in equation 16. of [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891). Guidance rescale factor should fix overexposure when using zero terminal SNR.

image_cond_noise_scale (`float`، القيمة الافتراضية `0.15`) : مقياس الضوضاء المضافة إلى كامنات صورة الشروط.

num_videos_per_prompt (`int`، *اختياري*، القيمة الافتراضية 1) : عدد مقاطع الفيديو التي سيتم توليدها لكل موجه.

generator (`torch.Generator` أو `list[torch.Generator]`، *اختياري*) : مولّد واحد أو قائمة من [مولّدات torch](https://pytorch.org/docs/stable/generated/torch.Generator.html) لجعل التوليد حتميًا.

latents (`torch.Tensor`، *اختياري*) : كامنات ضجيج مُولّدة مسبقًا، مُستخرجة من توزيع غاوسي، تُستخدم كمدخلات لتوليد الصور. يمكن استخدامها لتعديل نفس التوليد باستخدام أوامر مختلفة. إذا لم تُقدَّم، سيتم توليد كامنات من خلال الاستخراج باستخدام `generator` العشوائي المُقدَّم.

prompt_embeds (`torch.Tensor`، *اختياري*) : تمثيلات نصية مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد تمثيلات النص من معامل الإدخال `prompt`.

prompt_attention_mask (`torch.Tensor`، *اختياري*) : قناع انتباه مُولّد مسبقًا لتضمينات النص.

negative_prompt_embeds (`torch.FloatTensor`، *اختياري*) : تمثيلات نصية سالبة مُولّدة مسبقًا. بالنسبة إلى PixArt-Sigma، يجب أن يكون هذا الأمر السلبي "". إذا لم يُقدَّم، فسيتم توليد negative_prompt_embeds من معامل الإدخال `negative_prompt`.

negative_prompt_attention_mask (`torch.FloatTensor`، *اختياري*) : قناع انتباه مُولّد مسبقًا لتضمينات النصوص السلبية.

decode_timestep (`float`، القيمة الافتراضية `0.0`) : خطوة الزمن التي يتم عندها فك ترميز الفيديو المولّد.

decode_noise_scale (`float`، القيمة الافتراضية `None`) : معامل الاستيفاء بين الضوضاء العشوائية واللاتنتات المُزالة الضوضاء عند خطوة فك الترميز.

output_type (`str`، *اختياري*، القيمة الافتراضية `"pil"`) : صيغة الصورة الناتجة عن عملية التوليد. اختر بين [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` أو `np.array`.

return_dict (`bool`، *اختياري*، القيمة الافتراضية `True`) : ما إذا كان يجب إرجاع `~pipelines.ltx.LTXPipelineOutput` بدلاً من tuple عادي.

attention_kwargs (`dict`، *اختياري*) : قاموس kwargs يُمرَّر إلى `AttentionProcessor` إذا تم تحديده، كما هو معرَّف تحت `self.processor` في [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).

callback_on_step_end (`Callable`، *اختياري*) : دالة تُستدعى في نهاية كل خطوة إزالة ضوضاء أثناء الاستدلال. تُستدعى الدالة بالحجج التالية: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. سيتضمن `callback_kwargs` قائمة بجميع المصفوفات كما حددتها `callback_on_step_end_tensor_inputs`.

callback_on_step_end_tensor_inputs (`list`، *اختياري*) : قائمة مدخلات المصفوفات (tensors) لدالة `callback_on_step_end`. سيتم تمرير المصفوفات المحددة في القائمة كحجة `callback_kwargs`. لن تتمكن من تضمين سوى المتغيرات المدرجة في خاصية `._callback_tensor_inputs` لفئة خط الأنابيب (pipeline) الخاص بك.

max_sequence_length (`int` الافتراضي هو `128 `) : أقصى طول تسلسل يُستخدم مع `prompt`.

**يعيد:** `~pipelines.ltx.LTXPipelineOutput` أو `tuple`

إذا كان `return_dict` هو `True`، يُعاد `~pipelines.ltx.LTXPipelineOutput`، وإلا يُعاد `tuple` يكون عنصره الأول قائمة تحتوي على الصور المولّدة.

الدالة التي تُستدعى عند استدعاء خط الأنابيب للتوليد.

أمثلة:
```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)
```

#### إضافة ضوضاء إلى الكامنات الخاصة بشرط الصورة[[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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py#L646)

أضف ضوضاء تعتمد على خطوة الزمن إلى الكمونيات الشرطية الصلبة. يساعد ذلك في استمرارية الحركة، خاصة عند الاشتراط على إطار واحد.

#### 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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py#L369)

**المعاملات:**

prompt (`str` أو `list[str]`، *اختياري*) : النص الذي سيتم ترميزه

negative_prompt (`str` أو `list[str]`، *اختياري*) : الموجه أو الموجهات التي لا ينبغي توجيه توليد الصورة بها. إذا لم يُعرَّف، يجب تمرير `negative_prompt_embeds` بدلاً من ذلك. يتم تجاهله عند عدم استخدام التوجيه (أي يتم تجاهله إذا كان `guidance_scale` أقل من `1`).

do_classifier_free_guidance (`bool`، *اختياري*، الافتراضي `True`) : ما إذا كان سيتم استخدام classifier free guidance أم لا.

num_videos_per_prompt (`int`، *اختياري*، القيمة الافتراضية 1) : عدد مقاطع الفيديو التي يجب توليدها لكل موجه. جهاز torch الذي سيتم وضع التضمينات الناتجة عليه

prompt_embeds (`torch.Tensor`، *اختياري*) : تمثيلات نصية مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد تمثيلات النص من معامل الإدخال `prompt`.

negative_prompt_embeds (`torch.Tensor`, *اختياري*) : تمثيلات نصية سالبة مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، *مثلًا* وزن الأوامر. إذا لم تُقدَّم، فسيتم توليد negative_prompt_embeds من معامل الإدخال `negative_prompt`.

device : (`torch.device`, *اختياري*): جهاز torch

dtype : (`torch.dtype`, *اختياري*): torch dtype

يقوم بتشفير الموجه إلى حالات مخفية لمشفّر النص.

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

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

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py#L629)

**المعاملات:**

start_frame (int) : رقم الإطار المستهدف للإطار الأول في التسلسل.

sequence_num_frames (int) : عدد الإطارات في التسلسل.

target_num_frames (int) : العدد المستهدف للإطارات في الفيديو المولّد.

**يعيد:** `int`

طول التسلسل المحدّث

اقتصاص تسلسل الشرط إلى عدد الإطارات المسموح به.

## LTXLatentUpsamplePipeline[[diffusers.LTXLatentUpsamplePipeline]]

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

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

[المصدر](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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_latent_upsample.py#L188)

**المعاملات:**

video (`list[PipelineImageInput]`، *اختياري*) : إطارات الفيديو المدخلة التي سيتم رفع دقتها. يتعارض مع `latents`.

height (`int`، القيمة الافتراضية `512`) : ارتفاع المخرجات المُوسَّعة بالبكسل.

width (`int`، القيمة الافتراضية `704`) : عرض المخرجات المُوسَّعة بالبكسل.

latents (`torch.Tensor`، *اختياري*) : كامنات فيديو مُرمّزة مسبقًا لرفع الدقة. يتعارض مع `video`.

decode_timestep (`float` أو `list[float]`، القيمة الافتراضية هي `0.0`) : خطوة الزمن التي يتم عندها فك ترميز الكمّات المُوسَّعة.

decode_noise_scale (`float` أو `list[float]`، *اختياري*) : معامل الاستيفاء بين الضوضاء العشوائية واللاتنتات المُزالة الضوضاء عند خطوة فك الترميز.

adain_factor (`float`، القيمة الافتراضية `0.0`) : قوة مطابقة إحصاءات AdaIN المطبقة على الكمون المُوسَّع.

tone_map_compression_ratio (`float`، القيمة الافتراضية `0.0`) : نسبة الضغط المستخدمة في تطبيق خرائط النغمات على الكميات الكامنة المُوسَّعة. يجب أن تكون ضمن المدى [0, 1].

generator (`torch.Generator` أو `list[torch.Generator]`، *اختياري*) : [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html) لجعل التوليد حتميًا.

output_type (`str`، *اختياري*، الافتراضي `"pil"`) : صيغة مخرجات الفيديو المولّد. اختر بين `PIL.Image` أو `np.array` أو `latent`.

return_dict (`bool`، *اختياري*، القيمة الافتراضية `True`) : ما إذا كان يجب إرجاع `~pipelines.ltx.LTXPipelineOutput` بدلاً من tuple عادي.

**يعيد:** `~pipelines.ltx.LTXPipelineOutput` أو `tuple`

`~pipelines.ltx.LTXPipelineOutput` إذا كان `return_dict` هو True، وإلا فسيكون `tuple`. عند إرجاع tuple، يكون العنصر الأول هو الفيديو المُوسَّع (أو الكمونيات إذا كان `output_type="latent"`).

الدالة التي تُستدعى عند استدعاء خط الأنابيب لرفع دقة الصور الكامنة.

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

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

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_latent_upsample.py#L94)

**المعاملات:**

latents (`torch.Tensor`) : الكامنات المدخلة التي يجب تطبيعها

reference_latents (`torch.Tensor`) : الكامنات المرجعية التي توفر إحصاءات الأسلوب.

factor (`float`) : معامل الدمج بين الحالة الكامنة الأصلية والحالة الكامنة المحوّلة. النطاق: من -10.0 إلى 10.0، الافتراضي: 1.0

**يعيد:** `torch.Tensor`

الموتر الكامن المُحوَّل

يطبّق تطبيع الأمثلة التكيفية (AdaIN) على متجه كامن (latent tensor) بناءً على الإحصاءات المستخرجة من متجه كامن مرجعي.

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

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

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_ltx_latent_upsample.py#L122)

**المعاملات:**

latents : torch.Tensor متجه كامن (latent tensor) مدخل ذو شكل تعسفي. يُتوقع أن يكون ضمن النطاق [-1, 1] أو [0, 1] تقريبًا.

compression : float قوة الضغط في المدى [0, 1]. - 0.0: لا يوجد تطبيق للتون-مابينغ (تحويل هوية) - 1.0: تأثير ضغط كامل

**يعيد:**

torch.Tensor متجه كامن مُعاد ضبط تدرّجه اللوني (tone-mapped) بنفس شكل المدخلات.

يطبّق دالة خرائط نغمات غير خطية على القيم الكامنة لتقليل نطاقها الديناميكي بطريقة سلسة إدراكياً باستخدام ضغط يعتمد على دالة سيجمويد.

يُعدّ هذا مفيدًا لتنظيم الكامنات عالية التباين أو لتوجيه المخرجات أثناء التوليد، لا سيما عند التحكم في السلوك الديناميكي باستخدام معامل `compression`.

## 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)
```

[المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/ltx/pipeline_output.py#L9)

**المعاملات:**

frames (`torch.Tensor` أو `np.ndarray` أو list[list[PIL.Image.Image]]) : قائمة من مخرجات الفيديو - يمكن أن تكون قائمة متداخلة بطول `batch_size,` حيث تحتوي كل قائمة فرعية على تسلسلات من صور PIL منزوعة الضوضاء بطول `num_frames.` كما يمكن أن تكون مصفوفة NumPy أو متجه Torch بشكل `(batch_size, num_frames, channels, height, width)`.

فئة الإخراج لخطوط أنابيب LTX.

