Spaces:
Sleeping
Sleeping
이미지 변환
Browse files
image.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from diffusers import StableDiffusionXLPipeline
|
2 |
+
import torch
|
3 |
+
|
4 |
+
# 모델 로드 (SDXL Base 1.0)
|
5 |
+
pipe = StableDiffusionXLPipeline.from_pretrained(
|
6 |
+
"stabilityai/stable-diffusion-xl-base-1.0",
|
7 |
+
torch_dtype=torch.float16,
|
8 |
+
variant="fp16",
|
9 |
+
use_safetensors=True
|
10 |
+
).to("cuda")
|
11 |
+
|
12 |
+
# 텍스트 프롬프트
|
13 |
+
prompt = '그녀를 바라보는 한 남자의 야망'
|
14 |
+
|
15 |
+
|
16 |
+
# 이미지 생성
|
17 |
+
image = pipe(prompt=prompt).images[0]
|
18 |
+
image.save("output_scene2.png")
|
19 |
+
print("✅ 이미지 저장 완료: output_scene2.png")
|