Diffusers documentation

Helios

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.42.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

LoRA

Helios

Shenghai Yuan, Yuanyang Yin, Zongjian Li, Xinwei Huang, Xiao Yang, Li Yuan의 Helios: Real Real-Time Long Video Generation Model, Peking University & ByteDance & etc.

  • 17 FPS로 단일 NVIDIA H100 GPU에서 구동되며, 분 단위 생성을 지원하고 품질 면에서 강력한 베이스라인과 동등한 성능을 보이는 최초의 14B 비디오 생성 모델인 Helios를 소개합니다. 우리는 세 가지 핵심 차원에서 돌파구를 마련했습니다: (1) self-forcing, error banks, keyframe sampling과 같이 일반적으로 사용되는 anti-drift 휴리스틱 없이도 긴 비디오의 drifting에 대한 견고성; (2) KV-cache, causal masking, sparse attention과 같은 표준 가속 기법 없이도 실시간 생성; (3) 병렬화 또는 샤딩 프레임워크 없이 학습하여, 80 GB의 GPU 메모리 내에서 최대 네 개의 14B 모델을 수용하면서 이미지 디퓨션 규모의 배치 크기를 가능하게 하는 것. 구체적으로, Helios는 T2V, I2V, V2V 작업을 네이티브로 지원하는 통합 입력 표현을 갖춘 14B 오토레그레시브 디퓨션 모델입니다. 긴 비디오 생성에서의 drifting을 완화하기 위해, 우리는 그 전형적인 실패 모드를 특성화하고, 반복적인 동작을 그 근원에서 제거하는 동시에 학습 중에 drifting을 명시적으로 시뮬레이션하는 단순하면서도 효과적인 학습 전략을 제안합니다. 효율성을 위해, 우리는 과거 및 노이즈 컨텍스트를 크게 압축하고 샘플링 단계 수를 줄여, 1.3B 비디오 생성 모델과 유사하거나 그보다 낮은 계산 비용을 달성했습니다. 또한, 추론과 학습을 모두 가속화하면서 메모리 소비를 줄이는 인프라 수준의 최적화를 도입했습니다. 광범위한 실험은 Helios가 짧은 비디오와 긴 비디오 생성 모두에서 기존 방법들을 일관되게 능가함을 보여줍니다. 모든 코드와 모델은 [this https URL](https://pku-yuangroup.github.io/Helios-Page)에서 사용할 수 있습니다.

다음 Helios 모델들이 Diffusers에서 지원됩니다:

  • Helios-Base: v-prediction, 표준 CFG 및 사용자 정의 HeliosScheduler를 사용하여 최고의 품질을 제공합니다.
  • Helios-Mid: 중간 가중치, v-prediction, CFG-Zero* 및 사용자 정의 HeliosScheduler를 사용합니다.
  • Helios-Distilled: x0-prediction과 맞춤형 HeliosDMDScheduler를 사용하여 최고의 효율성을 제공합니다.

Helios 모델에 대한 추가 비디오 생성 예시를 보려면 오른쪽 사이드바의 Helios 모델을 클릭하세요.

메모리 및 추론 속도 최적화

…

메모리
추론 속도

다양한 메모리 절약 기법에 대한 자세한 내용은 메모리 사용량 줄이기 가이드를 참조하세요.

아래의 Helios 모델은 약 6GB의 VRAM이 필요합니다.

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)

Helios-Base를 사용한 생성

아래 예시는 텍스트, 이미지 또는 비디오를 기반으로 비디오를 생성하기 위해 Helios-Base를 사용하는 방법을 보여줍니다.

사용법
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를 사용하는 방법을 보여줍니다.

사용법
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을 사용하는 방법을 보여줍니다.

사용법
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)

텍스트-투-비디오 쇼케이스

