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

+32
View File
@@ -48,6 +48,8 @@ struct FakeVideoGen : IVideoGen {
inf.max_ref_images = 9;
inf.max_ref_videos = 3;
inf.max_ref_audios = 3;
inf.shift_video = 12.0;
inf.shift_audio = 3.0;
}
const VideoGenInfo& info() const override { return inf; }
int submit(std::unique_ptr<gen::VideoRequest> r, std::string*) override {
@@ -161,6 +163,12 @@ TEST(a_video_request_that_cannot_be_served_names_its_field) {
CHECK_EQ(v.refused(Videos::body({ { "task", "fl2va" } })), std::string("first_frame"));
CHECK_EQ(v.refused(Videos::body({ { "conditions", json::array({ json::object() }) } })),
std::string("conditions"));
/* The shift: (0, 100], a number; 0 / negative / over the cap / non-numeric are refused. */
CHECK_EQ(v.refused(Videos::body({ { "shift", 0 } })), std::string("shift"));
CHECK_EQ(v.refused(Videos::body({ { "shift", -1 } })), std::string("shift"));
CHECK_EQ(v.refused(Videos::body({ { "shift", 200 } })), std::string("shift"));
CHECK_EQ(v.refused(Videos::body({ { "shift", "hot" } })), std::string("shift"));
CHECK_EQ(v.refused(Videos::body({ { "audio_shift", 0 } })), std::string("audio_shift"));
CHECK_EQ(v.refused({ { "prompt", "p" }, { "target", { { "aspect_ratio", "wide" } } } }),
std::string("target"));
CHECK_EQ(v.refused(Videos::body({ { "target", { { "aspect_ratio", "16:9" } } } })),
@@ -216,6 +224,30 @@ TEST(the_generator_gets_the_size_the_chunks_and_the_steps) {
v.wait(str_at(json::parse(r.body, nullptr, false), "id"));
}
/* `shift`/`audio_shift` thread to the request and echo back; omitted, the request carries 0 (the
* driver keeps the model's trained shift) and the echo adds neither field. */
TEST(the_shift_threads_to_the_request_and_echoes) {
Videos v;
HttpResponse r = v.create(Videos::body({ { "shift", 6 }, { "audio_shift", 2 } }));
REQUIRE_EQ(r.status, 200);
CHECK_EQ(v.gen.last().shift_video, 6.0);
CHECK_EQ(v.gen.last().shift_audio, 2.0);
json o = json::parse(r.body, nullptr, false);
CHECK(o.contains("shift"));
CHECK_EQ(o["shift"].get<double>(), 6.0);
CHECK_EQ(o["audio_shift"].get<double>(), 2.0);
v.wait(str_at(o, "id"));
r = v.create(Videos::body());
REQUIRE_EQ(r.status, 200);
CHECK_EQ(v.gen.last().shift_video, 0.0);
CHECK_EQ(v.gen.last().shift_audio, 0.0);
o = json::parse(r.body, nullptr, false);
CHECK(!o.contains("shift"));
CHECK(!o.contains("audio_shift"));
v.wait(str_at(o, "id"));
}
/* Latent upscaling: refused by a model without an upscaler; with one, the factor and the refine
* steps reach the generator, a factor of 1 is none, and the refine steps need a factor. */
TEST(latent_upscale_reaches_the_generator_where_the_model_has_an_upscaler) {