YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
stable diffusion 2.1์ vae๋ฅผ ํ์ธํ๋ํ ๋ชจ๋ธ์ ๋๋ค vaeํด๋์ ์๋ ๋ชจ๋ธ์ ์ dataset์ฌ์ฉํ l1+0.1*lpips , 15epoch๋ชจ๋ธ์ ๋๋ค!
ํ์ธํ๋๋ ๋ชจ๋ธ๋ก stable diffusion ๋๋ฆฌ๊ธฐ!
from transformers import AutoTokenizer
from diffusers import StableDiffusionPipeline
import torch
from IPython.display import display # display ํจ์ ๋ถ๋ฌ์ค๊ธฐ
# Stable Diffusion 2.1 ๋ชจ๋ธ์ ๋ถ๋ฌ์ต๋๋ค
model_id = "stabilityai/stable-diffusion-2-1"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe.to("cuda") # GPU ์ฌ์ฉ ์ค์
# ์ ์ฅ๋ VAE ๊ฐ์ค์น ๋ถ๋ฌ์ค๊ธฐ
vae_path = "pytorch_model.bin" # ํ์ธํ๋ํ VAE ๊ฐ์ค์น ํ์ผ ๊ฒฝ๋ก
vae_weights = torch.load(vae_path) # VAE ๊ฐ์ค์น ๋ถ๋ฌ์ค๊ธฐ
# ํ์ดํ๋ผ์ธ์ VAE ๋ชจ๋ธ์ ๊ฐ์ค์น๋ฅผ ๋ฎ์ด์์ฐ๊ธฐ
pipe.vae.load_state_dict(vae_weights) # ํ์ดํ๋ผ์ธ์ VAE์ ๊ฐ์ค์น ์ ์ฉ
pipe.vae.to("cuda") # GPU๋ก ์ด๋
# ํ๋กฌํํธ ์ค์ ๋ฐ ์ด๋ฏธ์ง ์์ฑ
prompt = "a vector illustration of a man"
image = pipe(prompt).images[0]
# Jupyter Notebook ์์์ ์ด๋ฏธ์ง๋ฅผ ๋ฐ๋ก ํ์
display(image)
- Downloads last month
- 89
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support