#
# Apache License, Version 2.0（「ライセンス」）の下でライセンスされています。
# このファイルは、ライセンスに準拠した場合にのみ使用できます。
# ライセンスのコピーは以下から入手できます
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# 適用される法律で要求される場合、または書面による合意がある場合を除き、ソフトウェア
# ライセンスに基づき配布される本ソフトウェアは、「現状のまま」
# 明示的または黙示的を問わず、いかなる種類の保証や条件も付随しません。
# 権限を管理する特定の言語については、ライセンスを参照してください。
# ライセンスの下での制限。-->

  
    
      
    
  

# Helios

北京大学およびByteDanceなどのShenghai Yuan、Yuanyang Yin、Zongjian Li、Xinwei Huang、Xiao Yang、Li Yuanによる[Helios: Real Real-Time Long Video Generation Model](https://huggingface.co/papers/2603.04379)

*  Helios を紹介します。Helios は、単一の NVIDIA H100 GPU 上で 17 FPS で動作し、分単位の生成をサポートしながら、強力なベースラインと同等の品質を維持する、初の 14B パラメータの動画生成モデルです。3 つの重要な次元でブレークスルーを達成しました。(1) self-forcing、error banks、keyframe sampling といった一般的な抗ドリフトのヒューリスティックを使用せずに、長時間動画のドリフトに対する頑健性を確保すること。(2) KV-cache、causal masking、sparse attention といった標準的な高速化技術を使用せずに、リアルタイム生成を実現すること。(3) パラレル化やシャーディングフレームワークを使用せずに学習を行うことで、80 GB の GPU メモリ内に最大 4 つの 14B モデルを収容しつつ、画像拡散モデル規模のバッチサイズを可能にすること。具体的には、Helios は統一された入力表現を備えた 14B の自己回帰型拡散モデルであり、T2V、I2V、V2V タスクをネイティブでサポートします。長時間動画生成におけるドリフトを軽減するため、その典型的な失敗モードを特徴付け、学習中にドリフトを明示的にシミュレートするシンプルかつ効果的な学習戦略を提案するとともに、根源から反復的な動きを排除します。効率化のため、履歴およびノイズ付きコンテキストを大幅に圧縮し、サンプリングステップ数を削減することで、1.3B の動画生成モデルと同等かそれ以下の計算コストを実現しました。さらに、推論と学習の両方を高速化し、メモリ消費量を削減するインフラストラクチャレベルの最適化を導入しました。広範な実験により、Helios は短時間動画および長時間動画の生成の両方で、従来の手法を一貫して上回ることが示されました。すべてのコードとモデルは [この https URL](https://pku-yuangroup.github.io/Helios-Page) で利用可能です。

Diffusersでは、以下のHeliosモデルがサポートされています:

- [Helios-Base](https://huggingface.co/BestWishYsh/Helios-Base): v-prediction、標準の CFG、カスタムの HeliosScheduler を採用した最高品質のモデル。
- [Helios-Mid](https://huggingface.co/BestWishYsh/Helios-Mid): 中間ウェイト。v-prediction、CFG-Zero*、およびカスタムの HeliosScheduler を採用しています。
- [Helios-Distilled](https://huggingface.co/BestWishYsh/Helios-Distilled): x0-predictionとカスタムのHeliosDMDSchedulerにより、最高の効率を実現。

> [!TIP]
> Helios モデルのより多くの動画生成の例については、右側のサイドバーをクリックしてください。

### メモリと推論速度の最適化

以下の例では、メモリまたは推論速度に最適化されたテキストから動画の生成方法を示しています。

メモリ使用量の削減に関する詳細については、[メモリ使用量の削減](../../optimization/memory)ガイドを参照してください。

以下のHeliosモデルには、約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) は初回に時間がかかりますが、以降の pipeline 呼び出しは高速になります。FlashAttention や SageAttention などの [Attention Backends](../../optimization/attention_backends) は、attention メカニズムの計算を最適化することで、速度を大幅に向上させることができます。[Context Parallelism](../../training/distributed_inference#context-parallelism) は、入力シーケンスを複数のデバイスに分割して並列処理を可能にし、メモリ負荷とレイテンシを低減します。[Caching](../../optimization/cache) も、中間出力を保存して再利用することで推論を高速化できる場合があります。

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

### Helios-Base による生成

以下の例では、Helios-Baseを使用して、テキスト、画像、またはビデオに基づいてビデオを生成する方法を示します。

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

### Helios-Mid による生成

以下の例では、テキスト、画像、またはビデオに基づいてビデオを生成するためにHelios-Midを使用する方法を示しています。

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

### Helios-Distilledによる生成

以下の例では、Helios-Distilledを使用して、テキスト、画像、またはビデオに基づいてビデオを生成する方法を示します。

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

## テキストから動画への変換のデモ

  
    プロンプトから生成された動画
  
  
    乗客でいっぱいの現代の市街地バスを運転するバイキングの戦士。バイキングは後ろに結んだ長い金髪と髭を生やし、毛皮で縁取られた兜と鎧を身につけている。伝統的なチュニックとズボンを着用しているが、混雑した街路を運転する際にはシートベルトも着用している。バスの内装は典型的なもので、多様な乗客が日常の用事をしながら座席に座っている。外側のショットでは、高層ビルや交通量を含む活気ある都市環境が映し出されている。ハンドルを握るバイキングに焦点を当てたミディアムショットで、決意に満ちた表情のクローズアップが時折挿入される。
    
    
      
        
      
    
  
  
    カメラトラックが左に移動しながら撮影したドキュメンタリー風の自然写真で、カニが素早く穴に潜り込む様子を捉えています。カニは硬い緑がかった茶色の甲羅と長いハサミを持ち、砂地を決意に満ちた速さで移動しています。砂に潜り込む際に体はわずかに弓なりに反り、小さな足跡を残しています。背景には、岩や貝殻が散らばった浅い浜辺が広がり、地平線には海岸線の穏やかな曲線が見えます。写真には自然でリアルな質感があり、カニの自然な動きと砂の質感を強調しています。やや高めのアングルからのクローズアップショットです。
    
    
      
        
      
    
  

## Image-to-Videoのデモ

  
    画像プロンプト 生成された動画
  
  
    
    雲行きが怪しい空の下、田舎道を疾走する洗練された赤いKiaの車。周囲の畑や木々が遠くまで連なり、そのぼやけた動きが、モダンなデザインとダイナミックな動きを際立たせています。車の光沢のある外装は曇天を映し出し、エアロダイナミックな形状とスポーティなスタンスを強調しています。ナンバープレートには「KIA 626」と書かれており、ヘッドライトが点灯していることで、動きとエネルギーの感覚がさらに高まっています。道はゆるやかにカーブしており、車は少しオフセンターに配置されることで、前進する勢いが感じられます。力強い存在感を持つ車は、起伏のある丘と点在する木々という静かな背景を映し出す、ダイナミックなフロント3/4ビューで捉えられています。
    
    
      
        
      
    
  
  
    
    アップクロースで、鮮やかな緑の瞳と白いヒゲを持つふわふわのオレンジ色の猫が、カメラをじっと見つめています。猫の毛は柔らかく手入れが行き届いており、温かみのあるオレンジ色とクリーム色のトーンが混ざり合っています。大きく表現力豊かな瞳は鮮やかな緑色で、好奇心と警戒心が反映されています。猫の鼻は小さくピンク色で、口はわずかに開き、ピンク色の舌の先がうっすらと見えます。背景は柔らかくぼやけており、ニュートラルなトーンの落ち着いた室内環境を思わせます。写真は浅い被写界深度で、猫の顔にシャープに焦点を合わせ、背景はボケています。やや上からのアングルでのアップクロースショットです。
    
    
      
        
      
    
  

## インタラクティブ・ビデオのショーケース

  
    プロンプトから生成された動画
  
  
    プロンプトはこちらで確認できます。
    
      
        
      
    
  
  
    プロンプトはこちらで確認できます。
    
      
        
      
    
  

## リソース

以下のリソースで、Heliosについて詳しく学んでください。
- Heliosの主要機能のデモについては、[video1](https://www.youtube.com/watch?v=vd_AgHtOUFQ)と[video2](https://www.youtube.com/watch?v=1GeIU2Dn7UY)をご覧ください。
- 詳細については、研究論文 [Helios: Real Real-Time Long Video Generation Model](https://huggingface.co/papers/2603.04379) を参照してください。

## HeliosPipeline[[diffusers.HeliosPipeline]]

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

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

[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios.py#L108)

**パラメータ:**

tokenizer (`T5Tokenizer`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5Tokenizer)のTokenizer、具体的には[google/umt5-xxl](https://huggingface.co/google/umt5-xxl)バリアントです。

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel)、具体的には [google/umt5-xxl](https://huggingface.co/google/umt5-xxl) バリアントです。

transformer ([HeliosTransformer3DModel](/docs/diffusers/main/ja/api/models/helios_transformer3d#diffusers.HeliosTransformer3DModel)) : 入力潜在変数をデノイズするための条件付き Transformer。

scheduler ([HeliosScheduler](/docs/diffusers/main/ja/api/schedulers/helios#diffusers.HeliosScheduler)) : `transformer`と組み合わせて、エンコードされた画像の潜在変数をデノイズするために使用するスケジューラ。

vae ([AutoencoderKLWan](/docs/diffusers/main/ja/api/models/autoencoder_kl_wan#diffusers.AutoencoderKLWan)) : 動画を潜在表現にエンコードし、潜在表現からデコードするための変分オートエンコーダ（VAE）モデル。

Helios を使用したテキストから動画へ / 画像から動画へ / 動画から動画への生成を行う Pipeline です。

このモデルは [DiffusionPipeline](/docs/diffusers/main/ja/api/pipelines/overview#diffusers.DiffusionPipeline) を継承しています。すべてのパイプラインに実装されている汎用的なメソッド（ダウンロード、保存、特定のデバイスでの実行など）については、スーパークラスのドキュメントを参照してください。

#### __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 = 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 = ['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)
```

[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios.py#L445)

**パラメータ:**

prompt (`str` または `list[str]`、*任意*) : 画像生成をガイドするためのプロンプトまたはプロンプトのリストです。定義されていない場合は、代わりに `prompt_embeds` を渡してください。

negative_prompt (`str` または `list[str]`、*省略可能*) : 画像生成時に回避するプロンプトです。未定義の場合は、代わりに `negative_prompt_embeds` を渡してください。guidance を使用していない場合（`guidance_scale` < `1`）は無視されます。

height (`int`、デフォルトは`384`) : 生成される画像のピクセル単位の縦幅。

width (`int`、デフォルトは`640`) : 生成される画像の幅（ピクセル単位）。

num_frames (`int`、デフォルトは`132`) : 生成される動画のフレーム数。

num_inference_steps (`int`、デフォルトは`50`) : デノイジングのステップ数です。デノイジングのステップ数を増やすと、推論速度が遅くなる代わりに、通常はより高品質な画像が得られます。

sigmas (`list[float]`, *任意*) : 去噪プロセスで使用するためのカスタムシグマ。未定義の場合、スケジューラのデフォルトスケジュールが使用されます。

guidance_scale (`float`、デフォルトは`5.0`) : [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598)で定義されるガイダンススケール。`guidance_scale`は、[Imagen Paper](https://huggingface.co/papers/2205.11487)の式2の`w`として定義されます。`guidance_scale > 1`を設定することで、ガイダンススケールが有効になります。ガイダンススケールを高くすると、`prompt`のテキストと密接に関連する画像の生成が促されますが、通常は画像の品質が低下する傾向があります。

num_videos_per_prompt (`int`、*任意*、デフォルトは 1) : プロンプトごとに生成する画像の数。

generator (`torch.Generator` または `list[torch.Generator]`、*任意*) : 生成を決定論的にするための [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html)。

latents (`torch.Tensor`, *任意*) : 画像生成の入力として使用される、ガウス分布からサンプリングされた事前生成されたノイジー・ラテンツ。異なるプロンプトで同じ生成を調整するために使用できます。指定されない場合、指定されたランダム`generator`を使用してサンプリングを行い、ラテンツのテンソルが生成されます。

prompt_embeds (`torch.Tensor`, *任意*) : 事前に生成されたテキスト埋め込み。テキスト入力（プロンプトの重み付け）を簡単に調整するために使用できます。指定されない場合、`prompt` 入力引数からテキスト埋め込みが生成されます。

negative_prompt_embeds (`torch.Tensor`, *任意*) : 事前に生成されたネガティブテキストの埋め込み。指定されない場合、`negative_prompt`から生成されます。

output_type (`str`、*任意*、デフォルトは`"np"`) : 生成された画像の出力形式。`PIL.Image`または`np.array`から選択します。

return_dict (`bool`、*任意*、デフォルトは`True`) : プレーンなタプルではなく`HeliosPipelineOutput`を返すかどうか。

attention_kwargs (`dict`, *任意*) : 指定された場合、[diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py) の `self.processor` で定義されている `AttentionProcessor` に渡される kwargs の辞書です。

callback_on_step_end (`Callable`、`PipelineCallback`、`MultiPipelineCallbacks`、*任意*) : 推論中の各デノイジングステップの終了時に呼び出される関数、または `PipelineCallback` または `MultiPipelineCallbacks` のサブクラスです。以下の引数を持ちます: `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`, *任意*) : `callback_on_step_end` 関数へのテンソル入力のリストです。リストで指定されたテンソルは、`callback_kwargs` 引数として渡されます。パイプラインクラスの `._callback_tensor_inputs` 属性に列挙された変数のみを、リストに含めることができます。

max_sequence_length (`int`、デフォルトは`512`) : テキストエンコーダーの最大シーケンス長です。プロンプトがこの長さより長い場合は切り捨てられ、短い場合はこの長さにパディングされます。

image (`PipelineImageInput`、*任意*) : 画像から動画への条件付けに使用される入力画像。

image_latents (`torch.Tensor`, *任意*) : `image`の代わりに使用する、事前エンコード済みの画像潜在変数。

fake_image_latents (`torch.Tensor`, *任意*) : 条件付けの間に使用される、任意のフェイクな画像潜在変数。

add_noise_to_image_latents (`bool`、*任意*、デフォルトは`True`) : デノイジングの前に、画像の潜在変数にノイズを追加するかどうか。

image_noise_sigma_min (`float`、*任意*、デフォルトは `0.111`) : 画像の潜在変数に追加されるノイズの最小 sigma 値。

image_noise_sigma_max (`float`、*任意*、デフォルトは `0.135`) : 画像の潜在変数に追加されるノイズの最大 sigma 値。

video (`PipelineImageInput`、*任意*) : video-to-video の条件付けに使用する入力動画。

video_latents (`torch.Tensor`, *任意*) : `video` の代わりに使用する、事前エンコード済みの動画潜在変数。

add_noise_to_video_latents (`bool`、*任意*、デフォルトは`True`) : デノイジングの前に、動画の潜在変数にノイズを追加するかどうか。

video_noise_sigma_min (`float`、*任意*、デフォルトは `0.111`) : 動画の潜在変数に追加されるノイズの最小 sigma 値。

video_noise_sigma_max (`float`、*任意*、デフォルトは `0.135`) : 動画の潜在変数に追加されるノイズの最大 sigma 値。

history_sizes (`list`、*任意*、デフォルトは`[16, 2, 1]`) : 自己回帰型チャンク生成に使用される履歴ウィンドウサイズ。

num_latent_frames_per_chunk (`int`、*任意*、デフォルトは`9`) : 自己回帰生成時に、チャンクごとに生成される潜在フレームの数。

keep_first_frame (`bool`, *任意*, デフォルトは `True`) : チャンク間で最初のフレームを保持するかどうか。

is_skip_first_chunk (`bool`、*任意*、デフォルトは`False`) : 最初のチャンクの生成をスキップするかどうか。

**戻り値:** `~HeliosPipelineOutput` または `tuple`

`return_dict` が `True` の場合、`HeliosPipelineOutput` が返され、それ以外の場合は `tuple` が返されます。この `tuple` の最初の要素は生成された画像のリストであり、2番目の要素は、対応する生成画像に「not-safe-for-work」（nsfw）コンテンツが含まれているかどうかを示す `bool` のリストです。

生成用の pipeline への呼び出し関数。

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

[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios.py#L196)

**パラメータ:**

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`、*optional*、デフォルトは 1) : 各プロンプトに対して生成すべき動画の数。結果の埋め込みを配置する torch デバイス

prompt_embeds (`torch.Tensor`, *任意*) : 事前生成されたテキスト埋め込み。テキスト入力の調整、*例えば*プロンプトの重み付けなどを容易に行うために使用できます。指定されない場合、`prompt` 入力引数からテキスト埋め込みが生成されます。

negative_prompt_embeds (`torch.Tensor`, *任意*) : 事前に生成されたネガティブなテキスト埋め込み。テキスト入力の調整、*例えば*プロンプトの重み付けなどを容易に行うために使用できます。指定されない場合、`negative_prompt` 入力引数から negative_prompt_embeds が生成されます。

device : (`torch.device`, *任意*): torch デバイス

dtype : (`torch.dtype`, *任意*): torch dtype

プロンプトをテキストエンコーダーの隠れ状態にエンコードします。

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

[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py#L121)

**パラメータ:**

tokenizer (`T5Tokenizer`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5Tokenizer)のTokenizer、具体的には[google/umt5-xxl](https://huggingface.co/google/umt5-xxl)バリアントです。

text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel)、具体的には [google/umt5-xxl](https://huggingface.co/google/umt5-xxl) バリアントです。

transformer ([HeliosTransformer3DModel](/docs/diffusers/main/ja/api/models/helios_transformer3d#diffusers.HeliosTransformer3DModel)) : 入力潜在変数をデノイズするための条件付き Transformer。

scheduler ([`HeliosScheduler`, `HeliosDMDScheduler`]) : `transformer` と組み合わせて、エンコードされた画像の潜在変数をデノイズするために使用するスケジューラ。

vae ([AutoencoderKLWan](/docs/diffusers/main/ja/api/models/autoencoder_kl_wan#diffusers.AutoencoderKLWan)) : 動画を潜在表現にエンコードし、潜在表現からデコードするための変分オートエンコーダ（VAE）モデル。

Helios を使用したテキストから動画へ / 画像から動画へ / 動画から動画への生成を行う Pipeline です。

このモデルは [DiffusionPipeline](/docs/diffusers/main/ja/api/pipelines/overview#diffusers.DiffusionPipeline) を継承しています。すべてのパイプラインに実装されている汎用的なメソッド（ダウンロード、保存、特定のデバイスでの実行など）については、スーパークラスのドキュメントを参照してください。

#### __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 = 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 = ['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)
```

[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py#L508)

**パラメータ:**

prompt (`str` または `list[str]`、*任意*) : 画像生成をガイドするためのプロンプトまたはプロンプトのリストです。定義されていない場合は、代わりに `prompt_embeds` を渡してください。

negative_prompt (`str` または `list[str]`、*省略可能*) : 画像生成時に回避するプロンプトです。未定義の場合は、代わりに `negative_prompt_embeds` を渡してください。guidance を使用していない場合（`guidance_scale` < `1`）は無視されます。

height (`int`、デフォルトは`384`) : 生成される画像のピクセル単位の縦幅。

width (`int`、デフォルトは`640`) : 生成される画像の幅（ピクセル単位）。

num_frames (`int`、デフォルトは`132`) : 生成される動画のフレーム数。

sigmas (`list[float]`, *任意*) : 去噪プロセスで使用するためのカスタムシグマ。未定義の場合、スケジューラのデフォルトスケジュールが使用されます。

guidance_scale (`float`、デフォルトは`5.0`) : [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598)で定義されるガイダンススケール。`guidance_scale`は、[Imagen Paper](https://huggingface.co/papers/2205.11487)の式2の`w`として定義されます。`guidance_scale > 1`を設定することで、ガイダンススケールが有効になります。ガイダンススケールを高くすると、`prompt`のテキストと密接に関連する画像の生成が促されますが、通常は画像の品質が低下する傾向があります。

num_videos_per_prompt (`int`、*任意*、デフォルトは 1) : プロンプトごとに生成する画像の数。

generator (`torch.Generator` または `list[torch.Generator]`、*任意*) : 生成を決定論的にするための [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html)。

latents (`torch.Tensor`, *任意*) : 画像生成の入力として使用される、ガウス分布からサンプリングされた事前生成されたノイジー・ラテンツ。異なるプロンプトで同じ生成を調整するために使用できます。指定されない場合、指定されたランダム`generator`を使用してサンプリングを行い、ラテンツのテンソルが生成されます。

prompt_embeds (`torch.Tensor`, *任意*) : 事前に生成されたテキスト埋め込み。テキスト入力（プロンプトの重み付け）を簡単に調整するために使用できます。指定されない場合、`prompt` 入力引数からテキスト埋め込みが生成されます。

negative_prompt_embeds (`torch.Tensor`, *任意*) : 事前に生成されたネガティブテキストの埋め込み。指定されない場合、`negative_prompt`から生成されます。

output_type (`str`、*任意*、デフォルトは`"np"`) : 生成された画像の出力形式。`PIL.Image`または`np.array`から選択します。

return_dict (`bool`、*任意*、デフォルトは`True`) : プレーンなタプルではなく`HeliosPipelineOutput`を返すかどうか。

attention_kwargs (`dict`, *任意*) : 指定された場合、[diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py) の `self.processor` で定義されている `AttentionProcessor` に渡される kwargs の辞書です。

callback_on_step_end (`Callable`、`PipelineCallback`、`MultiPipelineCallbacks`、*任意*) : 推論中の各デノイジングステップの終了時に呼び出される関数、または `PipelineCallback` または `MultiPipelineCallbacks` のサブクラスです。以下の引数を持ちます: `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`, *任意*) : `callback_on_step_end` 関数へのテンソル入力のリストです。リストで指定されたテンソルは、`callback_kwargs` 引数として渡されます。パイプラインクラスの `._callback_tensor_inputs` 属性に列挙された変数のみを、リストに含めることができます。

max_sequence_length (`int`、デフォルトは`512`) : テキストエンコーダーの最大シーケンス長です。プロンプトがこの長さより長い場合は切り捨てられ、短い場合はこの長さにパディングされます。

image (`PipelineImageInput`、*任意*) : 画像から動画への条件付けに使用される入力画像。

image_latents (`torch.Tensor`, *任意*) : `image`の代わりに使用する、事前エンコード済みの画像潜在変数。

fake_image_latents (`torch.Tensor`, *任意*) : 条件付けの間に使用される、任意のフェイクな画像潜在変数。

add_noise_to_image_latents (`bool`、*任意*、デフォルトは`True`) : デノイジングの前に、画像の潜在変数にノイズを追加するかどうか。

image_noise_sigma_min (`float`、*任意*、デフォルトは `0.111`) : 画像の潜在変数に追加されるノイズの最小 sigma 値。

image_noise_sigma_max (`float`、*任意*、デフォルトは `0.135`) : 画像の潜在変数に追加されるノイズの最大 sigma 値。

video (`PipelineImageInput`、*任意*) : video-to-video の条件付けに使用する入力動画。

video_latents (`torch.Tensor`, *任意*) : `video` の代わりに使用する、事前エンコード済みの動画潜在変数。

add_noise_to_video_latents (`bool`、*任意*、デフォルトは`True`) : デノイジングの前に、動画の潜在変数にノイズを追加するかどうか。

video_noise_sigma_min (`float`、*任意*、デフォルトは `0.111`) : 動画の潜在変数に追加されるノイズの最小 sigma 値。

video_noise_sigma_max (`float`、*任意*、デフォルトは `0.135`) : 動画の潜在変数に追加されるノイズの最大 sigma 値。

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]`) : Stage 2 生成時の、各ピラミッドステージにおける推論ステップ数。

use_zero_init (`bool`、*任意*、デフォルトは`True`) : デノイジングの開始時にCFG zero-initを適用するかどうか。

zero_steps (`int`、*任意*、デフォルトは`1`) : CFG zero-init を使用する初期ステップ数。

is_amplify_first_chunk (`bool`、*任意*、デフォルトは`False`) : 最初のチャンクでガイダンスを増幅するかどうか（DMD関連）。

**戻り値:** `~HeliosPipelineOutput` または `tuple`

`return_dict` が `True` の場合、`HeliosPipelineOutput` が返され、それ以外の場合は `tuple` が返されます。この `tuple` の最初の要素は生成された画像のリストであり、2番目の要素は、対応する生成画像に「not-safe-for-work」（nsfw）コンテンツが含まれているかどうかを示す `bool` のリストです。

生成用の pipeline への呼び出し関数。

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

[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py#L214)

**パラメータ:**

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`、*optional*、デフォルトは 1) : 各プロンプトに対して生成すべき動画の数。結果の埋め込みを配置する torch デバイス

prompt_embeds (`torch.Tensor`, *任意*) : 事前生成されたテキスト埋め込み。テキスト入力の調整、*例えば*プロンプトの重み付けなどを容易に行うために使用できます。指定されない場合、`prompt` 入力引数からテキスト埋め込みが生成されます。

negative_prompt_embeds (`torch.Tensor`, *任意*) : 事前に生成されたネガティブなテキスト埋め込み。テキスト入力の調整、*例えば*プロンプトの重み付けなどを容易に行うために使用できます。指定されない場合、`negative_prompt` 入力引数から negative_prompt_embeds が生成されます。

device : (`torch.device`, *任意*): torch デバイス

dtype : (`torch.dtype`, *任意*): torch dtype

プロンプトをテキストエンコーダーの隠れ状態にエンコードします。

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

[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_output.py#L9)

**パラメータ:**

frames (`torch.Tensor`, `np.ndarray`, or List[List[PIL.Image.Image]]) : List of video outputs - It can be a nested list of length `batch_size,` with each sub-list containing denoised PIL image sequences of length `num_frames.` It can also be a NumPy array or Torch tensor of shape `(batch_size, num_frames, channels, height, width)`.

Helios パイプライン用の出力クラスです。

