Diffusers documentation

출력

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

출력

모든 모델 출력은 BaseOutput의 하위 클래스이며, 모델이 반환하는 모든 정보를 포함하는 데이터 구조입니다. 출력은 튜플이나 사전으로也可以使用할 수 있습니다.

예를 들어:

from diffusers import DDIMPipeline

pipeline = DDIMPipeline.from_pretrained("google/ddpm-cifar10-32")
outputs = pipeline()

outputs 객체는 ImagePipelineOutput이므로 image 속성이 있습니다.

각 속성은 일반적인 방법이나 키워드 조회를 통해 접근할 수 있으며, 해당 속성이 모델에 의해 반환되지 않으면 None을 반환합니다:

outputs.images
outputs["images"]

outputs 객체를 튜플로 간주할 때, None 값이 없는 속성만 고려합니다. 예를 들어, 인덱싱을 통해 이미지를 가져오면 튜플 (outputs.images)가 반환됩니다:

outputs[:1]

특정 pipeline 또는 모델의 출력을 확인하려면 해당 API 문서를 참조하세요.

BaseOutput

클래스 diffusers.utils.BaseOutput

< >

( )

모든 모델 출력을 위한 dataclass 기반 베이스 클래스입니다. 정수 또는 슬라이스(튜플처럼) 또는 문자열(사전처럼)로 인덱싱을 허용하는 __getitem__를 가지고 있으며, 이 경우 None 속성은 무시됩니다. 그 외에는 일반적인 Python 사전과 동일하게 동작합니다.

>BaseOutput를 직접 unpack할 수 없습니다. 먼저 to_tuple() 메서드를 사용해 tuple로 변환하세요.

to_tuple

< >

( )

None이 아닌 모든 속성/키를 포함하는 튜플로 self를 변환합니다.

ImagePipelineOutput

클래스 diffusers.ImagePipelineOutput

< >

( images: list[PIL.Image.Image] | numpy.ndarray )

매개변수

  • images (List[PIL.Image.Image] 또는 np.ndarray) — batch_size 길이의 노이즈 제거된 PIL 이미지 목록 또는 (batch_size, height, width, num_channels) 형태의 NumPy 배열.

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

AudioPipelineOutput

클래스 diffusers.AudioPipelineOutput

< >

( audios: ndarray )

매개변수

  • audios (np.ndarray) — (batch_size, num_channels, sample_rate) 모양의 NumPy 배열로 구성된 노이즈 제거된 오디오 샘플 목록.

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

ImageTextPipelineOutput

클래스 diffusers.ImageTextPipelineOutput

< >

( images: list[PIL.Image.Image] | numpy.ndarray | Nonetext: list[str] | list[list[str]] | None )

매개변수

  • images (list[PIL.Image.Image] 또는 np.ndarray) — batch_size 길이의 노이즈 제거된 PIL 이미지 목록 또는 (batch_size, height, width, num_channels) 모양의 NumPy 배열.
  • text (list[str] 또는 list[list[str]]) — batch_size 길이의 생성된 텍스트 문자열 목록 또는 외부 목록의 길이가 batch_size인 문자열 목록의 목록

이미지-텍스트 결합 파이프라인의 출력 클래스입니다.

Update on GitHub