Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ class ModelWrapper:
|
|
77 |
def _get_time():
|
78 |
return time.time()
|
79 |
|
80 |
-
|
81 |
def sample(self, noise, unet_added_conditions, prompt_embed, fast_vae_decode):
|
82 |
#alphas_cumprod = self.scheduler.alphas_cumprod.to(self.device)
|
83 |
print("sampling...")
|
@@ -161,7 +161,7 @@ class ModelWrapper:
|
|
161 |
|
162 |
return output_image_list, f"Run successfully in {(end_time-start_time):.2f} seconds"
|
163 |
|
164 |
-
|
165 |
def get_x0_from_noise(sample, model_output, alphas_cumprod, timestep):
|
166 |
alpha_prod_t = alphas_cumprod[timestep].reshape(-1, 1, 1, 1)
|
167 |
beta_prod_t = 1 - alpha_prod_t
|
|
|
77 |
def _get_time():
|
78 |
return time.time()
|
79 |
|
80 |
+
|
81 |
def sample(self, noise, unet_added_conditions, prompt_embed, fast_vae_decode):
|
82 |
#alphas_cumprod = self.scheduler.alphas_cumprod.to(self.device)
|
83 |
print("sampling...")
|
|
|
161 |
|
162 |
return output_image_list, f"Run successfully in {(end_time-start_time):.2f} seconds"
|
163 |
|
164 |
+
@spaces.GPU()
|
165 |
def get_x0_from_noise(sample, model_output, alphas_cumprod, timestep):
|
166 |
alpha_prod_t = alphas_cumprod[timestep].reshape(-1, 1, 1, 1)
|
167 |
beta_prod_t = 1 - alpha_prod_t
|