프롬프트생성된 비디오
현대 도시 버스를 운전하는 바이킹 전사. 버스 안에는 승객들이 가득 차 있다. 바이킹은 뒤로 묶은 긴 금발 머리와 수염을 하고 있으며, 모피로 장식된 투구와 갑옷을 착용하고 있다. 전통적인 튜닉과 바지를 입고 있지만, 복잡한 거리를 운전하는 데 집중하며 안전벨트도 착용하고 있다. 버스 내부는 전형적인 모습으로, 일상적인 활동을 하는 다양한 승객들이 좌석에 앉아 있다. 외부 샷에서는 높은 건물과 교통량이 많은 번화한 도시 환경을 보여준다. 운전대를 잡은 바이킹에 초점을 맞춘 중거리 샷이며, 그의 결연한 표정을 보여주는 클로즈업이 간헐적으로 등장한다.
왼쪽으로 이동하는 카메라 트럭에서 촬영한 다큐멘터리 스타일의 자연 사진으로, 게가 빠르게 굴로 들어가는 모습을 담고 있습니다. 게는 단단한 올리브색 껍질과 긴 집게를 가지고 있으며, 모래 위를 결연한 속도로 이동합니다. 모래로 파고들면서 몸이 약간 아치형으로 구부러져 있고, 뒤로 작은 흔적을 남깁니다. 배경에는 바위와 조개껍질이 흩어져 있는 얕은 해변이 보이며, 지평선에는 해안선의 부드러운 곡선이 나타납니다. 사진은 자연스럽고 사실적인 질감을 가지고 있으며, 게의 자연스러운 움직임과 모래의 질감을 강조합니다. 약간 높은 각도에서 촬영한 클로즈업 샷입니다.

이미지-비디오 쇼케이스

이미지프롬프트생성된 비디오
흐린 하늘 아래 시골 도로를 달리는 세련된 빨간색 Kia 자동차로, 주변 들판과 나무가 멀어지며 흐려진 움직임이 현대적인 디자인과 역동적인 움직임을 강조합니다. 차의 광택 있는 외관은 흐린 하늘을 반사하여 공기역학적 형태와 스포티한 자세를 부각시킵니다. 번호판에는 "KIA 626"이라고 적혀 있고, 차량의 헤드라이트가 켜져 있어 움직임과 에너지의 느낌을 더합니다. 도로는 부드럽게 굽어 있으며, 자동차가 약간 중앙에서 벗어나 배치되어 앞으로 나아가는 동력을 느끼게 합니다. 역동적인 전면 3/4 뷰가 완만한 언덕과 흩어진 나무라는 고요한 배경 앞에서 자동차의 강력한 존재감을 포착합니다.
클로즈업 샷으로, 선명한 초록색 눈과 흰 수염을 가진 보송보송한 주황색 고양이가 카메라를 정면으로 응시하고 있습니다. 고양이의 털은 부드럽고 잘 관리되어 있으며, 따뜻한 주황색과 크림색 톤이 어우러져 있습니다. 크고 표현력 있는 눈은 생생한 초록색으로, 호기심과 경계심을 반영하고 있습니다. 코는 작고 분홍색이며, 입이 살짝 벌어져 분홍색 혀가 살짝 보입니다. 배경은 부드럽게 흐릿하게 처리되어 중립적인 톤의 아늑한 실내 환경을 암시합니다. 사진은 얕은 심도를 사용하여 고양이의 얼굴은 선명하게 초점이 맞춰진 반면, 배경은 흐릿하게 처리되어 있습니다. 약간 위에서 내려다보는 각도의 클로즈업 샷입니다.

인터랙티브 비디오 쇼케이스

프롬프트생성된 비디오
프롬프트는 여기에서 찾을 수 있습니다.
프롬프트는 여기에서 찾을 수 있습니다.

리소스

다음 리소스를 통해 Helios에 대해 자세히 알아보세요.

HeliosPipeline

클래스 diffusers.HeliosPipeline

< >

( tokenizer: AutoTokenizertext_encoder: UMT5EncoderModelvae: AutoencoderKLWanscheduler: HeliosSchedulertransformer: HeliosTransformer3DModel )

매개변수

  • tokenizer (T5Tokenizer) — T5의 토크나이저로, 구체적으로 google/umt5-xxl 변형입니다.
  • text_encoder (T5EncoderModel) — 구체적으로 google/umt5-xxl 변형을 사용하는 T5입니다.
  • transformer (HeliosTransformer3DModel) — 입력 latents의 노이즈를 제거하기 위한 조건부 Transformer.
  • scheduler (HeliosScheduler) — transformer와 함께 사용되어 인코딩된 이미지 latents의 노이즈를 제거하는 데 사용되는 스케줄러입니다.
  • vae (AutoencoderKLWan) — 잠재 표현으로 비디오를 인코딩 및 디코딩하는 Variational Auto-Encoder (VAE) 모델.

