project / model /ghibli.py
seokhyun119's picture
๋ชจ๋ธ ์—…๋กœ๋“œ
4944c37
raw
history blame contribute delete
550 Bytes
from diffusers import StableDiffusionPipeline
import torch
def generate_ghibli(prompt: str):
model_id = "nitrosocke/Ghibli-Diffusion"
pipe = StableDiffusionPipeline.from_pretrained(
model_id,
torch_dtype=torch.float16,
use_safetensors=True
).to("cuda")
image = pipe(prompt=prompt).images[0]
image.save("output_ghibli.png")
print("โœ… ์ €์žฅ ์™„๋ฃŒ: output_ghibli.png")
return image
if __name__ == "__main__":
prompt = "๊ทธ๋…€๋ฅผ ๋ฐ”๋ผ๋ณด๋Š” ํ•œ ๋‚จ์ž์˜ ์•ผ๋ง"
generate_ghibli(prompt)