BleachNick's picture
upload required packages
87d40d2
|
raw
history blame
2.38 kB

이미지 밝기 μ‘°μ ˆν•˜κΈ°

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]μ—μ„œ λ‹€μŒ νŒŒλΌλ―Έν„°λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€:

  1. rescale_betas_zero_snr=True`, λ…Έμ΄μ¦ˆ μŠ€μΌ€μ€„μ„ 제둜 터미널 μ‹ ν˜Έ λŒ€ μž‘μŒλΉ„(SNR)둜 μž¬μ‘°μ •ν•©λ‹ˆλ‹€.
  2. 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]