seawolf2357 commited on
Commit
b49cdb5
โ€ข
1 Parent(s): 2b76b0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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
- # ๋””๋ฐ”์ด์Šค ์„ค์ • (CPU ์‚ฌ์šฉ)
34
- device = "cpu"
 
35
 
36
  # Hugging Face ์ธ์ฆ
37
  hf_token = os.getenv('HF_TOKEN')
38
 
39
- # ์ด๋ฏธ์ง€ ์ƒ์„ฑ ํŒŒ์ดํ”„๋ผ์ธ ์„ค์ • (CPU ์‚ฌ์šฉ ๋ฐ Hugging Face ํ† ํฐ ์‚ฌ์šฉ)
40
- pipeline = DiffusionPipeline.from_pretrained("fluently/Fluently-XL-Final", torch_dtype=torch.float32, use_auth_token=hf_token)
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
+