* Docs kr update 3 controlnet, reproducibility ์ ๋ก๋ generator ๊ทธ๋๋ก ์ฌ์ฉ seamless multi-GPU ๊ทธ๋๋ก ์ฌ์ฉ create_dataset ๋ฒ์ญ 1์ฐจ stable_diffusion_jax new translation Add coreml, tome kr docs minor fix translate training/instructpix2pix fix training/instructpix2pix.mdx using-diffusers/weighting_prompts ๋ฒ์ญ 1์ฐจ add SDXL docs Translate using-diffuers/loading_overview.md translate using-diffusers/textual_inversion_inference.md Conditional image generation (#37) * stable_diffusion_jax * index_update * index_update * condition_image_generation --------- Co-authored-by: Seongsu Park <tjdtnsu@gmail.com> jihwan/stable_diffusion.mdx custom_diffusion ์์ ์๋ฃ quicktour ์์ ์๋ฃ distributed inference & control brightness (#40) * distributed_inference.mdx * control_brightness --------- Co-authored-by: idra79haza <idra79haza@github.com> Co-authored-by: Seongsu Park <tjdtnsu@gmail.com> using_safetensors (#41) * distributed_inference.mdx * control_brightness * using_safetensors.mdx --------- Co-authored-by: idra79haza <idra79haza@github.com> Co-authored-by: Seongsu Park <tjdtnsu@gmail.com> delete safetensor short * Repace mdx to md * toctree update * Add controlling_generation * toctree fix * colab link, minor fix * docs name typo fix * frontmatter fix * translation fix
2.3 KiB
์ด๋ฏธ์ง ๋ฐ๊ธฐ ์กฐ์ ํ๊ธฐ
Stable Diffusion ํ์ดํ๋ผ์ธ์ ์ผ๋ฐ์ ์ธ ๋ํจ์ ๋
ธ์ด์ฆ ์ค์ผ์ค๊ณผ ์ํ ๋จ๊ณ์ ๊ฒฐํจ์ด ์์ ๋
ผ๋ฌธ์์ ์ค๋ช
ํ ๊ฒ์ฒ๋ผ ๋งค์ฐ ๋ฐ๊ฑฐ๋ ์ด๋์ด ์ด๋ฏธ์ง๋ฅผ ์์ฑํ๋ ๋ฐ๋ ์ฑ๋ฅ์ด ํ๋ฒํฉ๋๋ค. ์ด ๋
ผ๋ฌธ์์ ์ ์ํ ์๋ฃจ์
์ ํ์ฌ [DDIMScheduler]์ ๊ตฌํ๋์ด ์์ผ๋ฉฐ ์ด๋ฏธ์ง์ ๋ฐ๊ธฐ๋ฅผ ๊ฐ์ ํ๋ ๋ฐ ์ฌ์ฉํ ์ ์์ต๋๋ค.
๐ก ์ ์๋ ์๋ฃจ์ ์ ๋ํ ์์ธํ ๋ด์ฉ์ ์์ ๋งํฌ๋ ๋ ผ๋ฌธ์ ์ฐธ๊ณ ํ์ธ์!
ํด๊ฒฐ์ฑ
์ค ํ๋๋ v ์์ธก๊ฐ๊ณผ v ๋ก์ค๋ก ๋ชจ๋ธ์ ํ๋ จํ๋ ๊ฒ์
๋๋ค. ๋ค์ flag๋ฅผ train_text_to_image.py ๋๋ train_text_to_image_lora.py ์คํฌ๋ฆฝํธ์ ์ถ๊ฐํ์ฌ v_prediction์ ํ์ฑํํฉ๋๋ค:
--prediction_type="v_prediction"
์๋ฅผ ๋ค์ด, v_prediction์ผ๋ก ๋ฏธ์ธ ์กฐ์ ๋ ptx0/pseudo-journey-v2 ์ฒดํฌํฌ์ธํธ๋ฅผ ์ฌ์ฉํด ๋ณด๊ฒ ์ต๋๋ค.
๋ค์์ผ๋ก [DDIMScheduler]์์ ๋ค์ ํ๋ผ๋ฏธํฐ๋ฅผ ์ค์ ํฉ๋๋ค:
- rescale_betas_zero_snr=True`, ๋ ธ์ด์ฆ ์ค์ผ์ค์ ์ ๋ก ํฐ๋ฏธ๋ ์ ํธ ๋ ์ก์๋น(SNR)๋ก ์ฌ์กฐ์ ํฉ๋๋ค.
timestep_spacing="trailing", ๋ง์ง๋ง ํ์์คํ ๋ถํฐ ์ํ๋ง ์์
>>> from diffusers import DiffusionPipeline, DDIMScheduler
>>> pipeline = DiffusionPipeline.from_pretrained("ptx0/pseudo-journey-v2")
# switch the scheduler in the pipeline to use the DDIMScheduler
>>> pipeline.scheduler = DDIMScheduler.from_config(
... pipeline.scheduler.config, rescale_betas_zero_snr=True, timestep_spacing="trailing"
... )
>>> pipeline.to("cuda")
๋ง์ง๋ง์ผ๋ก ํ์ดํ๋ผ์ธ์ ๋ํ ํธ์ถ์์ guidance_rescale์ ์ค์ ํ์ฌ ๊ณผ๋ค ๋
ธ์ถ์ ๋ฐฉ์งํฉ๋๋ค:
prompt = "A lion in galaxies, spirals, nebulae, stars, smoke, iridescent, intricate detail, octane render, 8k"
image = pipeline(prompt, guidance_rescale=0.7).images[0]
