Spaces:
Runtime error
Runtime error
Update space
Browse files- model/animagine_xl.py +3 -1
model/animagine_xl.py
CHANGED
|
@@ -10,12 +10,14 @@ def generate_animagine_xl(prompt: str):
|
|
| 10 |
variant="fp16"
|
| 11 |
)
|
| 12 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 13 |
-
|
|
|
|
| 14 |
image = pipe(prompt=prompt, width=1024, height=1024).images[0]
|
| 15 |
image.save("output_animagine_xl.png")
|
| 16 |
print("โ
์ ์ฅ ์๋ฃ: output_animagine_xl.png")
|
| 17 |
return image
|
| 18 |
|
|
|
|
| 19 |
if __name__ == "__main__":
|
| 20 |
prompt = "๊ทธ๋
๋ฅผ ๋ฐ๋ผ๋ณด๋ ํ ๋จ์์ ์ผ๋ง"
|
| 21 |
generate_animagine_xl(prompt)
|
|
|
|
| 10 |
variant="fp16"
|
| 11 |
)
|
| 12 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 13 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 14 |
+
pipe = pipe.to(device)
|
| 15 |
image = pipe(prompt=prompt, width=1024, height=1024).images[0]
|
| 16 |
image.save("output_animagine_xl.png")
|
| 17 |
print("โ
์ ์ฅ ์๋ฃ: output_animagine_xl.png")
|
| 18 |
return image
|
| 19 |
|
| 20 |
+
|
| 21 |
if __name__ == "__main__":
|
| 22 |
prompt = "๊ทธ๋
๋ฅผ ๋ฐ๋ผ๋ณด๋ ํ ๋จ์์ ์ผ๋ง"
|
| 23 |
generate_animagine_xl(prompt)
|