Helios를 사용하여 텍스트-비디오 / 이미지-비디오 / 비디오-비디오 생성을 위한 Pipeline

이 모델은 DiffusionPipeline에서 상속됩니다. 모든 파이프라인에 대해 구현된 일반적 메서드(다운로드, 저장, 특정 디바이스에서 실행 등)에 대해서는 상위 클래스 문서를 확인하세요.

__call__

< >

( prompt: str | list[str] = Nonenegative_prompt: str | list[str] = Noneheight: int = 384width: int = 640num_frames: int = 132num_inference_steps: int = 50sigmas: list = Noneguidance_scale: float = 5.0num_videos_per_prompt: int | None = 1generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = Nonelatents: typing.Optional[torch.Tensor] = Noneprompt_embeds: typing.Optional[torch.Tensor] = Nonenegative_prompt_embeds: typing.Optional[torch.Tensor] = Noneoutput_type: str | None = 'np'return_dict: bool = Trueattention_kwargs: dict[str, typing.Any] | None = Nonecallback_on_step_end: typing.Union[typing.Callable[[int, int], NoneType], diffusers.callbacks.PipelineCallback, diffusers.callbacks.MultiPipelineCallbacks, NoneType] = Nonecallback_on_step_end_tensor_inputs: list = ['latents']max_sequence_length: int = 512image: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor], NoneType] = Noneimage_latents: typing.Optional[torch.Tensor] = Nonefake_image_latents: typing.Optional[torch.Tensor] = Noneadd_noise_to_image_latents: bool = Trueimage_noise_sigma_min: float = 0.111image_noise_sigma_max: float = 0.135video: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor], NoneType] = Nonevideo_latents: typing.Optional[torch.Tensor] = Noneadd_noise_to_video_latents: bool = Truevideo_noise_sigma_min: float = 0.111video_noise_sigma_max: float = 0.135history_sizes: list = [16, 2, 1]num_latent_frames_per_chunk: int = 9keep_first_frame: bool = Trueis_skip_first_chunk: bool = False ) → ~HeliosPipelineOutput or tuple

매개변수

  • 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에서 정의한 가이던스 스케일입니다. guidance_scale은 Imagen Paper의 방정식 2의 w로 정의됩니다. guidance_scale > 1로 설정하면 가이던스 스케일이 활성화됩니다. 가이던스 스케일이 높을수록 prompt 텍스트와 밀접하게 연결된 이미지를 생성하도록 유도하지만, 일반적으로 이미지 품질이 낮아지는 대가를 치릅니다.
  • num_videos_per_prompt (int, 선택 사항, 기본값 1) — 프롬프트당 생성할 이미지의 수.
  • generator (torch.Generator 또는 list[torch.Generator], 선택 사항) — 생성을 결정적으로 만들기 위한 torch.Generator.
  • latents (torch.Tensor, 선택 사항) — 가우시안 분포에서 샘플링된 사전 생성된 노이즈 latents로, 이미지 생성의 입력으로 사용됩니다. 동일한 생성을 다른 프롬프트로 조정하는 데 사용할 수 있습니다. 제공되지 않으면, 제공된 랜덤 generator를 사용하여 샘플링하여 latents 텐서를 생성합니다.
  • 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의 self.processor에서 정의된 AttentionProcessor로 전달되는 kwargs 사전입니다.
  • callback_on_step_end (Callable, PipelineCallback, MultiPipelineCallbacks, 선택 사항) — 추론 중 각 denoising 단계의 끝에서 호출되는 함수 또는 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) — denoising 전에 image latents에 노이즈를 추가할지 여부.
  • image_noise_sigma_min (float, 선택 사항, 기본값 0.111) — 이미지 latents에 추가되는 노이즈의 최소 sigma 값입니다.
  • image_noise_sigma_max (float, 선택 사항, 기본값 0.135) — 이미지 latents에 추가되는 노이즈의 최대 sigma 값입니다.
  • video (PipelineImageInput, 선택 사항) — video-to-video conditioning에 사용되는 입력 비디오입니다.
  • video_latents (torch.Tensor, 선택 사항) — video 대신 사용할 사전 인코딩된 비디오 latents입니다.
  • add_noise_to_video_latents (bool, 선택 사항, 기본값 True) — denoising 전에 video latents에 노이즈를 추가할지 여부.
  • video_noise_sigma_min (float, 선택 사항, 기본값 0.111) — 비디오 latent에 추가되는 노이즈의 최소 sigma 값입니다.
  • video_noise_sigma_max (float, 선택 사항, 기본값 0.135) — 비디오 latent에 추가되는 노이즈의 최대 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가 반환되고, 그렇지 않으면 첫 번째 요소가 생성된 이미지의 목록이고 두 번째 요소가 각 생성된 이미지에 “not-safe-for-work”(nsfw) 콘텐츠가 포함되어 있는지 여부를 나타내는 bool 목록인 tuple이 반환됩니다.

