#
# Berlisensi di bawah Apache License, Versi 2.0 ("Lisensi");
# Anda mungkin tidak dapat menggunakan file ini kecuali sesuai dengan Lisensi.
# Anda dapat memperoleh salinan Lisensi di
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Kecuali diwajibkan oleh hukum yang berlaku atau disepakati secara tertulis, perangkat lunak
# distribusikan di bawah Lisensi berdasarkan basis "SEBAGAIMANA ADANYA",
# TANPA JAMINAN ATAU SYARAT DALAM BENTUK APAPUN, baik yang dinyatakan maupun yang tersirat.
# Lihat Lisensi untuk bahasa tertentu yang mengatur izin dan
# batasan di bawah Lisensi. -->

  
    
      
    
  

# Helios

[Helios: Model Generasi Video Panjang Real-Time yang Benar-Benar Real-Time](https://huggingface.co/papers/2603.04379) dari Peking University & ByteDance & lainnya, oleh Shenghai Yuan, Yuanyang Yin, Zongjian Li, Xinwei Huang, Xiao Yang, Li Yuan.

*  Kami memperkenalkan Helios, model generasi video 14B pertama yang berjalan pada 17 FPS di satu GPU NVIDIA H100 dan mendukung generasi skala menit sambil menyamai baseline yang kuat dalam hal kualitas. Kami mencapai terobosan di tiga dimensi utama: (1) ketahanan terhadap pergeseran (drifting) pada video panjang tanpa heuristik anti-drifting yang umum digunakan seperti self-forcing, error banks, atau keyframe sampling; (2) generasi real-time tanpa teknik akselerasi standar seperti KV-cache, causal masking, atau sparse attention; dan (3) pelatihan tanpa kerangka kerja paralelisme atau sharding, memungkinkan ukuran batch skala image-diffusion sambil memuat hingga empat model 14B dalam memori GPU 80 GB. Secara spesifik, Helios adalah model difusi autoregresif 14B dengan representasi input terpadu yang secara native mendukung tugas T2V, I2V, dan V2V. Untuk memitigasi pergeseran dalam generasi video panjang, kami mengkarakterisasi mode kegagalan tipalnya dan mengusulkan strategi pelatihan yang sederhana namun efektif yang secara eksplisit mensimulasikan pergeseran selama pelatihan, sambil menghilangkan gerakan repetitif dari sumbernya. Untuk efisiensi, kami mengompresi secara signifikan konteks historis dan berisik serta mengurangi jumlah langkah sampling, menghasilkan biaya komputasi yang sebanding—atau lebih rendah—dibandingkan model generatif video 1.3B. Selain itu, kami memperkenalkan optimasi tingkat infrastruktur yang mempercepat baik inferensi maupun pelatihan sambil mengurangi konsumsi memori. Eksperimen ekstensif menunjukkan bahwa Helios secara konsisten melampaui metode sebelumnya pada generasi video pendek maupun panjang. Semua kode dan model tersedia di [URL https ini](https://pku-yuangroup.github.io/Helios-Page).

Model-model Helios berikut didukung di Diffusers:

- [Helios-Base](https://huggingface.co/BestWishYsh/Helios-Base): Kualitas Terbaik, dengan v-prediction, CFG standar, dan HeliosScheduler khusus.
- [Helios-Mid](https://huggingface.co/BestWishYsh/Helios-Mid): Bobot Menengah, dengan v-prediction, CFG-Zero* dan HeliosScheduler khusus.
- [Helios-Distilled](https://huggingface.co/BestWishYsh/Helios-Distilled): Efisiensi terbaik, dengan x0-prediction dan HeliosDMDScheduler kustom.

> [!TIP]
> Klik model Helios di bilah sisi kanan untuk melihat lebih banyak contoh generasi video.

### Mengoptimalkan Memori dan Kecepatan Inferensi

Contoh di bawah ini menunjukkan cara menghasilkan video dari teks yang dioptimalkan untuk memori atau kecepatan inferensi.

Lihat panduan [Reduce memory usage](../../optimization/memory) untuk detail lebih lanjut tentang berbagai teknik penghematan memori.

Model Helios di bawah ini membutuhkan ~6GB VRAM.

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

vae = AutoModel.from_pretrained("BestWishYsh/Helios-Base", subfolder="vae", dtype=torch.float32)

# group-offloading
pipeline = HeliosPipeline.from_pretrained(
    "BestWishYsh/Helios-Base",
    vae=vae,
    dtype=torch.bfloat16
)
pipeline.enable_group_offload(
    onload_device=torch.device("cuda"),
    offload_device=torch.device("cpu"),
    offload_type="leaf_level",
    use_stream=True,
    record_stream=True,
)

prompt = """
A vibrant tropical fish swimming gracefully among colorful coral reefs in a clear, turquoise ocean. The fish has bright blue 
and yellow scales with a small, distinctive orange spot on its side, its fins moving fluidly. The coral reefs are alive with 
a variety of marine life, including small schools of colorful fish and sea turtles gliding by. The water is crystal clear, 
allowing for a view of the sandy ocean floor below. The reef itself is adorned with a mix of hard and soft corals in shades 
of red, orange, and green. The photo captures the fish from a slightly elevated angle, emphasizing its lively movements and 
the vivid colors of its surroundings. A close-up shot with dynamic movement.
"""
negative_prompt = """
Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality,
low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured,
misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards
"""

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    num_frames=99,
    num_inference_steps=50,
    guidance_scale=5.0,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_base_t2v_output.mp4", fps=24)
```

[Compilation](../../optimization/fp16#torchcompile) lambat pada pemanggilan pertama, tetapi pemanggilan [pipeline](../../optimization/attention_backends) berikutnya menjadi lebih cepat. [Attention Backends](../../optimization/context_parallelism) seperti FlashAttention dan SageAttention dapat meningkatkan kecepatan secara signifikan dengan mengoptimalkan komputasi mekanisme perhatian. [Context Parallelism](../../optimization/cache) membagi urutan input ke beberapa perangkat untuk memungkinkan pemrosesan konteks panjang secara paralel, sehingga mengurangi tekanan memori dan latensi. Caching juga dapat mempercepat inferensi dengan menyimpan dan menggunakan kembali output antara.

```py
import torch
from diffusers import AutoModel, HeliosPipeline
from diffusers.utils import export_to_video

vae = AutoModel.from_pretrained("BestWishYsh/Helios-Base", subfolder="vae", dtype=torch.float32)

pipeline = HeliosPipeline.from_pretrained(
    "BestWishYsh/Helios-Base",
    vae=vae,
    dtype=torch.bfloat16
)
pipeline.to("cuda")  # or "mps", "xpu", "cpu"

# attention backend
# pipeline.transformer.set_attention_backend("flash")
pipeline.transformer.set_attention_backend("_flash_3_hub") # For Hopper GPUs

# torch.compile
torch.backends.cudnn.benchmark = True
pipeline.text_encoder.compile(mode="max-autotune-no-cudagraphs", dynamic=False)
pipeline.vae.compile(mode="max-autotune-no-cudagraphs", dynamic=False)
pipeline.transformer.compile(mode="max-autotune-no-cudagraphs", dynamic=False)

prompt = """
A vibrant tropical fish swimming gracefully among colorful coral reefs in a clear, turquoise ocean. The fish has bright blue 
and yellow scales with a small, distinctive orange spot on its side, its fins moving fluidly. The coral reefs are alive with 
a variety of marine life, including small schools of colorful fish and sea turtles gliding by. The water is crystal clear, 
allowing for a view of the sandy ocean floor below. The reef itself is adorned with a mix of hard and soft corals in shades 
of red, orange, and green. The photo captures the fish from a slightly elevated angle, emphasizing its lively movements and 
the vivid colors of its surroundings. A close-up shot with dynamic movement.
"""
negative_prompt = """
Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality,
low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured,
misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards
"""

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    num_frames=99,
    num_inference_steps=50,
    guidance_scale=5.0,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_base_t2v_output.mp4", fps=24)
```

### Generasi dengan Helios-Base

Contoh di bawah ini menunjukkan cara menggunakan Helios-Base untuk menghasilkan video berdasarkan teks, gambar, atau video.

```python
import torch
from diffusers import AutoModel, HeliosPipeline
from diffusers.utils import export_to_video, load_video, load_image

vae = AutoModel.from_pretrained("BestWishYsh/Helios-Base", subfolder="vae", dtype=torch.float32)

pipeline = HeliosPipeline.from_pretrained(
    "BestWishYsh/Helios-Base",
    vae=vae,
    dtype=torch.bfloat16
)
pipeline.to("cuda")  # or "mps", "xpu", "cpu"

negative_prompt = """
Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality,
low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured,
misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards
"""

# For Text-to-Video
prompt = """
A vibrant tropical fish swimming gracefully among colorful coral reefs in a clear, turquoise ocean. The fish has bright blue 
and yellow scales with a small, distinctive orange spot on its side, its fins moving fluidly. The coral reefs are alive with 
a variety of marine life, including small schools of colorful fish and sea turtles gliding by. The water is crystal clear, 
allowing for a view of the sandy ocean floor below. The reef itself is adorned with a mix of hard and soft corals in shades 
of red, orange, and green. The photo captures the fish from a slightly elevated angle, emphasizing its lively movements and 
the vivid colors of its surroundings. A close-up shot with dynamic movement.
"""

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    num_frames=99,
    num_inference_steps=50,
    guidance_scale=5.0,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_base_t2v_output.mp4", fps=24)

# For Image-to-Video
prompt = """
A towering emerald wave surges forward, its crest curling with raw power and energy. Sunlight glints off the translucent water, 
illuminating the intricate textures and deep green hues within the wave’s body. A thick spray erupts from the breaking crest, 
casting a misty veil that dances above the churning surface. As the perspective widens, the immense scale of the wave becomes 
apparent, revealing the restless expanse of the ocean stretching beyond. The scene captures the ocean’s untamed beauty and 
relentless force, with every droplet and ripple shimmering in the light. The dynamic motion and vivid colors evoke both awe and 
respect for nature’s might.
"""
image_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/helios/wave.jpg"

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    image=load_image(image_path).resize((640, 384)),
    num_frames=99,
    num_inference_steps=50,
    guidance_scale=5.0,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_base_i2v_output.mp4", fps=24)

# For Video-to-Video
prompt = """
A bright yellow Lamborghini Huracn Tecnica speeds along a curving mountain road, surrounded by lush green trees 
under a partly cloudy sky. The car's sleek design and vibrant color stand out against the natural backdrop, 
emphasizing its dynamic movement. The road curves gently, with a guardrail visible on one side, adding depth to 
the scene. The motion blur captures the sense of speed and energy, creating a thrilling and exhilarating atmosphere. 
A front-facing shot from a slightly elevated angle, highlighting the car's aggressive stance and the surrounding greenery.
"""
video_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/helios/car.mp4"

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    video=load_video(video_path),
    num_frames=99,
    num_inference_steps=50,
    guidance_scale=5.0,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_base_v2v_output.mp4", fps=24)
```

### Generasi dengan Helios-Mid

Contoh di bawah ini menunjukkan cara menggunakan Helios-Mid untuk menghasilkan video berdasarkan teks, gambar, atau video.

```python
import torch
from diffusers import AutoModel, HeliosPyramidPipeline
from diffusers.utils import export_to_video, load_video, load_image

vae = AutoModel.from_pretrained("BestWishYsh/Helios-Mid", subfolder="vae", dtype=torch.float32)

pipeline = HeliosPyramidPipeline.from_pretrained(
    "BestWishYsh/Helios-Mid",
    vae=vae,
    dtype=torch.bfloat16
)
pipeline.to("cuda")  # or "mps", "xpu", "cpu"

negative_prompt = """
Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality,
low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured,
misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards
"""

# For Text-to-Video
prompt = """
A vibrant tropical fish swimming gracefully among colorful coral reefs in a clear, turquoise ocean. The fish has bright blue 
and yellow scales with a small, distinctive orange spot on its side, its fins moving fluidly. The coral reefs are alive with 
a variety of marine life, including small schools of colorful fish and sea turtles gliding by. The water is crystal clear, 
allowing for a view of the sandy ocean floor below. The reef itself is adorned with a mix of hard and soft corals in shades 
of red, orange, and green. The photo captures the fish from a slightly elevated angle, emphasizing its lively movements and 
the vivid colors of its surroundings. A close-up shot with dynamic movement.
"""

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    num_frames=99,
    pyramid_num_inference_steps_list=[20, 20, 20],
    guidance_scale=5.0,
    use_zero_init=True,
    zero_steps=1,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_pyramid_t2v_output.mp4", fps=24)

# For Image-to-Video
prompt = """
A towering emerald wave surges forward, its crest curling with raw power and energy. Sunlight glints off the translucent water, 
illuminating the intricate textures and deep green hues within the wave’s body. A thick spray erupts from the breaking crest, 
casting a misty veil that dances above the churning surface. As the perspective widens, the immense scale of the wave becomes 
apparent, revealing the restless expanse of the ocean stretching beyond. The scene captures the ocean’s untamed beauty and 
relentless force, with every droplet and ripple shimmering in the light. The dynamic motion and vivid colors evoke both awe and 
respect for nature’s might.
"""
image_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/helios/wave.jpg"

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    image=load_image(image_path).resize((640, 384)),
    num_frames=99,
    pyramid_num_inference_steps_list=[20, 20, 20],
    guidance_scale=5.0,
    use_zero_init=True,
    zero_steps=1,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_pyramid_i2v_output.mp4", fps=24)

# For Video-to-Video
prompt = """
A bright yellow Lamborghini Huracn Tecnica speeds along a curving mountain road, surrounded by lush green trees 
under a partly cloudy sky. The car's sleek design and vibrant color stand out against the natural backdrop, 
emphasizing its dynamic movement. The road curves gently, with a guardrail visible on one side, adding depth to 
the scene. The motion blur captures the sense of speed and energy, creating a thrilling and exhilarating atmosphere. 
A front-facing shot from a slightly elevated angle, highlighting the car's aggressive stance and the surrounding greenery.
"""
video_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/helios/car.mp4"

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    video=load_video(video_path),
    num_frames=99,
    pyramid_num_inference_steps_list=[20, 20, 20],
    guidance_scale=5.0,
    use_zero_init=True,
    zero_steps=1,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_pyramid_v2v_output.mp4", fps=24)
```

### Generasi dengan Helios-Distilled

Contoh di bawah ini menunjukkan cara menggunakan Helios-Distilled untuk menghasilkan video berdasarkan teks, gambar, atau video.

```python
import torch
from diffusers import AutoModel, HeliosPyramidPipeline
from diffusers.utils import export_to_video, load_video, load_image

vae = AutoModel.from_pretrained("BestWishYsh/Helios-Distilled", subfolder="vae", dtype=torch.float32)

pipeline = HeliosPyramidPipeline.from_pretrained(
    "BestWishYsh/Helios-Distilled",
    vae=vae,
    dtype=torch.bfloat16
)
pipeline.to("cuda")  # or "mps", "xpu", "cpu"

negative_prompt = """
Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality,
low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured,
misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards
"""

# For Text-to-Video
prompt = """
A vibrant tropical fish swimming gracefully among colorful coral reefs in a clear, turquoise ocean. The fish has bright blue 
and yellow scales with a small, distinctive orange spot on its side, its fins moving fluidly. The coral reefs are alive with 
a variety of marine life, including small schools of colorful fish and sea turtles gliding by. The water is crystal clear, 
allowing for a view of the sandy ocean floor below. The reef itself is adorned with a mix of hard and soft corals in shades 
of red, orange, and green. The photo captures the fish from a slightly elevated angle, emphasizing its lively movements and 
the vivid colors of its surroundings. A close-up shot with dynamic movement.
"""

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    num_frames=240,
    pyramid_num_inference_steps_list=[2, 2, 2],
    guidance_scale=1.0,
    is_amplify_first_chunk=True,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_distilled_t2v_output.mp4", fps=24)

# For Image-to-Video
prompt = """
A towering emerald wave surges forward, its crest curling with raw power and energy. Sunlight glints off the translucent water, 
illuminating the intricate textures and deep green hues within the wave’s body. A thick spray erupts from the breaking crest, 
casting a misty veil that dances above the churning surface. As the perspective widens, the immense scale of the wave becomes 
apparent, revealing the restless expanse of the ocean stretching beyond. The scene captures the ocean’s untamed beauty and 
relentless force, with every droplet and ripple shimmering in the light. The dynamic motion and vivid colors evoke both awe and 
respect for nature’s might.
"""
image_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/helios/wave.jpg"

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    image=load_image(image_path).resize((640, 384)),
    num_frames=240,
    pyramid_num_inference_steps_list=[2, 2, 2],
    guidance_scale=1.0,
    is_amplify_first_chunk=True,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_distilled_i2v_output.mp4", fps=24)

# For Video-to-Video
prompt = """
A bright yellow Lamborghini Huracn Tecnica speeds along a curving mountain road, surrounded by lush green trees 
under a partly cloudy sky. The car's sleek design and vibrant color stand out against the natural backdrop, 
emphasizing its dynamic movement. The road curves gently, with a guardrail visible on one side, adding depth to 
the scene. The motion blur captures the sense of speed and energy, creating a thrilling and exhilarating atmosphere. 
A front-facing shot from a slightly elevated angle, highlighting the car's aggressive stance and the surrounding greenery.
"""
video_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/helios/car.mp4"

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    video=load_video(video_path),
    num_frames=240,
    pyramid_num_inference_steps_list=[2, 2, 2],
    guidance_scale=1.0,
    is_amplify_first_chunk=True,
    generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(output, "helios_distilled_v2v_output.mp4", fps=24)
```

## Tampilan Kemampuan Teks-ke-Video

  
    Video yang Dihasilkan dari Prompt
  
  
    Seorang prajurit Viking mengemudikan bus kota modern yang penuh penumpang. Viking tersebut memiliki rambut pirang panjang yang diikat ke belakang, janggut, dan dihiasi helm berbulu serta zirah. Ia mengenakan tunik dan celana tradisional, tetapi juga mengenakan sabuk pengaman saat fokus menavigasi jalanan yang ramai. Interior bus tampak khas, dengan barisan kursi yang diduduki oleh berbagai penumpang yang menjalani rutinitas harian mereka. Potongan eksterior menunjukkan lingkungan urban yang sibuk, termasuk gedung-gedung tinggi dan lalu lintas. Potongan sedang yang berfokus pada Viking di balik kemudi, dengan sesekali close-up pada ekspresinya yang penuh tekad.
    
    
      
        
      
    
  
  
    Potret alam bergaya dokumenter yang diambil dari truk kamera yang bergerak ke kiri, menangkap seekor kepiting yang cepat berlari masuk ke dalam lubangnya. Kepiting tersebut memiliki cangkang keras berwarna hijau kecokelatan dan capit panjang, bergerak dengan kecepatan yang penuh tekad di atas permukaan pasir. Tubuhnya sedikit melengkung saat ia menggali ke dalam pasir, meninggalkan jejak kecil di belakangnya. Latar belakang menampilkan pantai dangkal dengan batu-batu dan kerang yang tersebar, sementara cakrawala menampilkan lengkungan lembut garis pantai. Foto ini memiliki tekstur yang alami dan realistis, menekankan gerakan alami kepiting dan tekstur pasir. Potret jarak dekat dari sudut yang sedikit lebih tinggi.
    
    
      
        
      
    
  

## Contoh Tampilan Gambar-ke-Video

  
    Prompt Gambar Video yang Dihasilkan
  
  
    
    Mobil Kia merah yang ramping melaju di jalan pedesaan di bawah langit berawan, dengan desain modern dan gerakan dinamisnya yang ditekankan oleh efek blur dari gerakan ladang dan pepohonan di sekitarnya yang membentang hingga ke kejauhan. Eksterior mobil yang mengkilap memantulkan langit yang mendung, menonjolkan bentuk aerodinamis dan postur sporty-nya. Plat nomor membaca "KIA 626", dan lampu depan kendaraan menyala, menambah kesan gerakan dan energi. Jalan melengkung dengan lembut, dengan mobil yang diposisikan sedikit di luar pusat, menciptakan kesan momentum ke depan. Pandangan tiga perempat depan yang dinamis menangkap kehadiran kuat mobil tersebut di latar belakang yang tenang berupa bukit-bukit bergelombang dan pepohonan yang tersebar.
    
    
      
        
      
    
  
  
    
    Potret jarak dekat menangkap seekor kucing oranye berbulu lebat dengan mata hijau yang mencolok dan kumis putih, menatap tajam ke arah kamera. Bulu kucing tersebut lembut dan terawat, dengan perpaduan nuansa oranye hangat dan krem. Mata besarnya yang ekspresif berwarna hijau cerah, memantulkan rasa ingin tahu dan kewaspadaan. Hidungnya kecil dan berwarna merah muda, serta mulutnya sedikit terbuka, memperlihatkan sedikit lidahnya yang berwarna merah muda. Latar belakangnya buram secara lembut, mengisyaratkan suasana dalam ruangan yang nyaman dengan nuansa netral. Foto ini memiliki kedalaman bidang yang dangkal, memfokuskan tajam pada wajah kucing sementara latar belakang tetap tidak fokus. Potret jarak dekat dari sudut pandang yang sedikit lebih tinggi.
    
    
      
        
      
    
  

## Pameran Video Interaktif

  
    Video yang Dihasilkan dari Prompt
  
  
    Prompt dapat ditemukan di sini
    
      
        
      
    
  
  
    Prompt dapat ditemukan di sini
    
      
        
      
    
  

## Sumber daya

Pelajari lebih lanjut tentang Helios dengan sumber daya berikut.
- Tonton [video1](https://www.youtube.com/watch?v=vd_AgHtOUFQ) dan [video2](https://www.youtube.com/watch?v=1GeIU2Dn7UY) untuk demonstrasi fitur utama Helios.
- Makalah penelitian, [Helios: Real Real-Time Long Video Generation Model](https://huggingface.co/papers/2603.04379) untuk detail lebih lanjut.

## HeliosPipeline[[diffusers.HeliosPipeline]]

#### diffusers.HeliosPipeline[[diffusers.HeliosPipeline]]

```python
diffusers.HeliosPipeline(tokenizer: AutoTokenizer, text_encoder: UMT5EncoderModel, vae: AutoencoderKLWan, scheduler: HeliosScheduler, transformer: HeliosTransformer3DModel)
```

[Sumber](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/pipelines/helios/pipeline_helios.py#L108)

**Parameter:**

tokenizer (`T5Tokenizer`) : Tokenizer dari [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5Tokenizer), khususnya varian [google/umt5-xxl](https://huggingface.co/google/umt5-xxl).

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel), khususnya varian [google/umt5-xxl](https://huggingface.co/google/umt5-xxl).

transformer ([HeliosTransformer3DModel](/docs/diffusers/v0.43.0/id/api/models/helios_transformer3d#diffusers.HeliosTransformer3DModel)) : Transformer bersyarat untuk mendenoise latens input.

scheduler ([HeliosScheduler](/docs/diffusers/v0.43.0/id/api/schedulers/helios#diffusers.HeliosScheduler)) : Penjadwal yang digunakan bersama `transformer` untuk menghilangkan noise pada latens gambar yang telah dikodekan.

vae ([AutoencoderKLWan](/docs/diffusers/v0.43.0/id/api/models/autoencoder_kl_wan#diffusers.AutoencoderKLWan)) : Model Variational Auto-Encoder (VAE) untuk mengodekan dan mendekodekan video ke dan dari representasi laten.

Pipeline untuk generasi teks-ke-video / gambar-ke-video / video-ke-video menggunakan Helios.

Model ini mewarisi dari [DiffusionPipeline](/docs/diffusers/v0.43.0/id/api/pipelines/overview#diffusers.DiffusionPipeline). Periksa dokumentasi kelas induk untuk metode generik yang diimplementasikan untuk semua pipeline (mengunduh, menyimpan, menjalankan pada perangkat tertentu, dll.).

#### __call__[[diffusers.HeliosPipeline.__call__]]

```python
__call__(prompt: str | list[str] = None, negative_prompt: str | list[str] = None, height: int = 384, width: int = 640, num_frames: int = 132, num_inference_steps: int = 50, sigmas: list[float] = None, guidance_scale: float = 5.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, negative_prompt_embeds: typing.Optional[torch.Tensor] = None, output_type: str | None = 'np', return_dict: bool = True, attention_kwargs: dict[str, typing.Any] | None = None, callback_on_step_end: typing.Union[typing.Callable[[int, int], NoneType], diffusers.callbacks.PipelineCallback, diffusers.callbacks.MultiPipelineCallbacks, NoneType] = None, callback_on_step_end_tensor_inputs: list[str] = ['latents'], max_sequence_length: int = 512, image: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor], NoneType] = None, image_latents: typing.Optional[torch.Tensor] = None, fake_image_latents: typing.Optional[torch.Tensor] = None, add_noise_to_image_latents: bool = True, image_noise_sigma_min: float = 0.111, image_noise_sigma_max: float = 0.135, video: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor], NoneType] = None, video_latents: typing.Optional[torch.Tensor] = None, add_noise_to_video_latents: bool = True, video_noise_sigma_min: float = 0.111, video_noise_sigma_max: float = 0.135, history_sizes: list = [16, 2, 1], num_latent_frames_per_chunk: int = 9, keep_first_frame: bool = True, is_skip_first_chunk: bool = False)
```

[Sumber](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/pipelines/helios/pipeline_helios.py#L445)

**Parameter:**

prompt (`str` atau `list[str]`, *opsional*) : Prompt atau prompt-prompt untuk mengarahkan generasi gambar. Jika tidak didefinisikan, gunakan `prompt_embeds` sebagai gantinya.

negative_prompt (`str` atau `list[str]`, *opsional*) : Prompt atau prompt-prompt yang harus dihindari selama pembuatan gambar. Jika tidak didefinisikan, gunakan `negative_prompt_embeds` sebagai gantinya. Diabaikan jika tidak menggunakan guidance (`guidance_scale` < `1`).

height (`int`, defaultnya `384`) : Tinggi gambar yang dihasilkan dalam piksel.

width (`int`, defaultnya `640`) : Lebar gambar yang dihasilkan dalam piksel.

num_frames (`int`, defaultnya `132`) : Jumlah frame dalam video yang dihasilkan.

num_inference_steps (`int`, defaultnya `50`) : Jumlah langkah denoising. Semakin banyak langkah denoising, biasanya menghasilkan gambar dengan kualitas lebih tinggi, namun dengan biaya inferensi yang lebih lambat.

sigmas (`list[float]`, *opsional*) : Sigma kustom untuk digunakan dalam proses denoising. Jika tidak didefinisikan, jadwal default scheduler akan digunakan.

guidance_scale (`float`, defaultnya `5.0`) : Skala panduan seperti yang didefinisikan dalam [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598). `guidance_scale` didefinisikan sebagai `w` dari persamaan 2. pada [Imagen Paper](https://huggingface.co/papers/2205.11487). Skala panduan diaktifkan dengan mengatur `guidance_scale > 1`. Skala panduan yang lebih tinggi mendorong generasi gambar yang sangat terkait dengan `prompt` teks, biasanya dengan mengorbankan kualitas gambar yang lebih rendah.

num_videos_per_prompt (`int`, *opsional*, default 1) : Jumlah gambar yang akan dihasilkan per prompt.

generator (`torch.Generator` atau `list[torch.Generator]`, *opsional*) : Sebuah [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html) untuk membuat proses generasi menjadi deterministik.

latents (`torch.Tensor`, *opsional*) : Laten berisik yang telah dibuat sebelumnya, diambil dari distribusi Gaussian, untuk digunakan sebagai input untuk generasi gambar. Dapat digunakan untuk menyesuaikan generasi yang sama dengan prompt yang berbeda. Jika tidak disediakan, tensor laten akan dibuat dengan pengambilan sampel menggunakan `generator` acak yang diberikan.

prompt_embeds (`torch.Tensor`, *opsional*) : Embedding teks yang telah dibuat sebelumnya. Dapat digunakan untuk dengan mudah menyesuaikan input teks (pemberian bobot pada prompt). Jika tidak disediakan, embedding teks akan dihasilkan dari argumen input `prompt`.

negative_prompt_embeds (`torch.Tensor`, *opsional*) : Embedding teks negatif yang telah dibuat sebelumnya. Jika tidak disediakan, embedding ini akan dibuat dari `negative_prompt`.

output_type (`str`, *opsional*, defaultnya `"np"`) : Format output dari gambar yang dihasilkan. Pilih antara `PIL.Image` atau `np.array`.

return_dict (`bool`, *opsional*, defaultnya `True`) : Apakah akan mengembalikan `HeliosPipelineOutput` alih-alih tuple biasa.

attention_kwargs (`dict`, *opsional*) : Kamus kwargs yang jika ditentukan akan diteruskan ke `AttentionProcessor` seperti yang didefinisikan di bawah `self.processor` dalam [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).

callback_on_step_end (`Callable`, `PipelineCallback`, `MultiPipelineCallbacks`, *opsional*) : Fungsi atau subkelas dari `PipelineCallback` atau `MultiPipelineCallbacks` yang dipanggil di akhir setiap langkah denoising selama inferensi, dengan argumen berikut: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. `callback_kwargs` akan berisi daftar semua tensor sesuai yang ditentukan oleh `callback_on_step_end_tensor_inputs`.

callback_on_step_end_tensor_inputs (`list`, *opsional*) : Daftar input tensor untuk fungsi `callback_on_step_end`. Tensor yang ditentukan dalam daftar akan diteruskan sebagai argumen `callback_kwargs`. Anda hanya dapat menyertakan variabel yang tercantum dalam atribut `._callback_tensor_inputs` dari kelas pipeline Anda.

max_sequence_length (`int`, defaultnya `512`) : Panjang maksimum urutan dari text encoder. Jika prompt lebih panjang dari ini, prompt akan dipotong. Jika prompt lebih pendek, prompt akan di-pad hingga panjang ini.

image (`PipelineImageInput`, *opsional*) : Gambar input yang digunakan untuk kondisioning gambar-ke-video.

image_latents (`torch.Tensor`, *opsional*) : Laten gambar yang sudah di-encode sebelumnya untuk digunakan sebagai pengganti `image`.

fake_image_latents (`torch.Tensor`, *opsional*) : Laten gambar palsu opsional yang digunakan selama kondisioning.

add_noise_to_image_latents (`bool`, *opsional*, defaultnya `True`) : Apakah akan menambahkan noise ke latens gambar sebelum denoising.

image_noise_sigma_min (`float`, *opsional*, defaultnya `0.111`) : Nilai sigma minimum untuk noise yang ditambahkan ke latens gambar.

image_noise_sigma_max (`float`, *opsional*, defaultnya `0.135`) : Nilai sigma maksimum untuk noise yang ditambahkan ke latens gambar.

video (`PipelineImageInput`, *opsional*) : Video input yang digunakan untuk kondisioning video-ke-video.

video_latents (`torch.Tensor`, *opsional*) : Laten video yang sudah di-encode sebelumnya untuk digunakan sebagai pengganti `video`.

add_noise_to_video_latents (`bool`, *opsional*, defaultnya `True`) : Apakah akan menambahkan noise ke latens video sebelum denoising.

video_noise_sigma_min (`float`, *opsional*, defaultnya `0.111`) : Nilai sigma minimum untuk noise yang ditambahkan ke latens video.

video_noise_sigma_max (`float`, *opsional*, default `0.135`) : Nilai sigma maksimum untuk noise yang ditambahkan ke latens video.

history_sizes (`list`, *opsional*, defaultnya `[16, 2, 1]`) : Ukuran jendela riwayat yang digunakan untuk generasi chunked autoregresif.

num_latent_frames_per_chunk (`int`, *opsional*, defaultnya `9`) : Jumlah frame laten yang dihasilkan per chunk selama generasi autoregresif.

keep_first_frame (`bool`, *opsional*, defaultnya `True`) : Apakah mempertahankan frame pertama di antara chunk.

is_skip_first_chunk (`bool`, *opsional*, defaultnya `False`) : Apakah akan melewati pembuatan chunk pertama.

**Mengembalikan:** `~HeliosPipelineOutput` atau `tuple`

Jika `return_dict` adalah `True`, maka `HeliosPipelineOutput` dikembalikan, selain itu sebuah `tuple` dikembalikan di mana elemen pertama adalah daftar berisi gambar yang dihasilkan dan elemen kedua adalah daftar `bool` yang menunjukkan apakah gambar yang dihasilkan yang sesuai mengandung konten "not-safe-for-work" (nsfw).

Fungsi panggilan untuk pipeline pada generasi.

Contoh:
```python
>>> import torch
>>> from diffusers.utils import export_to_video
>>> from diffusers import AutoencoderKLWan, HeliosPipeline

>>> # Available models: BestWishYsh/Helios-Base, BestWishYsh/Helios-Mid, BestWishYsh/Helios-Distilled
>>> model_id = "BestWishYsh/Helios-Base"
>>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
>>> pipe = HeliosPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)
>>> pipe.to("cuda")

