Spaces:
Runtime error
Runtime error
Commit
โข
b49cdb5
1
Parent(s):
2b76b0f
Update app.py
Browse files
app.py
CHANGED
@@ -30,14 +30,15 @@ TARGET_CHANNEL_ID = int(os.getenv('DISCORD_CHANNEL_ID')) # ์ฑ๋ ID๋ ์ ์
|
|
30 |
# ๊ณ ์ ๋ ๋ค๊ฑฐํฐ๋ธ ํ๋กฌํํธ
|
31 |
negative_prompt = "blur, low quality, bad composition, ugly, disfigured, weird colors, low quality, jpeg artifacts, lowres, grainy, deformed structures, blurry, opaque, low contrast, distorted details, details are low"
|
32 |
|
33 |
-
# ๋๋ฐ์ด์ค ์ค์ (
|
34 |
-
device = "cpu"
|
|
|
35 |
|
36 |
# Hugging Face ์ธ์ฆ
|
37 |
hf_token = os.getenv('HF_TOKEN')
|
38 |
|
39 |
-
# ์ด๋ฏธ์ง ์์ฑ ํ์ดํ๋ผ์ธ ์ค์ (
|
40 |
-
pipeline = DiffusionPipeline.from_pretrained("fluently/Fluently-XL-Final", torch_dtype=torch.
|
41 |
pipeline = pipeline.to(device)
|
42 |
|
43 |
# ํ๋กฌํํธ ๋ฒ์ญ ํจ์
|
@@ -109,3 +110,4 @@ if __name__ == "__main__":
|
|
109 |
|
110 |
|
111 |
|
|
|
|
30 |
# ๊ณ ์ ๋ ๋ค๊ฑฐํฐ๋ธ ํ๋กฌํํธ
|
31 |
negative_prompt = "blur, low quality, bad composition, ugly, disfigured, weird colors, low quality, jpeg artifacts, lowres, grainy, deformed structures, blurry, opaque, low contrast, distorted details, details are low"
|
32 |
|
33 |
+
# ๋๋ฐ์ด์ค ์ค์ (GPU ์ฌ์ฉ)
|
34 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
35 |
+
logging.info(f"๋๋ฐ์ด์ค ์ค์ : {device}")
|
36 |
|
37 |
# Hugging Face ์ธ์ฆ
|
38 |
hf_token = os.getenv('HF_TOKEN')
|
39 |
|
40 |
+
# ์ด๋ฏธ์ง ์์ฑ ํ์ดํ๋ผ์ธ ์ค์ (GPU ์ฌ์ฉ ๋ฐ Hugging Face ํ ํฐ ์ฌ์ฉ)
|
41 |
+
pipeline = DiffusionPipeline.from_pretrained("fluently/Fluently-XL-Final", torch_dtype=torch.float16, use_auth_token=hf_token)
|
42 |
pipeline = pipeline.to(device)
|
43 |
|
44 |
# ํ๋กฌํํธ ๋ฒ์ญ ํจ์
|
|
|
110 |
|
111 |
|
112 |
|
113 |
+
|