Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,9 +2,9 @@ import gradio as gr
|
|
| 2 |
import numpy as np
|
| 3 |
import random
|
| 4 |
|
| 5 |
-
|
| 6 |
-
from diffusers import DiffusionPipeline
|
| 7 |
import torch
|
|
|
|
| 8 |
|
| 9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 10 |
model_repo_id = "SG161222/RealVisXL_V5.0" # Replace to the model you would like to use
|
|
@@ -14,7 +14,7 @@ if torch.cuda.is_available():
|
|
| 14 |
else:
|
| 15 |
torch_dtype = torch.float32
|
| 16 |
|
| 17 |
-
pipe =
|
| 18 |
pipe = pipe.to(device)
|
| 19 |
|
| 20 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
|
| 2 |
import numpy as np
|
| 3 |
import random
|
| 4 |
|
| 5 |
+
import spaces #[uncomment to use ZeroGPU]
|
|
|
|
| 6 |
import torch
|
| 7 |
+
from diffusers import StableDiffusionXLPipeline
|
| 8 |
|
| 9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 10 |
model_repo_id = "SG161222/RealVisXL_V5.0" # Replace to the model you would like to use
|
|
|
|
| 14 |
else:
|
| 15 |
torch_dtype = torch.float32
|
| 16 |
|
| 17 |
+
pipe = StableDiffusionXLPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
| 18 |
pipe = pipe.to(device)
|
| 19 |
|
| 20 |
MAX_SEED = np.iinfo(np.int32).max
|