Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -117,6 +117,12 @@ def process(
|
|
117 |
height, width = control.size(-2), control.size(-1)
|
118 |
model.control_scales = [strength] * 13
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
sampler = SpacedSampler(model, var_type="fixed_small")
|
121 |
preds = []
|
122 |
for _ in tqdm(range(num_samples)):
|
|
|
117 |
height, width = control.size(-2), control.size(-1)
|
118 |
model.control_scales = [strength] * 13
|
119 |
|
120 |
+
# Move model and tensors to GPU if available
|
121 |
+
if torch.cuda.is_available():
|
122 |
+
model.to("cuda")
|
123 |
+
control = control.to("cuda")
|
124 |
+
x_T = x_T.to("cuda")
|
125 |
+
|
126 |
sampler = SpacedSampler(model, var_type="fixed_small")
|
127 |
preds = []
|
128 |
for _ in tqdm(range(num_samples)):
|