Repository navigation
Size generated pictures for the video they go into - #29
Merged
Merged
Conversation
A picture was asked for by aspect alone, so FLUX made 1024x576 for a 1080p video and Nano Banana its 1K default: half the frame's width, softer still once a Ken Burns zoom or a crop reads into it. A picture placeholder now targets 1.5x the output frame, in its own aspect. A model that takes any size (GAM-8's custom_size, on FLUX) is asked for exactly that, within its limits. A model with size tiers gets the tier nearest the target that is not smaller than the frame. Against a GAM without GAM-8, FLUX keeps its preset as before. Clips are unchanged. The megapixel estimate now counts fal's whole 1024² megapixels, which is how GAM is billed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1geD2v7vJwCcyYXHHkrxP
davior
marked this pull request as ready for review
October 29, 2026 00:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
GVC asked GAM for a picture by aspect alone:
The result was about half the frame's width, and softer still once a Ken Burns zoom or an S1 crop reads into part of it.
What
target_size(aspect, resolution)is the output frame (render/options.frame_size) ×PICTURE_HEADROOM = 1.5, in the placeholder's own aspect. A 1080p 16:9 video targets 2880×1620; a 1:1 picture in it targets 1620×1620.default_params(…, target=):A model with
custom_size(GAM-8, davior/gam#53) getswidth/height. If the target is over the model's limits, it is shrunk with the aspect kept and rounded to the model's multiple. FLUX at 1080p asks for 2880×1616.A model with size tiers (Nano Banana's
0.5K…4K, Seedream'sauto_2K/4K) gets the tier nearest the target by ratio, but never one smaller than the frame while a larger one exists:"Smallest at or above 1.5×" would have sent every 1080p picture to 4K.
Otherwise behave as before. Against a GAM without GAM-8, FLUX keeps its preset.
Tests
pytest -q: 755 passed. Covers target sizes, custom-size clamping, tier choice and the never-below-the-frame rule, Seedream's auto sizes, the old-GAM fallback, the estimate, and HTTP paths through the fake GAM.npm test: 192 passed.npm run build: clean. No frontend change.Generated by Claude Code