Diffusers documentation

HeliosScheduler

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

HeliosScheduler

HeliosScheduler은 Helios에서 소개된 피라미드형 flow-matching 샘플링을 기반으로 합니다.

HeliosScheduler

클래스 diffusers.HeliosScheduler

< >

( num_train_timesteps: int = 1000shift: float = 1.0stages: int = 3stage_range: list = [0, 0.3333333333333333, 0.6666666666666666, 1]gamma: float = 0.3333333333333333thresholding: bool = Falseprediction_type: str = 'flow_prediction'solver_order: int = 2predict_x0: bool = Truesolver_type: str = 'bh2'lower_order_final: bool = Truedisable_corrector: list = []solver_p: SchedulerMixin = Noneuse_flow_sigmas: bool = Truescheduler_type: str = 'unipc'use_dynamic_shifting: bool = Falsetime_shift_type: typing.Literal['exponential', 'linear'] = 'exponential' )

convert_model_output

< >

( model_output: Tensor*argssample: Tensor = Nonesigma: Tensor = None**kwargs ) → torch.Tensor

매개변수

  • model_output (torch.Tensor) — 학습된 diffusion 모델의 직접적인 출력입니다.
  • timestep (int) — 확산 체인(diffusion chain)의 현재 이산 시간 단계(discrete timestep)입니다.
  • sample (torch.Tensor) — 확산 과정에 의해 생성된 샘플의 현재 인스턴스입니다.
  • sigma (torch.Tensor, 선택 사항) — 노이즈 스케줄에서 현재 단계의 시그마입니다.

반환값

torch.Tensor

변환된 모델 출력

UniPC 알고리즘이 필요로 하는 해당 유형으로 모델 출력을 변환합니다.

init_sigmas

< >

( )

전역 timesteps와 sigmas를 초기화합니다

init_sigmas_for_each_stage

< >

( )

각 단계의 timesteps를 초기화합니다

multistep_uni_c_bh_update

< >

( this_model_output: Tensor*argslast_sample: Tensor = Nonethis_sample: Tensor = Noneorder: int = Nonesigma_before: Tensor = Nonesigma: Tensor = None**kwargs ) → torch.Tensor

매개변수

  • this_model_output (torch.Tensor) — x_t에서의 모델 출력입니다.
  • this_timestep (int) — 현재 timestep t.
  • last_sample (torch.Tensor) — 마지막 predictor x_{t-1} 이전의 생성된 샘플.
  • this_sample (torch.Tensor) — 마지막 예측기 x_{t} 이후 생성된 샘플.
  • order (int) — 해당 단계의 UniC-p의 p입니다. 유효한 정확도 차수는 order + 1이어야 합니다.
  • sigma_before (torch.Tensor, 선택 사항) — 노이즈 스케줄에서 이전 단계의 시그마입니다.
  • sigma (torch.Tensor, 선택 사항) — 노이즈 스케줄에서 현재 단계의 시그마입니다.

반환값

torch.Tensor

현재 타임스텝에서 보정된 샘플 텐서.

UniC(B(h) 버전)의 한 단계.

multistep_uni_p_bh_update

< >

( model_output: Tensor*argssample: Tensor = Noneorder: int = Nonesigma: Tensor = Nonesigma_next: Tensor = None**kwargs ) → torch.Tensor

매개변수

  • model_output (torch.Tensor) — 현재 timestep에서 학습된 diffusion 모델의 직접 출력입니다.
  • prev_timestep (int) — 확산 체인에서 이전의 이산 시간 단계입니다.
  • sample (torch.Tensor) — 확산 과정에 의해 생성된 샘플의 현재 인스턴스입니다.
  • order (int) — 해당 timestep에서의 UniP 순서(UniPC-p의 p에 해당).
  • sigma (torch.Tensor, 선택 사항) — 노이즈 스케줄에서 현재 단계의 시그마입니다.
  • sigma_next (torch.Tensor, 선택 사항) — 노이즈 스케줄에서 다음 단계의 시그마입니다.

반환값

torch.Tensor

이전 시간 단계의 샘플 텐서.

UniP(B(h) 버전)의 한 단계입니다. 대신, 지정된 경우 self.solver_p가 사용됩니다.

set_begin_index

< >

( begin_index: int = 0 )

매개변수

  • begin_index (int) — 스케줄러의 시작 인덱스입니다.

… 스케줄러의 시작 인덱스를 설정합니다. 이 함수는 추론 전에 파이프라인에서 실행해야 합니다.

set_timesteps

< >

( num_inference_steps: intstage_index: int | None = Nonedevice: typing.Union[str, torch.device] = Nonesigmas: bool | None = Nonemu: bool | None = Noneis_amplify_first_chunk: bool = False )

각 단계의 timesteps와 sigmas 설정

time_shift

< >

( mu: floatsigma: floatt: Tensor ) → torch.Tensor

매개변수

  • mu (float) — 시간 시프트에 사용되는 mu 매개변수입니다.
  • sigma (float) — 시간 시프트에 사용되는 sigma 매개변수입니다.
  • t (torch.Tensor) — 입력 타임스텝입니다.

반환값

torch.Tensor

시간이 이동된 타임스텝

sigmas에 시간 시프트를 적용합니다.

scheduling_helios

Update on GitHub