Buckets:

mishig's picture
|
download
raw
55.9 kB
#
# Apache Lisansı, 2.0 Sürümü ("Lisans") altında lisanslanmıştır;
# bu dosyayı, Lisansa uygun olarak kullanabilirsiniz.
# Lisansın bir kopyasını şu adresten edinebilirsiniz
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Uygulanabilir yasa gerektirmedikçe veya yazılı olarak anlaşılmadıkça, yazılım
# Lisans kapsamında dağıtılan, "OLDUĞU GİBİ" esasına göre dağıtılır,
# HİÇBİR TÜR AÇIK VEYA ZIMMİ GARANTİ VEYA ŞART İÇERMEZ.
# İzinleri ve
# lisans kapsamındaki kısıtlamalar. -->
# Helios
Pekin Üniversitesi & ByteDance & vb. tarafından Shenghai Yuan, Yuanyang Yin, Zongjian Li, Xinwei Huang, Xiao Yang, Li Yuan'ın [Helios: Gerçek Gerçek-Zamanlı Uzun Video Üretimi Modeli](https://huggingface.co/papers/2603.04379)'i.
* Helios'u tanıtıyoruz; bu, tek bir NVIDIA H100 GPU üzerinde 17 FPS hızında çalışan ve kalitede güçlü bir taban çizgisini (baseline) eşitlerken dakika ölçeğinde üretim destekleyen ilk 14B video üretim modelidir. Üç temel boyutta ilerleme kaydediyoruz: (1) self-forcing, hata bankaları (error banks) veya anahtar kare örnekleme gibi yaygın kullanılan anti-drift sezgiselleri olmadan uzun video sürüklenmesine (drifting) karşı sağlamlık; (2) KV-cache, nedensel maskeleme (causal masking) veya seyrek dikkat (sparse attention) gibi standart hızlandırma teknikleri olmadan gerçek zamanlı üretim; ve (3) paralellik veya dilimleme (sharding) çerçeveleri olmadan eğitim, bu sayede 80 GB GPU belleğine kadar dört 14B model sığdırılırken görüntü-diffusion ölçeğinde toplu işlem (batch) boyutlarını mümkün kılma. Özellikle, Helios; T2V, I2V ve V2V görevlerini yerel olarak destekleyen, birleşik bir girdi temsiline sahip 14B otoregresif diffusion modelidir. Uzun video üretimindeki sürüklenmeyi azaltmak için tipik başarısızlık modlarını karakterize ediyor ve eğitim sırasında sürüklenmeyi açıkça simüle eden, tekrarlayan hareketi kaynağında ortadan kaldıran basit ama etkili eğitim stratejileri öneriyoruz. Verimlilik için, geçmiş ve gürültülü bağlamı yoğun şekilde sıkıştırıyor ve örneklem adım sayısını azaltıyoruz; bu, 1.3B video üretici modellerininkine eşit veya daha düşük hesaplama maliyetleri sağlıyor. Ayrıca, hem çıkarımı (inference) hem de eğitimi hızlandırırken bellek tüketimini azaltan altyapı düzeyinde optimizasyonlar sunuyoruz. Kapsamlı deneyler, Helios'un hem kısa hem de uzun video üretiminde önceki yöntemleri tutarlı bir şekilde geride bıraktığını göstermektedir. Tüm kod ve modeller [bu https URL](https://pku-yuangroup.github.io/Helios-Page) adresinde mevcuttur.
Diffusers'da aşağıdaki Helios modelleri desteklenmektedir:
- [Helios-Base](https://huggingface.co/BestWishYsh/Helios-Base): v-prediction, standart CFG ve özel HeliosScheduler ile en yüksek kalite.
- [Helios-Mid](https://huggingface.co/BestWishYsh/Helios-Mid): Ara Ağırlık, v-prediction, CFG-Zero* ve özel HeliosScheduler ile.
- [Helios-Distilled](https://huggingface.co/BestWishYsh/Helios-Distilled): x0-prediction ve özel HeliosDMDScheduler ile en iyi verimlilik.
> [!TIP]
> Daha fazla video üretimi örneği için sağ kenar çubuğundaki Helios modellerine tıklayın.
### Bellek ve Çıkarım Hızını Optimize Etme
Aşağıdaki örnek, bellek veya çıkarım hızı için optimize edilmiş metinden video üretiminin nasıl yapılacağını gösterir.
Çeşitli bellek tasarrufu teknikleri hakkında daha fazla ayrıntı için [Bellek kullanımını azaltma](../../optimization/memory) kılavuzuna bakın.
Aşağıdaki Helios modeli ~6GB VRAM gerektirir.
```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)
```
[Derleme](../../optimization/fp16#torchcompile) ilk seferde yavaştır ancak pipeline'a yapılan sonraki çağrılar daha hızlıdır. FlashAttention ve SageAttention gibi [Dikkat Arka Uçları](../../optimization/attention_backends), dikkat mekanizmasının hesaplamasını optimize ederek hızı önemli ölçüde artırabilir. [Bağlam Paralelliği](../../training/distributed_inference#context-parallelism), girdi dizisini birden fazla cihaz arasında bölerek uzun bağlamların paralel olarak işlenmesini sağlar ve bellek baskısını ile gecikmeyi azaltır. [Önbellekleme](../../optimization/cache), ara çıktıları saklayıp yeniden kullanarak çıkarımı hızlandırabilir.
```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 ile Üretim
Aşağıdaki örnek, Helios-Base'in metin, görüntü veya videoya dayalı video üretmek için nasıl kullanılacağını göstermektedir.
```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 ile Üretim
Aşağıdaki örnek, metin, görüntü veya videoya dayalı video üretmek için Helios-Mid'in nasıl kullanılacağını göstermektedir.
```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 ile Üretim
Aşağıdaki örnek, metin, görüntü veya videoya dayalı video üretmek için Helios-Distilled'in nasıl kullanılacağını göstermektedir.
```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)
```
## Metinden Videoya Örnekleri
Prompt ile Oluşturulan Video
Modern bir şehir otobüsünü, yolcularla dolu olarak sürmeye çalışan bir Viking savaşçısı. Viking'in geriye toplanmış uzun sarı saçları, sakalı, kürk kaplı bir kask ve zırhı var. Geleneksel bir tunik ve pantolon giyiyor, ancak yoğun sokaklarda ilerlemeye odaklanırken bir emniyet kemeri de takıyor. Otobüsün içi tipik; koltuk sıraları, günlük rutinlerine devam eden çeşitli yolcularla dolu. Dış çekimler, yüksek binalar ve trafiği içeren hareketli şehir ortamını gösteriyor. Direksiyon başındaki Viking'e odaklanan orta plan, ara sıra kararlı ifadesine yakın çekimler eşlik ediyor.
Kameranın sol hareketiyle çekilen, belgesel tarzında bir doğa fotoğrafı; bir yengecin yuvasına hızla kaçışını yakalıyor. Yengecin sert, yeşilimsi kahverengi bir kabuğu ve uzun pençeleri var; kumlu zeminde kararlı bir hızla ilerliyor. Kumun içine gömülürken gövdesi hafifçe kavisli ve arkasında küçük bir iz bırakıyor. Arka planda, dağınık kayalar ve deniz kabuklarıyla dolu sığ bir plaj ile ufukta kıyı şeridinin nazik bir eğrisi görülüyor. Fotoğraf, doğal ve gerçekçi bir dokuya sahip; yengecin doğal hareketini ve kumun dokusunu vurguluyor. Hafif yukarıdan bir açıyla çekilmiş yakın plan bir görüntü.
## Görüntüden Videoya Örnekleri
Görsel İfadesi Üretilen Video
Şık kırmızı bir Kia otomobili, bulutlu bir gökyüzü altında kırsal bir yolda hızla ilerlerken, etrafındaki tarlaların ve uzaklara uzanan ağaçların bulanık hareketi aracın modern tasarımını ve dinamik hareketini vurgular. Aracın parlak dış yüzeyi kapalı gökyüzünü yansıtarak aerodinamik formunu ve sportif duruşunu ön plana çıkarır. Plakada "KIA 626" yazar ve aracın farları yanık olup hareket ve enerji hissine katkıda bulunur. Yol nazikçe kıvrılır ve aracın hafifçe merkezden sapmış konumu, ileriye doğru bir ivme hissi yaratır. Dinamik bir ön üçte-dört görünüm, aracın güçlü varlığını yuvarlak tepelerin ve dağınık ağaçların sakin arka planına karşı yakalar.
Yakın çekim, dikkat çekici yeşil gözleri ve beyaz bıyıklarıyla yumuşacık turuncu bir kedi yakalar; kedi kameraya dikkatle bakmaktadır. Kedinin tüyleri yumuşak ve bakımlıdır; sıcak turuncu ve krem tonlarının bir karışımını oluşturur. Büyük, ifade dolu gözleri canlı bir yeşildir; merakı ve uyanıklığını yansıtır. Kedinin burnu küçük ve pembe, ağzı ise hafifçe açıktır; pembe dilinin bir kısmı görünmektedir. Arka plan yumuşak bir şekilde bulanıktır; nötr tonlara sahip, rahat bir iç mekan ortamını çağrıştırır. Fotoğrafın sığ bir derinlik alanı vardır; kedinin yüzü keskin bir şekilde odaklanırken arka plan bulanık kalır. Biraz yukarıdan alınmış yakın çekim bir kare.
## Etkileşimli Video Tanıtımları
Prompt ile Oluşturulan Video
İstem buradan bulunabilir
İstem buradan bulunabilir
## Kaynaklar
Helios hakkında aşağıdaki kaynaklarla daha fazla bilgi edinin.
- Helios'un temel özelliklerinin bir gösterimi için [video1](https://www.youtube.com/watch?v=vd_AgHtOUFQ) ve [video2](https://www.youtube.com/watch?v=1GeIU2Dn7UY) videolarını izleyin.
- Daha fazla ayrıntı için araştırma makalesi: [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)
```
[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios.py#L108)
**Parametreler:**
tokenizer (`T5Tokenizer`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5Tokenizer)'den gelen tokenizer, özellikle [google/umt5-xxl](https://huggingface.co/google/umt5-xxl) varyantı.
text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel), özellikle [google/umt5-xxl](https://huggingface.co/google/umt5-xxl) varyantı.
transformer ([HeliosTransformer3DModel](/docs/diffusers/main/tr/api/models/helios_transformer3d#diffusers.HeliosTransformer3DModel)) : Girdi latentlerini gürültüden arındırmak için kullanılan koşullu Transformer.
scheduler ([HeliosScheduler](/docs/diffusers/main/tr/api/schedulers/helios#diffusers.HeliosScheduler)) : Kodlanmış görüntü latentlerini gürültüden arındırmak için `transformer` ile birlikte kullanılacak bir zamanlayıcı.
vae ([AutoencoderKLWan](/docs/diffusers/main/tr/api/models/autoencoder_kl_wan#diffusers.AutoencoderKLWan)) : Video'ları latent temsillere kodlamak ve latent temsillerden video'lara çözmek için kullanılan Varyasyonel Oto-Kodlayıcı (VAE) Modeli.
Helios kullanılarak metinden videoya / görüntüden videoya / videodan videoya üretim için Pipeline.
Bu model [DiffusionPipeline](/docs/diffusers/main/tr/api/pipelines/overview#diffusers.DiffusionPipeline) sınıfından devralınmıştır. Tüm pipeline'lar için uygulanan genel yöntemlerin (indirme, kaydetme, belirli bir cihazda çalıştırma vb.) belgelerini üst sınıfın dokümantasyonunda bulabilirsiniz.
#### __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)
```
[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios.py#L445)
**Parametreler:**
prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmek için istem veya istemler. Tanımlanmadıysa bunun yerine `prompt_embeds` geçirin.
negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretim sırasında kaçınılması gereken istem veya istemler. Tanımlanmamışsa bunun yerine `negative_prompt_embeds` geçirin. Rehberlik kullanılmadığında (`guidance_scale` < `1`) yok sayılır.
height (`int`, varsayılan `384`) : Üretilen görüntünün piksel cinsinden yüksekliği.
width (`int`, varsayılan `640`) : Üretilen görüntünün piksel cinsinden genişliği.
num_frames (`int`, varsayılan `132`) : Üretilen videodaki kare sayısı.
num_inference_steps (`int`, varsayılan `50`) : Gürültü azaltma adım sayısı. Daha fazla gürültü azaltma adımı, genellikle daha yavaş çıkarım pahasına daha yüksek kaliteli bir görüntüye yol açar.
sigmas (`list[float]`, *isteğe bağlı*) : Gürültü azaltma süreci için kullanılacak özel sigmalar. Tanımlanmamışsa, zamanlayıcının varsayılan zamanlaması kullanılır.
guidance_scale (`float`, varsayılan `5.0`) : [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598)'de tanımlanan yönlendirme ölçeği. `guidance_scale`, [Imagen Paper](https://huggingface.co/papers/2205.11487)'deki 2. denklemindeki `w` olarak tanımlanır. Yönlendirme ölçeği, `guidance_scale > 1` olarak ayarlanarak etkinleştirilir. Daha yüksek yönlendirme ölçeği, genellikle daha düşük görüntü kalitesi pahasına, `prompt` ile yakından ilişkili görüntülerin üretilmesini teşvik eder.
num_videos_per_prompt (`int`, *isteğe bağlı*, varsayılan 1) : Her istem için üretilecek görsel sayısı.
generator (`torch.Generator` veya `list[torch.Generator]`, *isteğe bağlı*) : Üretimi deterministik hale getirmek için bir [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html).
latents (`torch.Tensor`, *isteğe bağlı*) : Görsel üretimi için girdi olarak kullanılacak, Gauss dağılımından örneklenen önceden oluşturulmuş gürültülü latensler. Farklı istemlerle aynı üretimi ayarlamak için kullanılabilir. Sağlanmazsa, sağlanan rastgele `generator` kullanılarak örneklem yoluyla bir latens tensörü oluşturulur.
prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş metin gömme değerleri. Metin girdilerini (istek ağırlıklandırması) kolayca ayarlamak için kullanılabilir. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından üretilir.
negative_prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş negatif metin gömme değerleri. Sağlanmazsa, `negative_prompt` üzerinden üretilirler.
output_type (`str`, *isteğe bağlı*, varsayılan `"np"`) : Üretilen görüntünün çıktı biçimi. `PIL.Image` veya `np.array` arasında seçim yapın.
return_dict (`bool`, *isteğe bağlı*, varsayılan `True`) : Düz bir tuple yerine `HeliosPipelineOutput` döndürülüp döndürülmediğini belirtir.
attention_kwargs (`dict`, *isteğe bağlı*) : Belirtilirse, [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py) içinde `self.processor` altında tanımlanan `AttentionProcessor`'a iletilen bir kwargs sözlüğü.
callback_on_step_end (`Callable`, `PipelineCallback`, `MultiPipelineCallbacks`, *opsiyonel*) : Çıkarım sırasında her gürültü azaltma adımının sonunda çağrılan, `PipelineCallback` veya `MultiPipelineCallbacks` alt sınıfı olan bir fonksiyon. Aşağıdaki argümanlarla çağrılır: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. `callback_kwargs`, `callback_on_step_end_tensor_inputs` tarafından belirtildiği üzere tüm tensörlerin listesini içerecektir.
callback_on_step_end_tensor_inputs (`list`, *isteğe bağlı*) : `callback_on_step_end` işlevi için girdi tensörlerinin listesi. Listede belirtilen tensörler, `callback_kwargs` argümanı olarak geçirilir. Yalnızca pipeline sınıfınızın `._callback_tensor_inputs` özniteliğinde listelenen değişkenleri dahil edebilirsiniz.
max_sequence_length (`int`, varsayılan `512`) : Metin kodlayıcısının maksimum dizi uzunluğu. İfade bu uzunluktan uzunsa kısaltılır. İfade bu uzunluktan kısaysa bu uzunluğa kadar dolgu yapılır.
image (`PipelineImageInput`, *isteğe bağlı*) : Görüntüden videoya koşullandırmada kullanılan giriş görüntüsü.
image_latents (`torch.Tensor`, *isteğe bağlı*) : `image` yerine kullanılacak önceden kodlanmış görüntü latentleri.
fake_image_latents (`torch.Tensor`, *isteğe bağlı*) : Koşullandırma sırasında kullanılan isteğe bağlı sahte görüntü latentleri.
add_noise_to_image_latents (`bool`, *isteğe bağlı*, varsayılan `True`) : Gürültü azaltma işleminden önce görüntü latentlerine gürültü eklenip eklenmeyeceğini belirtir.
image_noise_sigma_min (`float`, *opsiyonel*, varsayılan `0.111`) : Görüntü latentlerine eklenen gürültü için minimum sigma değeri.
image_noise_sigma_max (`float`, *opsiyonel*, varsayılan `0.135`) : Görüntü latentlerine eklenen gürültü için maksimum sigma değeri.
video (`PipelineImageInput`, *isteğe bağlı*) : Video-to-video koşullandırma için kullanılan giriş videosu.
video_latents (`torch.Tensor`, *isteğe bağlı*) : `video` yerine kullanılacak önceden kodlanmış video latentleri.
add_noise_to_video_latents (`bool`, *isteğe bağlı*, varsayılan `True`) : Gürültü azaltma işleminden önce video latentlerine gürültü eklenip eklenmeyeceğini belirtir.
video_noise_sigma_min (`float`, *opsiyonel*, varsayılan `0.111`) : Video latentlerine eklenen gürültü için minimum sigma değeri.
video_noise_sigma_max (`float`, *opsiyonel*, varsayılan `0.135`) : Video latentlerine eklenen gürültü için maksimum sigma değeri.
history_sizes (`list`, *isteğe bağlı*, varsayılan `[16, 2, 1]`) : Otoregresif parçalı üretimde kullanılan geçmiş pencere boyutları.
num_latent_frames_per_chunk (`int`, *isteğe bağlı*, varsayılan `9`) : Otoregresif üretim sırasında her parça için üretilen gizli kare sayısı.
keep_first_frame (`bool`, *isteğe bağlı*, varsayılan `True`) : Parçalar arasında ilk kareyi koruyup korumayacağı.
is_skip_first_chunk (`bool`, *isteğe bağlı*, varsayılan `False`) : İlk parçanın oluşturulmasının atlanıp atlanmayacağı.
**Dönüş:** `~HeliosPipelineOutput` veya `tuple`
`return_dict` `True` ise `HeliosPipelineOutput` döndürülür, aksi takdirde bir `tuple` döndürülür; bu yapının ilk öğesi üretilen görsellerin listesini, ikinci öğesi ise ilgili üretilen görselin "not-safe-for-work" (nsfw) içerip içermediğini gösteren `bool` değerlerinin listesini içerir.
Üretim için pipeline'ın çağrı fonksiyonu.
Örnekler:
```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)
```
[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios.py#L196)
**Parametreler:**
prompt (`str` veya `list[str]`, *isteğe bağlı*) : kodlanacak istem
negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmemek için kullanılan istem veya istemler. Tanımlanmazsa, bunun yerine `negative_prompt_embeds` parametresinin geçirilmesi gerekir. Yönlendirme kullanılmadığında (yani `guidance_scale` değeri `1`'den küçükse) yok sayılır.
do_classifier_free_guidance (`bool`, *isteğe bağlı*, varsayılan `True`) : Sınıflandırıcı serbest yönlendirmenin (classifier free guidance) kullanılıp kullanılmayacağı.
num_videos_per_prompt (`int`, *opsiyonel*, varsayılan 1) : Her istem için oluşturulması gereken video sayısı. Sonuç gömme vektörlerinin yerleştirileceği torch cihazı
prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından oluşturulur.
negative_prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş negatif metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, negative_prompt_embeds, `negative_prompt` girdi argümanından oluşturulur.
device : (`torch.device`, *isteğe bağlı*): torch cihazı
dtype : (`torch.dtype`, *isteğe bağlı*): torch dtype
İsteği metin kodlayıcı gizli durumlarına kodlar.
## 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)
```
[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py#L121)
**Parametreler:**
tokenizer (`T5Tokenizer`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5Tokenizer)'den gelen tokenizer, özellikle [google/umt5-xxl](https://huggingface.co/google/umt5-xxl) varyantı.
text_encoder (`T5EncoderModel`) : [T5](https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel), özellikle [google/umt5-xxl](https://huggingface.co/google/umt5-xxl) varyantı.
transformer ([HeliosTransformer3DModel](/docs/diffusers/main/tr/api/models/helios_transformer3d#diffusers.HeliosTransformer3DModel)) : Girdi latentlerini gürültüden arındırmak için kullanılan koşullu Transformer.
scheduler ([`HeliosScheduler`, `HeliosDMDScheduler`]) : Kodlanmış görüntü latentlerini gürültüden arındırmak için `transformer` ile birlikte kullanılacak bir zamanlayıcı.
vae ([AutoencoderKLWan](/docs/diffusers/main/tr/api/models/autoencoder_kl_wan#diffusers.AutoencoderKLWan)) : Video'ları latent temsillere kodlamak ve latent temsillerden video'lara çözmek için kullanılan Varyasyonel Oto-Kodlayıcı (VAE) Modeli.
Helios kullanılarak metinden videoya / görüntüden videoya / videodan videoya üretim için Pipeline.
Bu model [DiffusionPipeline](/docs/diffusers/main/tr/api/pipelines/overview#diffusers.DiffusionPipeline) sınıfından devralınmıştır. Tüm pipeline'lar için uygulanan genel yöntemlerin (indirme, kaydetme, belirli bir cihazda çalıştırma vb.) belgelerini üst sınıfın dokümantasyonunda bulabilirsiniz.
#### __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)
```
[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py#L508)
**Parametreler:**
prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmek için istem veya istemler. Tanımlanmadıysa bunun yerine `prompt_embeds` geçirin.
negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretim sırasında kaçınılması gereken istem veya istemler. Tanımlanmamışsa bunun yerine `negative_prompt_embeds` geçirin. Rehberlik kullanılmadığında (`guidance_scale` < `1`) yok sayılır.
height (`int`, varsayılan `384`) : Üretilen görüntünün piksel cinsinden yüksekliği.
width (`int`, varsayılan `640`) : Üretilen görüntünün piksel cinsinden genişliği.
num_frames (`int`, varsayılan `132`) : Üretilen videodaki kare sayısı.
sigmas (`list[float]`, *isteğe bağlı*) : Gürültü azaltma süreci için kullanılacak özel sigmalar. Tanımlanmamışsa, zamanlayıcının varsayılan zamanlaması kullanılır.
guidance_scale (`float`, varsayılan `5.0`) : [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598)'de tanımlanan yönlendirme ölçeği. `guidance_scale`, [Imagen Paper](https://huggingface.co/papers/2205.11487)'deki 2. denklemindeki `w` olarak tanımlanır. Yönlendirme ölçeği, `guidance_scale > 1` olarak ayarlanarak etkinleştirilir. Daha yüksek yönlendirme ölçeği, genellikle daha düşük görüntü kalitesi pahasına, `prompt` ile yakından ilişkili görüntülerin üretilmesini teşvik eder.
num_videos_per_prompt (`int`, *isteğe bağlı*, varsayılan 1) : Her istem için üretilecek görsel sayısı.
generator (`torch.Generator` veya `list[torch.Generator]`, *isteğe bağlı*) : Üretimi deterministik hale getirmek için bir [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html).
latents (`torch.Tensor`, *isteğe bağlı*) : Görsel üretimi için girdi olarak kullanılacak, Gauss dağılımından örneklenen önceden oluşturulmuş gürültülü latensler. Farklı istemlerle aynı üretimi ayarlamak için kullanılabilir. Sağlanmazsa, sağlanan rastgele `generator` kullanılarak örneklem yoluyla bir latens tensörü oluşturulur.
prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş metin gömme değerleri. Metin girdilerini (istek ağırlıklandırması) kolayca ayarlamak için kullanılabilir. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından üretilir.
negative_prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş negatif metin gömme değerleri. Sağlanmazsa, `negative_prompt` üzerinden üretilirler.
output_type (`str`, *isteğe bağlı*, varsayılan `"np"`) : Üretilen görüntünün çıktı biçimi. `PIL.Image` veya `np.array` arasında seçim yapın.
return_dict (`bool`, *isteğe bağlı*, varsayılan `True`) : Düz bir tuple yerine `HeliosPipelineOutput` döndürülüp döndürülmediğini belirtir.
attention_kwargs (`dict`, *isteğe bağlı*) : Belirtilirse, [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py) içinde `self.processor` altında tanımlanan `AttentionProcessor`'a iletilen bir kwargs sözlüğü.
callback_on_step_end (`Callable`, `PipelineCallback`, `MultiPipelineCallbacks`, *opsiyonel*) : Çıkarım sırasında her gürültü azaltma adımının sonunda çağrılan, `PipelineCallback` veya `MultiPipelineCallbacks` alt sınıfı olan bir fonksiyon. Aşağıdaki argümanlarla çağrılır: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. `callback_kwargs`, `callback_on_step_end_tensor_inputs` tarafından belirtildiği üzere tüm tensörlerin listesini içerecektir.
callback_on_step_end_tensor_inputs (`list`, *isteğe bağlı*) : `callback_on_step_end` işlevi için girdi tensörlerinin listesi. Listede belirtilen tensörler, `callback_kwargs` argümanı olarak geçirilir. Yalnızca pipeline sınıfınızın `._callback_tensor_inputs` özniteliğinde listelenen değişkenleri dahil edebilirsiniz.
max_sequence_length (`int`, varsayılan `512`) : Metin kodlayıcısının maksimum dizi uzunluğu. İfade bu uzunluktan uzunsa kısaltılır. İfade bu uzunluktan kısaysa bu uzunluğa kadar dolgu yapılır.
image (`PipelineImageInput`, *isteğe bağlı*) : Görüntüden videoya koşullandırmada kullanılan giriş görüntüsü.
image_latents (`torch.Tensor`, *isteğe bağlı*) : `image` yerine kullanılacak önceden kodlanmış görüntü latentleri.
fake_image_latents (`torch.Tensor`, *isteğe bağlı*) : Koşullandırma sırasında kullanılan isteğe bağlı sahte görüntü latentleri.
add_noise_to_image_latents (`bool`, *isteğe bağlı*, varsayılan `True`) : Gürültü azaltma işleminden önce görüntü latentlerine gürültü eklenip eklenmeyeceğini belirtir.
image_noise_sigma_min (`float`, *opsiyonel*, varsayılan `0.111`) : Görüntü latentlerine eklenen gürültü için minimum sigma değeri.
image_noise_sigma_max (`float`, *opsiyonel*, varsayılan `0.135`) : Görüntü latentlerine eklenen gürültü için maksimum sigma değeri.
video (`PipelineImageInput`, *isteğe bağlı*) : Video-to-video koşullandırma için kullanılan giriş videosu.
video_latents (`torch.Tensor`, *isteğe bağlı*) : `video` yerine kullanılacak önceden kodlanmış video latentleri.
add_noise_to_video_latents (`bool`, *isteğe bağlı*, varsayılan `True`) : Gürültü azaltma işleminden önce video latentlerine gürültü eklenip eklenmeyeceğini belirtir.
video_noise_sigma_min (`float`, *opsiyonel*, varsayılan `0.111`) : Video latentlerine eklenen gürültü için minimum sigma değeri.
video_noise_sigma_max (`float`, *opsiyonel*, varsayılan `0.135`) : Video latentlerine eklenen gürültü için maksimum sigma değeri.
history_sizes (`list`, *isteğe bağlı*, varsayılan `[16, 2, 1]`) : Otoregresif parçalı üretimde kullanılan geçmiş pencere boyutları.
num_latent_frames_per_chunk (`int`, *isteğe bağlı*, varsayılan `9`) : Otoregresif üretim sırasında her parça için üretilen gizli kare sayısı.
keep_first_frame (`bool`, *isteğe bağlı*, varsayılan `True`) : Parçalar arasında ilk kareyi koruyup korumayacağı.
is_skip_first_chunk (`bool`, *isteğe bağlı*, varsayılan `False`) : İlk parçanın oluşturulmasının atlanıp atlanmayacağı.
pyramid_num_inference_steps_list (`list`, *isteğe bağlı*, varsayılan `[10, 10, 10]`) : 2. aşama üretimi sırasında her piramit aşaması için çıkarım adım sayısı.
use_zero_init (`bool`, *isteğe bağlı*, varsayılan `True`) : Gürültüden arındırmanın başlangıcında CFG sıfır başlatmanın uygulanıp uygulanmayacağı.
zero_steps (`int`, *isteğe bağlı*, varsayılan `1`) : CFG zero-init kullanan başlangıç adımlarının sayısı.
is_amplify_first_chunk (`bool`, *isteğe bağlı*, varsayılan `False`) : İlk parçada yönlendirmenin (guidance) amplifiye edilip edilmeyeceğini belirtir (DMD ile ilgili).
**Dönüş:** `~HeliosPipelineOutput` veya `tuple`
`return_dict` `True` ise `HeliosPipelineOutput` döndürülür, aksi takdirde bir `tuple` döndürülür; bu yapının ilk öğesi üretilen görsellerin listesini, ikinci öğesi ise ilgili üretilen görselin "not-safe-for-work" (nsfw) içerip içermediğini gösteren `bool` değerlerinin listesini içerir.
Üretim için pipeline'ın çağrı fonksiyonu.
Örnekler:
```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)
```
[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py#L214)
**Parametreler:**
prompt (`str` veya `list[str]`, *isteğe bağlı*) : kodlanacak istem
negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmemek için kullanılan istem veya istemler. Tanımlanmazsa, bunun yerine `negative_prompt_embeds` parametresinin geçirilmesi gerekir. Yönlendirme kullanılmadığında (yani `guidance_scale` değeri `1`'den küçükse) yok sayılır.
do_classifier_free_guidance (`bool`, *isteğe bağlı*, varsayılan `True`) : Sınıflandırıcı serbest yönlendirmenin (classifier free guidance) kullanılıp kullanılmayacağı.
num_videos_per_prompt (`int`, *opsiyonel*, varsayılan 1) : Her istem için oluşturulması gereken video sayısı. Sonuç gömme vektörlerinin yerleştirileceği torch cihazı
prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından oluşturulur.
negative_prompt_embeds (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş negatif metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, negative_prompt_embeds, `negative_prompt` girdi argümanından oluşturulur.
device : (`torch.device`, *isteğe bağlı*): torch cihazı
dtype : (`torch.dtype`, *isteğe bağlı*): torch dtype
İsteği metin kodlayıcı gizli durumlarına kodlar.
## 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)
```
[Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/helios/pipeline_output.py#L9)
**Parametreler:**
frames (`torch.Tensor`, `np.ndarray` veya List[List[PIL.Image.Image]]) : Video çıktıları listesi - `batch_size,` uzunluğunda iç içe geçmiş bir liste olabilir; bu durumda her alt liste, `num_frames.` uzunluğunda gürültüsü azaltılmış PIL görüntü dizileri içerir. Ayrıca `(batch_size, num_frames, channels, height, width)` biçiminde bir NumPy dizi veya Torch tensörü de olabilir.
Helios iş akışları için çıktı sınıfı.

Xet Storage Details

Size:
55.9 kB
·
Xet hash:
e2aeddba120f1558f3f70c49c5aa9a0403a0f2760a93ebccbc48615889fc34f5

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.