생성을 위한 pipeline의 호출 함수.

예:

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

< >

( prompt: str | list[str]negative_prompt: str | list[str] | None = Nonedo_classifier_free_guidance: bool = Truenum_videos_per_prompt: int = 1prompt_embeds: typing.Optional[torch.Tensor] = Nonenegative_prompt_embeds: typing.Optional[torch.Tensor] = Nonemax_sequence_length: int = 226device: typing.Optional[torch.device] = Nonedtype: typing.Optional[torch.dtype] = None )

매개변수

  • prompt (str 또는 list[str], 선택 사항) — 인코딩할 프롬프트
  • negative_prompt (str 또는 list[str], 선택 사항) — 이미지 생성을 안내하지 않을 프롬프트입니다. 정의되지 않은 경우 negative_prompt_embeds를 대신 전달해야 합니다. 가이던스를 사용하지 않을 때 무시됩니다(즉, guidance_scale이 1보다 작으면 무시됩니다).
  • do_classifier_free_guidance (bool, 선택 사항, 기본값 True) — classifier free guidance를 사용할지 여부.
  • num_videos_per_prompt (int, 선택 사항, 기본값 1) — 프롬프트당 생성할 비디오의 수. 결과 임베딩을 배치할 torch device
  • prompt_embeds (torch.Tensor, 선택) — 미리 생성된 텍스트 임베딩입니다. 텍스트 입력을 쉽게 조정하는 데 사용할 수 있으며, 예를 들어 프롬프트 가중치 설정에 활용할 수 있습니다. 제공되지 않으면 prompt 입력 인자로부터 텍스트 임베딩이 생성됩니다.
  • negative_prompt_embeds (torch.Tensor, 선택 사항) — 미리 생성된 negative text embeddings입니다. 텍스트 입력을 쉽게 조정하는 데 사용할 수 있으며, 예를 들어 프롬프트 가중치 설정에 활용할 수 있습니다. 제공되지 않으면 negative_prompt 입력 인자로부터 negative_prompt_embeds가 생성됩니다.
  • device — (torch.device, 선택 사항): torch device
  • dtype — (torch.dtype, 선택 사항): torch dtype

프롬프트를 텍스트 인코더의 히든 상태로 인코딩합니다.

HeliosPyramidPipeline

class diffusers.HeliosPyramidPipeline

< >

( tokenizer: AutoTokenizertext_encoder: UMT5EncoderModelvae: AutoencoderKLWanscheduler: diffusers.schedulers.scheduling_helios.HeliosScheduler | diffusers.schedulers.scheduling_helios_dmd.HeliosDMDSchedulertransformer: HeliosTransformer3DModelis_cfg_zero_star: bool = Falseis_distilled: bool = False )

매개변수

  • tokenizer (T5Tokenizer) — T5의 토크나이저로, 구체적으로 google/umt5-xxl 변형입니다.
  • text_encoder (T5EncoderModel) — 구체적으로 google/umt5-xxl 변형을 사용하는 T5입니다.
  • transformer (HeliosTransformer3DModel) — 입력 latents의 노이즈를 제거하기 위한 조건부 Transformer.
  • scheduler ([HeliosScheduler, HeliosDMDScheduler]) — transformer와 함께 사용되어 인코딩된 이미지 잠재를 디노이즈하는 스케줄러입니다.
  • vae (AutoencoderKLWan) — 잠재 표현으로 비디오를 인코딩 및 디코딩하는 Variational Auto-Encoder (VAE) 모델.

