Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -167,6 +167,15 @@ def generate(prompt,
|
|
| 167 |
downscaled_height, downscaled_width = int(expected_height * downscale_factor), int(expected_width * downscale_factor)
|
| 168 |
downscaled_height, downscaled_width = round_to_nearest_resolution_acceptable_by_vae(downscaled_height, downscaled_width)
|
| 169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
latents = pipe(
|
| 171 |
conditions=condition1,
|
| 172 |
prompt=prompt,
|
|
@@ -177,7 +186,7 @@ def generate(prompt,
|
|
| 177 |
num_inference_steps=steps,
|
| 178 |
decode_timestep = 0.05,
|
| 179 |
decode_noise_scale = 0.025,
|
| 180 |
-
timesteps=
|
| 181 |
image_cond_noise_scale=0.0, # testing
|
| 182 |
guidance_rescale=0.7,# testing
|
| 183 |
guidance_scale=guidance_scale,
|
|
@@ -206,7 +215,7 @@ def generate(prompt,
|
|
| 206 |
num_frames=num_frames,
|
| 207 |
guidance_scale=guidance_scale,
|
| 208 |
denoise_strength=0.999, # Effectively, 3 inference steps out of 4
|
| 209 |
-
timesteps=
|
| 210 |
num_inference_steps=10,
|
| 211 |
latents=upscaled_latents,
|
| 212 |
decode_timestep=0.05,
|
|
|
|
| 167 |
downscaled_height, downscaled_width = int(expected_height * downscale_factor), int(expected_width * downscale_factor)
|
| 168 |
downscaled_height, downscaled_width = round_to_nearest_resolution_acceptable_by_vae(downscaled_height, downscaled_width)
|
| 169 |
|
| 170 |
+
timesteps_first_pass = [1000, 993, 987, 981, 975, 909, 725]
|
| 171 |
+
timesteps_second_pass = [1000, 909, 725, 421]
|
| 172 |
+
if steps == 8:
|
| 173 |
+
timesteps_first_pass = [1000, 993, 987, 981, 975, 909, 725, 0.03]
|
| 174 |
+
timesteps_second_pass = [1000, 909, 725, 421, 0]
|
| 175 |
+
elif 7 < steps < 8:
|
| 176 |
+
timesteps_first_pass = None
|
| 177 |
+
timesteps_second_pass = None
|
| 178 |
+
|
| 179 |
latents = pipe(
|
| 180 |
conditions=condition1,
|
| 181 |
prompt=prompt,
|
|
|
|
| 186 |
num_inference_steps=steps,
|
| 187 |
decode_timestep = 0.05,
|
| 188 |
decode_noise_scale = 0.025,
|
| 189 |
+
timesteps = timesteps_first_pass, #[1.0000, 0.9937, 0.9875, 0.9812, 0.9750, 0.9094, 0.7250]
|
| 190 |
image_cond_noise_scale=0.0, # testing
|
| 191 |
guidance_rescale=0.7,# testing
|
| 192 |
guidance_scale=guidance_scale,
|
|
|
|
| 215 |
num_frames=num_frames,
|
| 216 |
guidance_scale=guidance_scale,
|
| 217 |
denoise_strength=0.999, # Effectively, 3 inference steps out of 4
|
| 218 |
+
timesteps= timesteps_second_pass,
|
| 219 |
num_inference_steps=10,
|
| 220 |
latents=upscaled_latents,
|
| 221 |
decode_timestep=0.05,
|