cuda
Browse files- baseline_utils.py +11 -11
baseline_utils.py
CHANGED
@@ -82,19 +82,19 @@ def generate_comic_book(diary_text, writer_description, num_pages=4):
|
|
82 |
cache_dir="./SDXL-Turbo"
|
83 |
)
|
84 |
|
85 |
-
# Check for available device: CUDA, MPS, or CPU
|
86 |
-
if torch.cuda.is_available():
|
87 |
-
|
88 |
-
|
89 |
-
elif torch.backends.mps.is_available():
|
90 |
-
|
91 |
-
|
92 |
-
else:
|
93 |
-
|
94 |
-
|
95 |
|
96 |
# Move the model to the selected device
|
97 |
-
pipe = pipe.to(
|
98 |
|
99 |
# Create a directory to store the comic book input_images
|
100 |
os.makedirs("comic_book", exist_ok=True)
|
|
|
82 |
cache_dir="./SDXL-Turbo"
|
83 |
)
|
84 |
|
85 |
+
# # Check for available device: CUDA, MPS, or CPU
|
86 |
+
# if torch.cuda.is_available():
|
87 |
+
# device = "cuda"
|
88 |
+
# print("Using CUDA backend.")
|
89 |
+
# elif torch.backends.mps.is_available():
|
90 |
+
# device = "mps"
|
91 |
+
# print("Using MPS backend.")
|
92 |
+
# else:
|
93 |
+
# device = "cpu"
|
94 |
+
# print("CUDA and MPS not available. Falling back to CPU.")
|
95 |
|
96 |
# Move the model to the selected device
|
97 |
+
pipe = pipe.to('cuda')
|
98 |
|
99 |
# Create a directory to store the comic book input_images
|
100 |
os.makedirs("comic_book", exist_ok=True)
|