Helios를 사용하여 텍스트-비디오 / 이미지-비디오 / 비디오-비디오 생성을 위한 Pipeline

이 모델은 DiffusionPipeline에서 상속됩니다. 모든 파이프라인에 대해 구현된 일반적 메서드(다운로드, 저장, 특정 디바이스에서 실행 등)에 대해서는 상위 클래스 문서를 확인하세요.

__call__

< >

( prompt: str | list[str] = Nonenegative_prompt: str | list[str] = Noneheight: int = 384width: int = 640num_frames: int = 132sigmas: list = Noneguidance_scale: float = 5.0num_videos_per_prompt: int | None = 1generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = Nonelatents: typing.Optional[torch.Tensor] = Noneprompt_embeds: typing.Optional[torch.Tensor] = Nonenegative_prompt_embeds: typing.Optional[torch.Tensor] = Noneoutput_type: str | None = 'np'return_dict: bool = Trueattention_kwargs: dict[str, typing.Any] | None = Nonecallback_on_step_end: typing.Union[typing.Callable[[int, int], NoneType], diffusers.callbacks.PipelineCallback, diffusers.callbacks.MultiPipelineCallbacks, NoneType] = Nonecallback_on_step_end_tensor_inputs: list = ['latents']max_sequence_length: int = 512image: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor], NoneType] = Noneimage_latents: typing.Optional[torch.Tensor] = Nonefake_image_latents: typing.Optional[torch.Tensor] = Noneadd_noise_to_image_latents: bool = Trueimage_noise_sigma_min: float = 0.111image_noise_sigma_max: float = 0.135video: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor], NoneType] = Nonevideo_latents: typing.Optional[torch.Tensor] = Noneadd_noise_to_video_latents: bool = Truevideo_noise_sigma_min: float = 0.111video_noise_sigma_max: float = 0.135history_sizes: list = [16, 2, 1]num_latent_frames_per_chunk: int = 9keep_first_frame: bool = Trueis_skip_first_chunk: bool = Falsepyramid_num_inference_steps_list: list = [10, 10, 10]use_zero_init: bool | None = Truezero_steps: int | None = 1is_amplify_first_chunk: bool = False ) → ~HeliosPipelineOutput or tuple

매개변수

  • 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에서 정의한 가이던스 스케일입니다. guidance_scale은 Imagen Paper의 방정식 2의 w로 정의됩니다. guidance_scale > 1로 설정하면 가이던스 스케일이 활성화됩니다. 가이던스 스케일이 높을수록 prompt 텍스트와 밀접하게 연결된 이미지를 생성하도록 유도하지만, 일반적으로 이미지 품질이 낮아지는 대가를 치릅니다.
  • num_videos_per_prompt (int, 선택 사항, 기본값 1) — 프롬프트당 생성할 이미지의 수.
  • generator (torch.Generator 또는 list[torch.Generator], 선택 사항) — 생성을 결정적으로 만들기 위한 torch.Generator.
  • latents (torch.Tensor, 선택 사항) — 가우시안 분포에서 샘플링된 사전 생성된 노이즈 latents로, 이미지 생성의 입력으로 사용됩니다. 동일한 생성을 다른 프롬프트로 조정하는 데 사용할 수 있습니다. 제공되지 않으면, 제공된 랜덤 generator를 사용하여 샘플링하여 latents 텐서를 생성합니다.
  • 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의 self.processor에서 정의된 AttentionProcessor로 전달되는 kwargs 사전입니다.
  • callback_on_step_end (Callable, PipelineCallback, MultiPipelineCallbacks, 선택 사항) — 추론 중 각 denoising 단계의 끝에서 호출되는 함수 또는 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) — denoising 전에 image latents에 노이즈를 추가할지 여부.
  • image_noise_sigma_min (float, 선택 사항, 기본값 0.111) — 이미지 latents에 추가되는 노이즈의 최소 sigma 값입니다.
  • image_noise_sigma_max (float, 선택 사항, 기본값 0.135) — 이미지 latents에 추가되는 노이즈의 최대 sigma 값입니다.
  • video (PipelineImageInput, 선택 사항) — video-to-video conditioning에 사용되는 입력 비디오입니다.
  • video_latents (torch.Tensor, 선택 사항) — video 대신 사용할 사전 인코딩된 비디오 latents입니다.
  • add_noise_to_video_latents (bool, 선택 사항, 기본값 True) — denoising 전에 video latents에 노이즈를 추가할지 여부.
  • video_noise_sigma_min (float, 선택 사항, 기본값 0.111) — 비디오 latent에 추가되는 노이즈의 최소 sigma 값입니다.
  • video_noise_sigma_max (float, 선택 사항, 기본값 0.135) — 비디오 latent에 추가되는 노이즈의 최대 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 생성 시 각 pyramid 단계의 추론 단계 수입니다.
  • 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가 반환되고, 그렇지 않으면 첫 번째 요소가 생성된 이미지의 목록이고 두 번째 요소가 각 생성된 이미지에 “not-safe-for-work”(nsfw) 콘텐츠가 포함되어 있는지 여부를 나타내는 bool 목록인 tuple이 반환됩니다.

