Spaces:
Running
on
Zero
Running
on
Zero
Update app_quant_latent.py
Browse files- app_quant_latent.py +9 -9
app_quant_latent.py
CHANGED
|
@@ -273,18 +273,18 @@ sigmas: list = None,
|
|
| 273 |
**kwargs,
|
| 274 |
):
|
| 275 |
if timesteps is not None and sigmas is not None:
|
| 276 |
-
|
| 277 |
if timesteps is not None:
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
elif sigmas is not None:
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
else:
|
| 286 |
-
|
| 287 |
-
|
| 288 |
return timesteps, num_inference_steps
|
| 289 |
|
| 290 |
@spaces.GPU
|
|
|
|
| 273 |
**kwargs,
|
| 274 |
):
|
| 275 |
if timesteps is not None and sigmas is not None:
|
| 276 |
+
raise ValueError("Only one of timesteps or sigmas can be passed")
|
| 277 |
if timesteps is not None:
|
| 278 |
+
scheduler.set_timesteps(timesteps=timesteps, device=device, **kwargs)
|
| 279 |
+
timesteps = scheduler.timesteps
|
| 280 |
+
num_inference_steps = len(timesteps)
|
| 281 |
elif sigmas is not None:
|
| 282 |
+
scheduler.set_timesteps(sigmas=sigmas, device=device, **kwargs)
|
| 283 |
+
timesteps = scheduler.timesteps
|
| 284 |
+
num_inference_steps = len(timesteps)
|
| 285 |
else:
|
| 286 |
+
scheduler.set_timesteps(num_inference_steps, device=device, **kwargs)
|
| 287 |
+
timesteps = scheduler.timesteps
|
| 288 |
return timesteps, num_inference_steps
|
| 289 |
|
| 290 |
@spaces.GPU
|