Diffusers documentation

PiflowScheduler

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

PiflowScheduler

PiflowScheduler는 distilled Kandinsky 6 체크포인트의 few-step 스케줄러입니다. 텍스트/이미지-투-비디오-오디오 모델과 비디오 초해상도 모델, 그리고 distilled Kandinsky S2V 1.0 체크포인트 모두에 적용됩니다. π-Flow를 구현하며, transformer가 소수의 그리드 포인트에서 각 latent 채널당 n_grid개의 denoised 추정치를 예측하고, 스케줄러는 이 추정치들 사이에 network-free 정책을 적분합니다.

참조 구현은 Lakonik/LakonLab에서 찾을 수 있습니다.

PiflowScheduler

클래스 diffusers.PiflowScheduler

< >

( num_train_timesteps: int = 1000shift: float = 5.0n_grid: int = 10eps: float = 1e-06final_step_size_scale: float = 0.5num_policy_substeps: int = 128 )

매개변수

  • num_train_timesteps (int, 선택 사항, 기본값 1000) — 학습용 diffusion 단계 수.
  • shift (float, 선택 사항, 기본값 5.0) — Flow-matching timestep shift입니다.
  • n_grid (int, 선택 사항, 기본값 10) — 확장된 모델 출력의 예측 개수.
  • eps (float, 선택 사항, 기본값 1e-6) — 최소 timestep 및 정책 분모.
  • final_step_size_scale (float, 선택 사항, 기본값 0.5) — 최종 raw-timestep 세그먼트의 상대적 크기.
  • num_policy_substeps (int, 선택 사항, 기본값 128) — raw-timestep 단위당 최대 정책 적분 서브스텝 수.

확장된 출력의 diffusion transformer를 위한 Few-step PiFlow 스케줄러.

PiFlow는 소수의 그리드 점에서 denoising 모델을 평가하고, 해당 평가 사이에 네트워크가 없는 정책을 적분합니다. 이 스케줄러는 distilled Kandinsky 6 체크포인트, 즉 주요 video/audio 모델과 video super-resolution 모델을 위해 설계되었습니다. 이들의 모델 출력에는 샘플 채널당 n_grid개의 예측 값이 포함됩니다.

이 스케줄러는 SchedulerMixin과 ConfigMixin을 상속합니다. 모든 스케줄러에 대해 구현된 일반적 메서드(로드, 저장 등)에 대해서는 상위 클래스 문서를 확인하세요.

set_timesteps

< >

( num_inference_steps: int | None = Nonedevice: typing.Union[str, torch.device, NoneType] = Nonesigmas: list[float] | None = Nonemu: float | None = Nonetimesteps: list[float] | None = None )

매개변수

  • num_inference_steps (int) — 모델 평가 횟수.
  • device (str 또는 torch.device, 선택 사항) — 스케줄에 사용할 장치.
  • sigmas (list[float], 선택 사항) — 지원되지 않는 사용자 정의 sigma 스케줄입니다.
  • mu (float, 선택 사항) — 지원되지 않는 동적 시프트 파라미터.
  • timesteps (list[float], 선택 사항) — 지원되지 않는 사용자 지정 timestep 스케줄입니다.

증류된 PiFlow의 timestep schedule을 설정합니다.

단계

< >

( model_output: FloatTensortimestep: typing.Union[float, torch.FloatTensor]sample: FloatTensorreturn_dict: bool = True ) → [PiflowSchedulerOutput] or tuple

매개변수

  • model_output (torch.FloatTensor) — 샘플 채널당 n_grid개의 예측을 포함하는 확장된 모델 출력
  • timestep (float 또는 torch.FloatTensor) — 현재 스케줄러의 timestep.
  • sample (torch.FloatTensor) — 현재 노이즈 샘플.
  • return_dict (bool, 선택 사항, 기본값 True) — [PiflowSchedulerOutput]를 반환할지 여부

반환값

[PiflowSchedulerOutput] 또는 tuple

업데이트된 샘플.

PiFlow 정책을 통합하여 한 단계 진전합니다.

PiflowSchedulerOutput

클래스 diffusers.schedulers.scheduling_piflow.PiflowSchedulerOutput

< >

( prev_sample: Tensor )

매개변수

  • prev_sample (torch.Tensor) — 다음 PiFlow 그리드 점에서 계산된 샘플입니다. 다음 디노이징 입력으로 사용해야 합니다.

스케줄러의 step 함수 출력을 위한 출력 클래스입니다.

Update on GitHub