mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-29 07:22:12 +03:00
* feat) optimization kr translation * fix) typo, italic setting * feat) dreambooth, text2image kr * feat) lora kr * fix) LoRA * fix) fp16 fix * fix) doc-builder style * fix) fp16 ์ผ๋ถ ๋จ์ด ์์ * fix) fp16 style fix * fix) opt, training docs update * merge conflict * Fix community pipelines (#3266) * Allow disabling torch 2_0 attention (#3273) * Allow disabling torch 2_0 attention * make style * Update src/diffusers/models/attention.py * Release: v0.16.1 * feat) toctree update * feat) toctree update * Fix custom releases (#3708) * Fix custom releases * make style * Fix loading if unexpected keys are present (#3720) * Fix loading * make style * Release: v0.17.0 * opt_overview * commit * Create pipeline_overview.mdx * unconditional_image_generatoin_1stDraft * โจ Add translation for write_own_pipeline.mdx * conditional-์ง์ญ, ์ธ์ปจ๋์ ๋ * unconditional_image_generation first draft * reviese * Update pipeline_overview.mdx * revise-2 * โป๏ธ translation fixed for write_own_pipeline.mdx * complete translate basic_training.mdx * other-formats.mdx ๋ฒ์ญ ์๋ฃ * fix tutorials/basic_training.mdx * other-formats ์์ * inpaint ํ๊ตญ์ด ๋ฒ์ญ * depth2img translation * translate training/adapt-a-model.mdx * revised_all * feedback taken * using_safetensors.mdx_first_draft * custom_pipeline_examples.mdx_first_draft * img2img ํ๊ธ๋ฒ์ญ ์๋ฃ * tutorial_overview edit * reusing_seeds * torch2.0 * translate complete * fix) ์ฉ์ด ํต์ผ ๊ท์ฝ ๋ฐ์ * [fix] ํผ๋๋ฐฑ์ ๋ฐ์ํด์ ๋ฒ์ญ ๋ณด์ * ์คํ์ ์ ์ + ์ปจ๋ฒค์ ์๋ฐฐ๋ ๋ถ๋ถ ์ ์ * typo, style fix * toctree update * copyright fix * toctree fix * Update _toctree.yml --------- Co-authored-by: Chanran Kim <seriousran@gmail.com> Co-authored-by: apolinรกrio <joaopaulo.passos@gmail.com> Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> Co-authored-by: Lee, Hongkyu <75282888+howsmyanimeprofilepicture@users.noreply.github.com> Co-authored-by: hyeminan <adios9709@gmail.com> Co-authored-by: movie5 <oyh5800@naver.com> Co-authored-by: idra79haza <idra79haza@github.com> Co-authored-by: Jihwan Kim <cuchoco@naver.com> Co-authored-by: jungwoo <boonkoonheart@gmail.com> Co-authored-by: jjuun0 <jh061993@gmail.com> Co-authored-by: szjung-test <93111772+szjung-test@users.noreply.github.com> Co-authored-by: idra79haza <37795618+idra79haza@users.noreply.github.com> Co-authored-by: howsmyanimeprofilepicture <howsmyanimeprofilepicture@gmail.com> Co-authored-by: hoswmyanimeprofilepicture <hoswmyanimeprofilepicture@gmail.com>
56 lines
4.0 KiB
Plaintext
56 lines
4.0 KiB
Plaintext
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
|
the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
|
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations under the License.
|
|
-->
|
|
|
|
# ์ปค์คํ
ํ์ดํ๋ผ์ธ ๋ถ๋ฌ์ค๊ธฐ
|
|
|
|
[[open-in-colab]]
|
|
|
|
์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ์ ๋
ผ๋ฌธ์ ๋ช
์๋ ์๋์ ๊ตฌํ์ฒด์ ๋ค๋ฅธ ํํ๋ก ๊ตฌํ๋ ๋ชจ๋ [`DiffusionPipeline`] ํด๋์ค๋ฅผ ์๋ฏธํฉ๋๋ค. (์๋ฅผ ๋ค์ด, [`StableDiffusionControlNetPipeline`]๋ ["Text-to-Image Generation with ControlNet Conditioning"](https://arxiv.org/abs/2302.05543) ํด๋น) ์ด๋ค์ ์ถ๊ฐ ๊ธฐ๋ฅ์ ์ ๊ณตํ๊ฑฐ๋ ํ์ดํ๋ผ์ธ์ ์๋ ๊ตฌํ์ ํ์ฅํฉ๋๋ค.
|
|
|
|
[Speech to Image](https://github.com/huggingface/diffusers/tree/main/examples/community#speech-to-image) ๋๋ [Composable Stable Diffusion](https://github.com/huggingface/diffusers/tree/main/examples/community#composable-stable-diffusion) ๊ณผ ๊ฐ์ ๋ฉ์ง ์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ์ด ๋ง์ด ์์ผ๋ฉฐ [์ฌ๊ธฐ์์](https://github.com/huggingface/diffusers/tree/main/examples/community) ๋ชจ๋ ๊ณต์ ์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ์ ์ฐพ์ ์ ์์ต๋๋ค.
|
|
|
|
ํ๋ธ์์ ์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ์ ๋ก๋ํ๋ ค๋ฉด, ์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ์ ๋ฆฌํฌ์งํ ๋ฆฌ ID์ (ํ์ดํ๋ผ์ธ ๊ฐ์ค์น ๋ฐ ๊ตฌ์ฑ ์์๋ฅผ ๋ก๋ํ๋ ค๋) ๋ชจ๋ธ์ ๋ฆฌํฌ์งํ ๋ฆฌ ID๋ฅผ ์ธ์๋ก ์ ๋ฌํด์ผ ํฉ๋๋ค. ์๋ฅผ ๋ค์ด, ์๋ ์์์์๋ `hf-internal-testing/diffusers-dummy-pipeline`์์ ๋๋ฏธ ํ์ดํ๋ผ์ธ์ ๋ถ๋ฌ์ค๊ณ , `google/ddpm-cifar10-32`์์ ํ์ดํ๋ผ์ธ์ ๊ฐ์ค์น์ ์ปดํฌ๋ํธ๋ค์ ๋ก๋ํฉ๋๋ค.
|
|
|
|
<Tip warning={true}>
|
|
|
|
๐ ํ๊น
ํ์ด์ค ํ๋ธ์์ ์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ์ ๋ถ๋ฌ์ค๋ ๊ฒ์ ๊ณง ํด๋น ์ฝ๋๊ฐ ์์ ํ๋ค๊ณ ์ ๋ขฐํ๋ ๊ฒ์
๋๋ค. ์ฝ๋๋ฅผ ์๋์ผ๋ก ๋ถ๋ฌ์ค๊ณ ์คํํ๊ธฐ ์์ ๋ฐ๋์ ์จ๋ผ์ธ์ผ๋ก ํด๋น ์ฝ๋์ ์ ๋ขฐ์ฑ์ ๊ฒ์ฌํ์ธ์!
|
|
|
|
</Tip>
|
|
|
|
```py
|
|
from diffusers import DiffusionPipeline
|
|
|
|
pipeline = DiffusionPipeline.from_pretrained(
|
|
"google/ddpm-cifar10-32", custom_pipeline="hf-internal-testing/diffusers-dummy-pipeline"
|
|
)
|
|
```
|
|
|
|
๊ณต์ ์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ์ ๋ถ๋ฌ์ค๋ ๊ฒ์ ๋น์ทํ์ง๋ง, ๊ณต์ ๋ฆฌํฌ์งํ ๋ฆฌ ID์์ ๊ฐ์ค์น๋ฅผ ๋ถ๋ฌ์ค๋ ๊ฒ๊ณผ ๋๋ถ์ด ํด๋น ํ์ดํ๋ผ์ธ ๋ด์ ์ปดํฌ๋ํธ๋ฅผ ์ง์ ์ง์ ํ๋ ๊ฒ ์ญ์ ๊ฐ๋ฅํฉ๋๋ค. ์๋ ์์ ๋ฅผ ๋ณด๋ฉด ์ปค๋ฎค๋ํฐ [CLIP Guided Stable Diffusion](https://github.com/huggingface/diffusers/tree/main/examples/community#clip-guided-stable-diffusion) ํ์ดํ๋ผ์ธ์ ๋ก๋ํ ๋, ํด๋น ํ์ดํ๋ผ์ธ์์ ์ฌ์ฉํ `clip_model` ์ปดํฌ๋ํธ์ `feature_extractor` ์ปดํฌ๋ํธ๋ฅผ ์ง์ ์ค์ ํ๋ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค.
|
|
|
|
```py
|
|
from diffusers import DiffusionPipeline
|
|
from transformers import CLIPImageProcessor, CLIPModel
|
|
|
|
clip_model_id = "laion/CLIP-ViT-B-32-laion2B-s34B-b79K"
|
|
|
|
feature_extractor = CLIPImageProcessor.from_pretrained(clip_model_id)
|
|
clip_model = CLIPModel.from_pretrained(clip_model_id)
|
|
|
|
pipeline = DiffusionPipeline.from_pretrained(
|
|
"runwayml/stable-diffusion-v1-5",
|
|
custom_pipeline="clip_guided_stable_diffusion",
|
|
clip_model=clip_model,
|
|
feature_extractor=feature_extractor,
|
|
)
|
|
```
|
|
|
|
์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ์ ๋ํ ์์ธํ ๋ด์ฉ์ [์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ](https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/custom_pipeline_examples) ๊ฐ์ด๋๋ฅผ ์ดํด๋ณด์ธ์. ์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ ๋ฑ๋ก์ ๊ด์ฌ์ด ์๋ ๊ฒฝ์ฐ [์ปค๋ฎค๋ํฐ ํ์ดํ๋ผ์ธ์ ๊ธฐ์ฌํ๋ ๋ฐฉ๋ฒ](https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/contribute_pipeline)์ ๋ํ ๊ฐ์ด๋๋ฅผ ํ์ธํ์ธ์ ! |