videos: per-request shift/audio_shift; the fried look is decode/quant, not schedule

Adds `shift` (video) and `audio_shift` (soundtrack) as per-request /v1/videos
fields, (0,100], each defaulting to the model's trained shift; echoed in the
video object and advertised in the model card as video_shift/video_audio_shift.

ABI-invisible: VideoRequest carries the two doubles, video_schedule() re-shifts
that stream's sigma grid, and the shifted sigmas ride RadVideoGenBatch::sched --
the plugin reads only sigmas/timesteps, never a shift scalar, so RAD_ABI_VERSION
stays 24 and no plugin rebuilds.

Diagnosis (cont.20): the review batch's blown-highlight/crushed-black "fried"
look is present in the text-only T2VA control at native res (clip 54-79% vs the
reference's ~4.5%), so it is not the keyframe/tower path (#52) and not a
regression (old ex10 T2VA has clip 51%). It is not the sampler (euler vs
res_multistep: clip 53-61% vs 56-65%) and not the shift: the container already
runs 12/3 (the reference's settings) and shift=4 leaves clip at ~54%. With
sampler, shift and CFG (=1, no guidance) all matched, the gap is downstream of
the schedule -- the video VAE decode scale parity and/or the DiT int8 quant, i.e.
#37/#44/#45. The shift field ships regardless: correct, useful, and requested.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
gearwave00001andClaude committed 2026-10-21 09:11:34 -05:00
1 parent cd393a0973
commit 3a7a79fb47
9 files changed
+149 -9

No files matched your search

+10 -6
View File
@@ -123,17 +123,21 @@ static std::vector<float> rung_sigmas(double shift, const double* rungs, int32_t
return s;
}
VideoSchedule video_schedule(const RadVideoGenDecl& d, int32_t steps) {
VideoSchedule video_schedule(const RadVideoGenDecl& d, int32_t steps, double shift_video,
double shift_audio) {
/* A request's shift overrides the declaration's per stream; 0 keeps the trained value. */
const double sv = shift_video > 0.0 ? shift_video : d.shift_video;
const double sa = shift_audio > 0.0 ? shift_audio : d.shift_audio;
VideoSchedule v;
if (d.n_rungs > 0) {
if (steps != d.n_rungs + 1) return v;
v.sig_v = rung_sigmas(d.shift_video, d.rungs, d.n_rungs);
v.sig_a = rung_sigmas(d.shift_audio, d.rungs, d.n_rungs);
v.sig_v = rung_sigmas(sv, d.rungs, d.n_rungs);
v.sig_a = rung_sigmas(sa, d.rungs, d.n_rungs);
v.steps = d.n_rungs;
return v;
}
v.sig_v = shifted_sigmas(d.shift_video, steps);
v.sig_a = shifted_sigmas(d.shift_audio, steps);
v.sig_v = shifted_sigmas(sv, steps);
v.sig_a = shifted_sigmas(sa, steps);
const size_t n = std::min(v.sig_v.size(), v.sig_a.size());
v.steps = n > 0 ? (int32_t)(n - 1) : 0;
return v;
@@ -637,7 +641,7 @@ int VideoDriver::submit(std::unique_ptr<VideoRequest> r, std::string* why) {
return no("the model could not lay this video out");
j->step_rows = j->rows;
}
j->sched = video_schedule(d, steps);
j->sched = video_schedule(d, steps, r->shift_video, r->shift_audio);
if (j->sched.steps < 1) return no("the schedule has no steps");
if (r->upscale > 1.0) {
if (!(d.upscale_max > 1.0)) return no("this model has no latent upscaler");