Spaces:
Runtime error
Runtime error
Update pipelines/pipeline_seesr.py
Browse files- pipelines/pipeline_seesr.py +1 -11
pipelines/pipeline_seesr.py
CHANGED
|
@@ -1230,18 +1230,8 @@ class StableDiffusionControlNetPipeline(DiffusionPipeline, TextualInversionLoade
|
|
| 1230 |
sigma_t = beta_t.sqrt()
|
| 1231 |
x0_pred = (latents - sigma_t * noise_pred) / alpha_t
|
| 1232 |
|
| 1233 |
-
_, _, H, W = x0_pred.shape
|
| 1234 |
-
# pick the largest patch_size in {4,8,16,32} that divides both H and W
|
| 1235 |
-
for ps in (32,16,8,4):
|
| 1236 |
-
if H % ps == 0 and W % ps == 0:
|
| 1237 |
-
patch_size = ps
|
| 1238 |
-
break
|
| 1239 |
-
else:
|
| 1240 |
-
# fall back if none match:
|
| 1241 |
-
patch_size = H
|
| 1242 |
-
|
| 1243 |
# 3) Apply KDE steering
|
| 1244 |
-
m_shift = kde_grad(x0_pred
|
| 1245 |
delta_t = gamma_0 * (1 - i / (len(timesteps) - 1))
|
| 1246 |
x0_steer = x0_pred + delta_t * m_shift
|
| 1247 |
|
|
|
|
| 1230 |
sigma_t = beta_t.sqrt()
|
| 1231 |
x0_pred = (latents - sigma_t * noise_pred) / alpha_t
|
| 1232 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1233 |
# 3) Apply KDE steering
|
| 1234 |
+
m_shift = kde_grad(x0_pred)
|
| 1235 |
delta_t = gamma_0 * (1 - i / (len(timesteps) - 1))
|
| 1236 |
x0_steer = x0_pred + delta_t * m_shift
|
| 1237 |
|