Spaces:
Running on Zero
Running on Zero
quantile schedule: optional alpha override (quantile@A) for evaluation
Browse files- mf_stream.py +5 -3
mf_stream.py
CHANGED
|
@@ -373,7 +373,7 @@ def stream_t2i(
|
|
| 373 |
|
| 374 |
``schedule``: "random" = mf's grid (sorted random draws from the training
|
| 375 |
timestep distribution); "quantile" = same distribution at evenly spaced
|
| 376 |
-
quantiles (deterministic).
|
| 377 |
|
| 378 |
Yields ``{"type": "t2i", "step", "steps", "t", "image": Tensor[1,3,H,W] in [0,1]}``
|
| 379 |
and finally ``{"type": "final", "image": Tensor}``.
|
|
@@ -404,10 +404,12 @@ def stream_t2i(
|
|
| 404 |
device=device,
|
| 405 |
noise_scale=sampler.vision_noise_scale,
|
| 406 |
)
|
| 407 |
-
if schedule
|
|
|
|
|
|
|
| 408 |
grid = quantile_clean_time_grid(
|
| 409 |
num_inference_steps=sampler.num_inference_steps,
|
| 410 |
-
alpha=
|
| 411 |
t_lognorm_mu=sampler.t_lognorm_mu,
|
| 412 |
t_lognorm_sigma=sampler.t_lognorm_sigma,
|
| 413 |
device=device,
|
|
|
|
| 373 |
|
| 374 |
``schedule``: "random" = mf's grid (sorted random draws from the training
|
| 375 |
timestep distribution); "quantile" = same distribution at evenly spaced
|
| 376 |
+
quantiles (deterministic); "quantile@A" uses shift alpha A instead.
|
| 377 |
|
| 378 |
Yields ``{"type": "t2i", "step", "steps", "t", "image": Tensor[1,3,H,W] in [0,1]}``
|
| 379 |
and finally ``{"type": "final", "image": Tensor}``.
|
|
|
|
| 404 |
device=device,
|
| 405 |
noise_scale=sampler.vision_noise_scale,
|
| 406 |
)
|
| 407 |
+
if schedule.startswith("quantile"):
|
| 408 |
+
# "quantile" uses the checkpoint's training alpha; "quantile@A" overrides it
|
| 409 |
+
alpha = float(schedule.split("@", 1)[1]) if "@" in schedule else sampler.image_alpha
|
| 410 |
grid = quantile_clean_time_grid(
|
| 411 |
num_inference_steps=sampler.num_inference_steps,
|
| 412 |
+
alpha=alpha,
|
| 413 |
t_lognorm_mu=sampler.t_lognorm_mu,
|
| 414 |
t_lognorm_sigma=sampler.t_lognorm_sigma,
|
| 415 |
device=device,
|