Repository navigation
feat(video): accept a start frame image for fal.ai video models #9761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
myxamediyar
wants to merge
7
commits into
staging
Choose a base branch
from
feat/fal-video-start-frame
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2d1977e
feat(video): accept a start frame image for fal.ai video models
myxamediyar 9dbd38c
fix(video): keep fal settings enabled without a start frame
myxamediyar ca301b3
fix(video): send the model default for fal settings a frame change in…
myxamediyar 1d96dc0
fix(video): drop only settings a start frame change made stale
myxamediyar b548760
fix(video): check fal start frame provenance before sending it to the…
waleedlatif1 0dbb2a6
fix(video): pick fal settings from the active start frame input
myxamediyar 9cb862d
fix(video): reject a reference file that is not an image before submi…
myxamediyar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { describe, expect, it } from 'vitest' | ||
| import { evaluateSubBlockCondition } from '@/lib/workflows/subblocks/visibility' | ||
| import { VideoGeneratorV3Block } from '@/blocks/blocks/video_generator' | ||
|
|
||
| const frame = { id: 'f', name: 'frame.png', url: '', size: 3, type: 'image/png', key: 'k' } | ||
|
|
||
| function aspectRatioField() { | ||
| const field = VideoGeneratorV3Block.subBlocks.find((subBlock) => subBlock.id === 'falAspectRatio') | ||
| if (!field) throw new Error('Video Generator must expose a fal aspect ratio field') | ||
| return field | ||
| } | ||
|
|
||
| function optionIds(values: Record<string, unknown>) { | ||
| const { options } = aspectRatioField() | ||
| if (typeof options !== 'function') throw new Error('Fal aspect ratio options must be derived') | ||
| return options({ values }).map((option) => (typeof option === 'string' ? option : option.id)) | ||
| } | ||
|
|
||
| describe('Video Generator fal start frame', () => { | ||
| // Happy Horse takes an aspect ratio from a prompt but not from a start frame. | ||
| const base = { provider: 'falai', model: 'alibaba/happy-horse/text-to-video' } | ||
|
|
||
| it('reads the prompt endpoint when the stored upload is in the inactive mode', () => { | ||
| const values = { | ||
| ...base, | ||
| visualReferenceUpload: frame, | ||
| visualReferenceInput: '', | ||
| __canonicalModes: { visualReference: 'advanced' }, | ||
| } | ||
|
|
||
| expect(evaluateSubBlockCondition(aspectRatioField().condition, values)).toBe(true) | ||
| expect(optionIds(values)).toContain('16:9') | ||
| }) | ||
|
|
||
| it('reads the start frame endpoint when the upload is the active mode', () => { | ||
| const values = { ...base, visualReferenceUpload: frame } | ||
|
|
||
| expect(evaluateSubBlockCondition(aspectRatioField().condition, values)).toBe(false) | ||
| expect(optionIds(values)).not.toContain('16:9') | ||
| }) | ||
| }) |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.