>>> prompt = "A cat and a dog baking a cake together in a kitchen. The cat is carefully measuring flour, while the dog is stirring the batter with a wooden spoon. The kitchen is cozy, with sunlight streaming through the window."
>>> negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"

>>> output = pipe(
...     prompt=prompt,
...     negative_prompt=negative_prompt,
...     height=384,
...     width=640,
...     num_frames=132,
...     guidance_scale=5.0,
... ).frames[0]
>>> export_to_video(output, "output.mp4", fps=24)
```

#### encode_prompt[[diffusers.HeliosPipeline.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, max_sequence_length: int = 226, device: typing.Optional[torch.device] = None, dtype: typing.Optional[torch.dtype] = None)
```

[Sumber](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/pipelines/helios/pipeline_helios.py#L196)

**Parameter:**

prompt (`str` atau `list[str]`, *opsional*) : prompt yang akan dienkod

negative_prompt (`str` atau `list[str]`, *opsional*) : Prompt atau prompt-prompt yang tidak akan memandu generasi gambar. Jika tidak didefinisikan, Anda harus meneruskan `negative_prompt_embeds` sebagai gantinya. Diabaikan saat tidak menggunakan guidance (yaitu, diabaikan jika `guidance_scale` kurang dari `1`).

do_classifier_free_guidance (`bool`, *opsional*, defaultnya `True`) : Apakah akan menggunakan classifier free guidance atau tidak.

num_videos_per_prompt (`int`, *opsional*, default 1) : Jumlah video yang harus dihasilkan per prompt. perangkat torch untuk menempatkan embedding yang dihasilkan

prompt_embeds (`torch.Tensor`, *opsional*) : Embedding teks yang sudah dibuat sebelumnya. Dapat digunakan untuk dengan mudah menyesuaikan input teks, *misalnya* penimbangan prompt. Jika tidak disediakan, embedding teks akan dihasilkan dari argumen input `prompt`.

negative_prompt_embeds (`torch.Tensor`, *opsional*) : Embedding teks negatif yang telah dibuat sebelumnya. Dapat digunakan untuk dengan mudah menyesuaikan input teks, *misalnya* penimbangan prompt. Jika tidak disediakan, negative_prompt_embeds akan dibuat dari argumen input `negative_prompt`.

device : (`torch.device`, *opsional*): perangkat torch

dtype : (`torch.dtype`, *opsional*): torch dtype

Mengkodekan prompt menjadi hidden states dari text encoder.

## HeliosPyramidPipeline[[diffusers.HeliosPyramidPipeline]]

#### diffusers.HeliosPyramidPipeline[[diffusers.HeliosPyramidPipeline]]

```python
diffusers.HeliosPyramidPipeline(tokenizer: AutoTokenizer, text_encoder: UMT5EncoderModel, vae: AutoencoderKLWan, scheduler: diffusers.schedulers.scheduling_helios.HeliosScheduler | diffusers.schedulers.scheduling_helios_dmd.HeliosDMDScheduler, transformer: HeliosTransformer3DModel, is_cfg_zero_star: bool = False, is_distilled: bool = False)
```

[Sumber](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py#L121)

**Parameter:**

tokenizer (`T5Tokenizer`) : Tokenizer dari [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5Tokenizer), khususnya varian [google/umt5-xxl](https://huggingface.co/google/umt5-xxl).

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel), khususnya varian [google/umt5-xxl](https://huggingface.co/google/umt5-xxl).

transformer ([HeliosTransformer3DModel](/docs/diffusers/v0.43.0/id/api/models/helios_transformer3d#diffusers.HeliosTransformer3DModel)) : Transformer bersyarat untuk mendenoise latens input.

scheduler ([`HeliosScheduler`, `HeliosDMDScheduler`]) : Penjadwal yang digunakan bersama `transformer` untuk menghilangkan noise pada latens gambar yang telah dikodekan.

vae ([AutoencoderKLWan](/docs/diffusers/v0.43.0/id/api/models/autoencoder_kl_wan#diffusers.AutoencoderKLWan)) : Model Variational Auto-Encoder (VAE) untuk mengodekan dan mendekodekan video ke dan dari representasi laten.

Pipeline untuk generasi teks-ke-video / gambar-ke-video / video-ke-video menggunakan Helios.

Model ini mewarisi dari [DiffusionPipeline](/docs/diffusers/v0.43.0/id/api/pipelines/overview#diffusers.DiffusionPipeline). Periksa dokumentasi kelas induk untuk metode generik yang diimplementasikan untuk semua pipeline (mengunduh, menyimpan, menjalankan pada perangkat tertentu, dll.).

#### __call__[[diffusers.HeliosPyramidPipeline.__call__]]

```python
__call__(prompt: str | list[str] = None, negative_prompt: str | list[str] = None, height: int = 384, width: int = 640, num_frames: int = 132, sigmas: list[float] = None, guidance_scale: float = 5.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, negative_prompt_embeds: typing.Optional[torch.Tensor] = None, output_type: str | None = 'np', return_dict: bool = True, attention_kwargs: dict[str, typing.Any] | None = None, callback_on_step_end: typing.Union[typing.Callable[[int, int], NoneType], diffusers.callbacks.PipelineCallback, diffusers.callbacks.MultiPipelineCallbacks, NoneType] = None, callback_on_step_end_tensor_inputs: list[str] = ['latents'], max_sequence_length: int = 512, image: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor], NoneType] = None, image_latents: typing.Optional[torch.Tensor] = None, fake_image_latents: typing.Optional[torch.Tensor] = None, add_noise_to_image_latents: bool = True, image_noise_sigma_min: float = 0.111, image_noise_sigma_max: float = 0.135, video: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor], NoneType] = None, video_latents: typing.Optional[torch.Tensor] = None, add_noise_to_video_latents: bool = True, video_noise_sigma_min: float = 0.111, video_noise_sigma_max: float = 0.135, history_sizes: list = [16, 2, 1], num_latent_frames_per_chunk: int = 9, keep_first_frame: bool = True, is_skip_first_chunk: bool = False, pyramid_num_inference_steps_list: list = [10, 10, 10], use_zero_init: bool | None = True, zero_steps: int | None = 1, is_amplify_first_chunk: bool = False)
```

[Sumber](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py#L508)

**Parameter:**

prompt (`str` atau `list[str]`, *opsional*) : Prompt atau prompt-prompt untuk mengarahkan generasi gambar. Jika tidak didefinisikan, gunakan `prompt_embeds` sebagai gantinya.

negative_prompt (`str` atau `list[str]`, *opsional*) : Prompt atau prompt-prompt yang harus dihindari selama pembuatan gambar. Jika tidak didefinisikan, gunakan `negative_prompt_embeds` sebagai gantinya. Diabaikan jika tidak menggunakan guidance (`guidance_scale` < `1`).

height (`int`, defaultnya `384`) : Tinggi gambar yang dihasilkan dalam piksel.

width (`int`, defaultnya `640`) : Lebar gambar yang dihasilkan dalam piksel.

num_frames (`int`, defaultnya `132`) : Jumlah frame dalam video yang dihasilkan.

sigmas (`list[float]`, *opsional*) : Sigma kustom untuk digunakan dalam proses denoising. Jika tidak didefinisikan, jadwal default scheduler akan digunakan.

guidance_scale (`float`, defaultnya `5.0`) : Skala panduan seperti yang didefinisikan dalam [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598). `guidance_scale` didefinisikan sebagai `w` dari persamaan 2. pada [Imagen Paper](https://huggingface.co/papers/2205.11487). Skala panduan diaktifkan dengan mengatur `guidance_scale > 1`. Skala panduan yang lebih tinggi mendorong generasi gambar yang sangat terkait dengan `prompt` teks, biasanya dengan mengorbankan kualitas gambar yang lebih rendah.

num_videos_per_prompt (`int`, *opsional*, default 1) : Jumlah gambar yang akan dihasilkan per prompt.

generator (`torch.Generator` atau `list[torch.Generator]`, *opsional*) : Sebuah [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html) untuk membuat proses generasi menjadi deterministik.

latents (`torch.Tensor`, *opsional*) : Laten berisik yang telah dibuat sebelumnya, diambil dari distribusi Gaussian, untuk digunakan sebagai input untuk generasi gambar. Dapat digunakan untuk menyesuaikan generasi yang sama dengan prompt yang berbeda. Jika tidak disediakan, tensor laten akan dibuat dengan pengambilan sampel menggunakan `generator` acak yang diberikan.

prompt_embeds (`torch.Tensor`, *opsional*) : Embedding teks yang telah dibuat sebelumnya. Dapat digunakan untuk dengan mudah menyesuaikan input teks (pemberian bobot pada prompt). Jika tidak disediakan, embedding teks akan dihasilkan dari argumen input `prompt`.

negative_prompt_embeds (`torch.Tensor`, *opsional*) : Embedding teks negatif yang telah dibuat sebelumnya. Jika tidak disediakan, embedding ini akan dibuat dari `negative_prompt`.

output_type (`str`, *opsional*, defaultnya `"np"`) : Format output dari gambar yang dihasilkan. Pilih antara `PIL.Image` atau `np.array`.

return_dict (`bool`, *opsional*, defaultnya `True`) : Apakah akan mengembalikan `HeliosPipelineOutput` alih-alih tuple biasa.

attention_kwargs (`dict`, *opsional*) : Kamus kwargs yang jika ditentukan akan diteruskan ke `AttentionProcessor` seperti yang didefinisikan di bawah `self.processor` dalam [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).

callback_on_step_end (`Callable`, `PipelineCallback`, `MultiPipelineCallbacks`, *opsional*) : Fungsi atau subkelas dari `PipelineCallback` atau `MultiPipelineCallbacks` yang dipanggil di akhir setiap langkah denoising selama inferensi, dengan argumen berikut: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. `callback_kwargs` akan berisi daftar semua tensor sesuai yang ditentukan oleh `callback_on_step_end_tensor_inputs`.

callback_on_step_end_tensor_inputs (`list`, *opsional*) : Daftar input tensor untuk fungsi `callback_on_step_end`. Tensor yang ditentukan dalam daftar akan diteruskan sebagai argumen `callback_kwargs`. Anda hanya dapat menyertakan variabel yang tercantum dalam atribut `._callback_tensor_inputs` dari kelas pipeline Anda.

max_sequence_length (`int`, defaultnya `512`) : Panjang maksimum urutan dari text encoder. Jika prompt lebih panjang dari ini, prompt akan dipotong. Jika prompt lebih pendek, prompt akan di-pad hingga panjang ini.

image (`PipelineImageInput`, *opsional*) : Gambar input yang digunakan untuk kondisioning gambar-ke-video.

image_latents (`torch.Tensor`, *opsional*) : Laten gambar yang sudah di-encode sebelumnya untuk digunakan sebagai pengganti `image`.

fake_image_latents (`torch.Tensor`, *opsional*) : Laten gambar palsu opsional yang digunakan selama kondisioning.

add_noise_to_image_latents (`bool`, *opsional*, defaultnya `True`) : Apakah akan menambahkan noise ke latens gambar sebelum denoising.

image_noise_sigma_min (`float`, *opsional*, defaultnya `0.111`) : Nilai sigma minimum untuk noise yang ditambahkan ke latens gambar.

image_noise_sigma_max (`float`, *opsional*, defaultnya `0.135`) : Nilai sigma maksimum untuk noise yang ditambahkan ke latens gambar.

video (`PipelineImageInput`, *opsional*) : Video input yang digunakan untuk kondisioning video-ke-video.

video_latents (`torch.Tensor`, *opsional*) : Laten video yang sudah di-encode sebelumnya untuk digunakan sebagai pengganti `video`.

add_noise_to_video_latents (`bool`, *opsional*, defaultnya `True`) : Apakah akan menambahkan noise ke latens video sebelum denoising.

video_noise_sigma_min (`float`, *opsional*, defaultnya `0.111`) : Nilai sigma minimum untuk noise yang ditambahkan ke latens video.

video_noise_sigma_max (`float`, *opsional*, default `0.135`) : Nilai sigma maksimum untuk noise yang ditambahkan ke latens video.

history_sizes (`list`, *opsional*, defaultnya `[16, 2, 1]`) : Ukuran jendela riwayat yang digunakan untuk generasi chunked autoregresif.

num_latent_frames_per_chunk (`int`, *opsional*, defaultnya `9`) : Jumlah frame laten yang dihasilkan per chunk selama generasi autoregresif.

keep_first_frame (`bool`, *opsional*, defaultnya `True`) : Apakah mempertahankan frame pertama di antara chunk.

is_skip_first_chunk (`bool`, *opsional*, defaultnya `False`) : Apakah akan melewati pembuatan chunk pertama.

pyramid_num_inference_steps_list (`list`, *opsional*, default `[10, 10, 10]`) : Jumlah langkah inferensi untuk setiap tahap piramida selama generasi Tahap 2.

use_zero_init (`bool`, *opsional*, defaultnya `True`) : Apakah akan menerapkan CFG zero-init di awal denoising.

zero_steps (`int`, *opsional*, defaultnya `1`) : Jumlah langkah awal yang menggunakan CFG zero-init.

is_amplify_first_chunk (`bool`, *opsional*, defaultnya `False`) : Apakah akan memperkuat panduan pada chunk pertama (berkaitan dengan DMD).

**Mengembalikan:** `~HeliosPipelineOutput` atau `tuple`

Jika `return_dict` adalah `True`, maka `HeliosPipelineOutput` dikembalikan, selain itu sebuah `tuple` dikembalikan di mana elemen pertama adalah daftar berisi gambar yang dihasilkan dan elemen kedua adalah daftar `bool` yang menunjukkan apakah gambar yang dihasilkan yang sesuai mengandung konten "not-safe-for-work" (nsfw).

Fungsi panggilan untuk pipeline pada generasi.

Contoh:
```python
>>> import torch
>>> from diffusers.utils import export_to_video
>>> from diffusers import AutoencoderKLWan, HeliosPyramidPipeline

>>> # Available models: BestWishYsh/Helios-Base, BestWishYsh/Helios-Mid, BestWishYsh/Helios-Distilled
>>> model_id = "BestWishYsh/Helios-Base"
>>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
>>> pipe = HeliosPyramidPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)
>>> pipe.to("cuda")

>>> prompt = "A cat and a dog baking a cake together in a kitchen. The cat is carefully measuring flour, while the dog is stirring the batter with a wooden spoon. The kitchen is cozy, with sunlight streaming through the window."
>>> negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"

>>> output = pipe(
...     prompt=prompt,
...     negative_prompt=negative_prompt,
...     height=384,
...     width=640,
...     num_frames=132,
...     guidance_scale=5.0,
... ).frames[0]
>>> export_to_video(output, "output.mp4", fps=24)
```

#### encode_prompt[[diffusers.HeliosPyramidPipeline.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, max_sequence_length: int = 226, device: typing.Optional[torch.device] = None, dtype: typing.Optional[torch.dtype] = None)
```

[Sumber](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py#L214)

**Parameter:**

prompt (`str` atau `list[str]`, *opsional*) : prompt yang akan dienkod

negative_prompt (`str` atau `list[str]`, *opsional*) : Prompt atau prompt-prompt yang tidak akan memandu generasi gambar. Jika tidak didefinisikan, Anda harus meneruskan `negative_prompt_embeds` sebagai gantinya. Diabaikan saat tidak menggunakan guidance (yaitu, diabaikan jika `guidance_scale` kurang dari `1`).

do_classifier_free_guidance (`bool`, *opsional*, defaultnya `True`) : Apakah akan menggunakan classifier free guidance atau tidak.

num_videos_per_prompt (`int`, *opsional*, default 1) : Jumlah video yang harus dihasilkan per prompt. perangkat torch untuk menempatkan embedding yang dihasilkan

prompt_embeds (`torch.Tensor`, *opsional*) : Embedding teks yang sudah dibuat sebelumnya. Dapat digunakan untuk dengan mudah menyesuaikan input teks, *misalnya* penimbangan prompt. Jika tidak disediakan, embedding teks akan dihasilkan dari argumen input `prompt`.

negative_prompt_embeds (`torch.Tensor`, *opsional*) : Embedding teks negatif yang telah dibuat sebelumnya. Dapat digunakan untuk dengan mudah menyesuaikan input teks, *misalnya* penimbangan prompt. Jika tidak disediakan, negative_prompt_embeds akan dibuat dari argumen input `negative_prompt`.

device : (`torch.device`, *opsional*): perangkat torch

dtype : (`torch.dtype`, *opsional*): torch dtype

Mengkodekan prompt menjadi hidden states dari text encoder.

## HeliosPipelineOutput[[diffusers.pipelines.helios.pipeline_output.HeliosPipelineOutput]]

#### diffusers.pipelines.helios.pipeline_output.HeliosPipelineOutput[[diffusers.pipelines.helios.pipeline_output.HeliosPipelineOutput]]

```python
diffusers.pipelines.helios.pipeline_output.HeliosPipelineOutput(frames: Tensor)
```

[Sumber](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/pipelines/helios/pipeline_output.py#L9)

**Parameter:**

frames (`torch.Tensor`, `np.ndarray`, atau List[List[PIL.Image.Image]]) : Daftar output video - Dapat berupa daftar bersarang dengan panjang `batch_size,` di mana setiap sub-daftar berisi urutan gambar PIL yang telah didenoise dengan panjang `num_frames.` Dapat juga berupa array NumPy atau tensor Torch dengan bentuk `(batch_size, num_frames, channels, height, width)`.

Kelas output untuk pipeline Helios.