생성을 위한 pipeline의 호출 함수.

예:

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

< >

( prompt: str | list[str]negative_prompt: str | list[str] | None = Nonedo_classifier_free_guidance: bool = Truenum_videos_per_prompt: int = 1prompt_embeds: typing.Optional[torch.Tensor] = Nonenegative_prompt_embeds: typing.Optional[torch.Tensor] = Nonemax_sequence_length: int = 226device: typing.Optional[torch.device] = Nonedtype: typing.Optional[torch.dtype] = None )

매개변수

  • prompt (str 또는 list[str], 선택 사항) — 인코딩할 프롬프트
  • negative_prompt (str 또는 list[str], 선택 사항) — 이미지 생성을 안내하지 않을 프롬프트입니다. 정의되지 않은 경우 negative_prompt_embeds를 대신 전달해야 합니다. 가이던스를 사용하지 않을 때 무시됩니다(즉, guidance_scale이 1보다 작으면 무시됩니다).
  • do_classifier_free_guidance (bool, 선택 사항, 기본값 True) — classifier free guidance를 사용할지 여부.
  • num_videos_per_prompt (int, 선택 사항, 기본값 1) — 프롬프트당 생성할 비디오의 수. 결과 임베딩을 배치할 torch device
  • prompt_embeds (torch.Tensor, 선택) — 미리 생성된 텍스트 임베딩입니다. 텍스트 입력을 쉽게 조정하는 데 사용할 수 있으며, 예를 들어 프롬프트 가중치 설정에 활용할 수 있습니다. 제공되지 않으면 prompt 입력 인자로부터 텍스트 임베딩이 생성됩니다.
  • negative_prompt_embeds (torch.Tensor, 선택 사항) — 미리 생성된 negative text embeddings입니다. 텍스트 입력을 쉽게 조정하는 데 사용할 수 있으며, 예를 들어 프롬프트 가중치 설정에 활용할 수 있습니다. 제공되지 않으면 negative_prompt 입력 인자로부터 negative_prompt_embeds가 생성됩니다.
  • device — (torch.device, 선택 사항): torch device
  • dtype — (torch.dtype, 선택 사항): torch dtype

프롬프트를 텍스트 인코더의 히든 상태로 인코딩합니다.

HeliosPipelineOutput

클래스 diffusers.pipelines.helios.pipeline_output.HeliosPipelineOutput

< >

( frames: Tensor )

매개변수

  • frames (torch.Tensor, np.ndarray, 또는 List[List[PIL.Image.Image]]) — 비디오 출력 목록 - batch_size, 길이의 중첩 목록일 수 있으며, 각 하위 목록에는 num_frames. 길이의 노이즈 제거된 PIL 이미지 시퀀스가 포함됩니다. 또한 (batch_size, num_frames, channels, height, width) 형상의 NumPy 배열 또는 Torch 텐서일 수도 있습니다.

Helios 파이프라인의 출력 클래스입니다.

Update on GitHub