Archived
driver+server: keyframes ride a latent upscale -- pinned at the small size, then re-encoded at the full size
A keyframe is pinned on the grid the steps run on, which is why 7935897 refused it with
latent_upscale. The pin can follow the switch instead: the server prepares each keyframe at the
small size too, the same way as at the canvas (stretch or centre crop), and the driver encodes
that picture into the keyframe's slot before the prompt pass, runs the small steps on the pack it
already lays out at the small size, and after the VUPSCALE pass encodes the canvas picture into
the same slot before the first full-size evaluation. The plugin reads its slots as before, so
neither the plugin nor the ABI changes; rad_builder.h documents the order. References keep their
own grids and are encoded once, as before.
Host: video_gen_test checks the pass order (E C S S U E S A D), each encode's size and slot and the
step rows at both sizes, and that a keyframe without its small picture is refused; videos_test
checks that each keyframe is prepared at both sizes with its stretch/crop and that the tower still
sees the canvas frame only. GUIDE, the ComfyUI node's README and tooltip no longer say keyframes
refuse latent_upscale.
This commit is contained in:
1 parent
812cdeceb0
commit
9f707a0f67
10 files changed
+181
-33
No files matched your search
+19
-1
@@ -38,7 +38,8 @@
|
||||
* first steps run at `size` divided by it and the latent is enlarged to `size` for the last
|
||||
* `upscale_refine_steps` (the model's default when absent; abi/rad_builder.h, RadVideoGenDecl).
|
||||
* The video object of an upscaled video says how it was made: the factor, the refine steps and the
|
||||
* small size (`upscale_from`).
|
||||
* small size (`upscale_from`). Keyframes ride it: each is prepared at both sizes and pinned at the
|
||||
* one the steps run at.
|
||||
*
|
||||
* The prompt is the model's template with `{prompt}` filled; the template is tokenised with its
|
||||
* special tokens and the prompt without, so a caller cannot write control tokens into it.
|
||||
@@ -742,6 +743,23 @@ HttpResponse Server::handle_video_create(const HttpRequest& req) {
|
||||
&canvas[i], &why) < 0)
|
||||
return bad(m.name.c_str(), "'" + m.name + "' could not be decoded: " + why);
|
||||
pixels(m, { canvas[i] });
|
||||
/* A latent upscale's first steps pin it at their own size, prepared the same way. */
|
||||
if (r->upscale > 1.0) {
|
||||
RadVideoGenDecl geo{}; /* video_small_size reads the size multiple only */
|
||||
geo.size_multiple = info.size_multiple;
|
||||
int32_t sw = 0, sh = 0;
|
||||
gen::video_small_size(geo, r->width, r->height, r->upscale, &sw, &sh);
|
||||
mm::Frame small;
|
||||
if (deps_.mm->encoder_image_canvas((const uint8_t*)m.data.data(), m.data.size(),
|
||||
sw, sh,
|
||||
m.kind == gen::VideoRefMedia::LAST_FRAME ||
|
||||
first_center,
|
||||
&small, &why) < 0)
|
||||
return bad(m.name.c_str(), "'" + m.name + "' could not be decoded: " + why);
|
||||
m.small_h = small.h;
|
||||
m.small_w = small.w;
|
||||
m.small_pixels.assign(small.rgb.begin(), small.rgb.end());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user