File size: 528 Bytes
1a18034
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0939247
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from diffusers import StableDiffusionXLPipeline
import torch

# ๋ชจ๋ธ ๋กœ๋“œ (SDXL Base 1.0)
pipe = StableDiffusionXLPipeline.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0", 
    torch_dtype=torch.float16,
    variant="fp16",
    use_safetensors=True
).to("cuda")

# ํ…์ŠคํŠธ ํ”„๋กฌํ”„ํŠธ
prompt = '๊ทธ๋…€๋ฅผ ๋ฐ”๋ผ๋ณด๋Š” ํ•œ ๋‚จ์ž์˜ ์•ผ๋ง'


# ์ด๋ฏธ์ง€ ์ƒ์„ฑ
image = pipe(prompt=prompt).images[0]
image.save("output_scene2.png")
print("โœ… ์ด๋ฏธ์ง€ ์ €์žฅ ์™„๋ฃŒ: output_scene2.png")
print("ํ™•์ธ์šฉ")