Spaces:
Runtime error
Runtime error
Commit
·
f862768
1
Parent(s):
6e2805f
update
Browse files- app.py +8 -2
- requirements.txt +3 -3
app.py
CHANGED
|
@@ -23,7 +23,13 @@ os.system("mv IP-Adapter/sdxl_models sdxl_models")
|
|
| 23 |
|
| 24 |
# global variable
|
| 25 |
MAX_SEED = np.iinfo(np.int32).max
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
dtype = torch.float16 if str(device).__contains__("cuda") else torch.float32
|
| 28 |
|
| 29 |
# initialization
|
|
@@ -331,4 +337,4 @@ with block:
|
|
| 331 |
|
| 332 |
gr.Markdown(article)
|
| 333 |
|
| 334 |
-
block.launch()
|
|
|
|
| 23 |
|
| 24 |
# global variable
|
| 25 |
MAX_SEED = np.iinfo(np.int32).max
|
| 26 |
+
if torch.cuda.is_available():
|
| 27 |
+
device = torch.device("cuda")
|
| 28 |
+
elif torch.backends.mps.is_available():
|
| 29 |
+
device = torch.device("mps")
|
| 30 |
+
else:
|
| 31 |
+
device = torch.device("cpu")
|
| 32 |
+
#device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 33 |
dtype = torch.float16 if str(device).__contains__("cuda") else torch.float32
|
| 34 |
|
| 35 |
# initialization
|
|
|
|
| 337 |
|
| 338 |
gr.Markdown(article)
|
| 339 |
|
| 340 |
+
block.launch()
|
requirements.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
diffusers>=0.25.1
|
| 2 |
-
torch>=2.0.0
|
| 3 |
-
torchvision>=0.15.1
|
| 4 |
transformers>=4.37.1
|
| 5 |
accelerate
|
| 6 |
safetensors
|
|
@@ -13,4 +13,4 @@ opencv-python
|
|
| 13 |
gradio
|
| 14 |
controlnet_aux
|
| 15 |
gdown
|
| 16 |
-
peft
|
|
|
|
| 1 |
diffusers>=0.25.1
|
| 2 |
+
#torch>=2.0.0
|
| 3 |
+
#torchvision>=0.15.1
|
| 4 |
transformers>=4.37.1
|
| 5 |
accelerate
|
| 6 |
safetensors
|
|
|
|
| 13 |
gradio
|
| 14 |
controlnet_aux
|
| 15 |
gdown
|
| 16 |
+
peft
|