Diffusers documentation
DiffusionPipeline에서 가져오기
시작하기
추론
확산 파이프라인 사용
어댑터 및 개인화
최적화 및 확장
모듈형 Diffusers
개요빠른 시작DiffusionPipeline에서 가져오기상태ModularPipelineBlocksSequentialPipelineBlocksLoopSequentialPipelineBlocksAutoPipelineBlocksModularPipeline가이드ComponentsManager자동 docstring 및 매개변수 템플릿커스텀 블록 만들기Mellon에서 사용자 정의 블록 사용
학습 및 파인튜닝
리소스
기여하기
API
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).
DiffusionPipeline에서 가져오기
DiffusionPipeline에 익숙하고 ModularPipeline을 처음 사용하는 경우, 몇 가지 동작 방식이 다릅니다. quickstart를 진행하기 전에 아래 내용을 참고해 두시기 바랍니다.
- Loading is lazy and flexible. from_pretrained() builds the pipeline from the repository’s
modular_model_index.jsonwithout loading any weights. load_components() then loads them, and it doesn’t have to be all at once: by default it loads everything, but you can load only the components you name withnames, or the set one workflow needs withworkflow. update_components() lets you reuse a component you already have, or one that differs from the repository’s spec. See Loading components and Updating components. - ModularPipeline reads a different index,
modular_model_index.json, but it also works with a repository that only has amodel_index.json, as long as the model has a modular pipeline. The reverse is not true: DiffusionPipeline and theAutoPipelineclasses don’t work with a repository that only has amodular_model_index.json. - 호출은 파이프라인 상태를 반환합니다. 이 상태에는 중간 값(
prompt_embeds,latents, …)도 포함됩니다.output인수를 사용해 필요한 항목을 요청할 수 있습니다. 예를 들어output="images"또는output=["images", "latents"]처럼 사용할 수 있고, quickstart에서처럼 상태의 속성을 직접 읽을 수도 있습니다. States를 참고하세요. guider구성 요소에서 Classifier-free guidance가 지원되며,guidance_scale호출 인수가 아닙니다:pipe.update_components(guider=ClassifierFreeGuidance(guidance_scale=5.0)). guiders 가이드를 참조하세요.callback_on_step_end은 없습니다. 대신, 노이즈 제거 루프에 블록을 삽입하여 기존 콜백 함수를 사용할 수 있습니다. 콜백 가이드의 모듈형 파이프라인을 참고하세요.- 파이프라인은 블록의 그래프이며, init_pipeline()로 빌드하기 전에 변경(추출, 삽입, 교체)할 수 있습니다.
pipe.blocks는 복사본을 반환하므로 먼저 블록을 편집하세요. 새 워크플로우 구성을 참조하세요. - Offloading is handled by a ComponentsManager, which can serve several pipelines that share components. See the ComponentsManager guide.