Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

Merge origin/main into feat/webv2-reference-detail-cost

Lincoln Stein19b26d33d493
diff --cc invokeai/frontend/webv2/src/features/video/ui/VideoReferenceListField.tsx
index 50d8abbcbd,53ac4f20a8..ce54bbb59f
--- a/invokeai/frontend/webv2/src/features/video/ui/VideoReferenceListField.tsx
+++ b/invokeai/frontend/webv2/src/features/video/ui/VideoReferenceListField.tsx
@@@ -13,8 -13,12 +13,14 @@@ import { useDndContext, useDndMonitor,
import { galleryItems, galleryTransfers, toGalleryItemKey } from '@features/gallery';
import { GalleryPickerPopover } from '@features/gallery/picker';
import { galleryImageUrls, galleryVideoUrls, isGalleryItemDragData } from '@features/gallery/utility';
+import { resolveMiniMaxH3ReferenceImage } from '@features/video/core/dimensions';
- import { createVideoSourceClip, getDefaultReferenceImageDetail } from '@features/video/core/settings';
+ import {
+ createVideoSourceClip,
+ DEFAULT_REFERENCE_SAMPLE_FRAMES,
++ getDefaultReferenceImageDetail,
+ resizeReferenceSampleWindow,
+ slideReferenceSampleWindow,
+ } from '@features/video/core/settings';
import {
assertAccountScopeCurrent,
captureAccountScope,
@@@ -135,16 -141,14 +146,24 @@@ const ReferenceCard = memo(function Ref
},
[index, onUpdate, reference]
);
+ // What this reference will actually cost, at the size the graph will encode it: the two
+ // detail settings differ by an order of magnitude in rows, and nothing else in the panel
+ // says so before the generation is queued.
+ const imageCost = useMemo(
+ () =>
+ reference.kind === 'image'
+ ? resolveMiniMaxH3ReferenceImage(reference.image.width, reference.image.height, reference.detail, targetArea)
+ : null,
+ [reference, targetArea]
+ );
+ // The window's length, and the seconds it represents — the label carries the seconds
+ // because the control is how a user hits a target sample duration (reference frames cost
+ // denoise VRAM every step), while its unit has to stay frames to match the trim contract.
+ const sampleFrames = reference.kind === 'video' ? reference.clip.endFrame - reference.clip.startFrame + 1 : 0;
+ const sampleSeconds =
+ reference.kind === 'video' && Number.isFinite(reference.clip.fps) && reference.clip.fps > 0
+ ? (sampleFrames / reference.clip.fps).toFixed(1)
+ : null;
const handleMoveUp = useCallback(() => onMove(index, -1), [index, onMove]);
const handleMoveDown = useCallback(() => onMove(index, 1), [index, onMove]);
const handleRemove = useCallback(() => onRemove(index), [index, onRemove]);
@@@ -177,18 -181,12 +196,21 @@@
value={selectValue}
onValueChange={handleSelect}
/>
+ {imageCost ? (
+ <Text color="fg.muted" fontSize="2xs" fontVariantNumeric="tabular-nums">
+ {t('widgets.video.referenceImageCost', {
+ height: imageCost.dimensions.height,
+ rows: imageCost.rows.toLocaleString(),
+ width: imageCost.dimensions.width,
+ })}
+ </Text>
+ ) : null}
- {/* One row per trim bound: the bound's live frame at left, its slider at
- right. The seeking thumbs replace the static gallery poster for video
- references — the start-frame thumb is the card's visual identity. */}
+ {/* One row per window edge: the live frame at left, its control at right. The
+ seeking thumbs replace the static gallery poster for video references — the
+ start-frame thumb is the card's visual identity. The second row's SLIDER is
+ the sample length (the quantity that costs VRAM); its THUMB still shows the
+ resulting end frame, badged with that frame number since the number field
+ beside it shows the length, not the frame. */}
{reference.kind === 'video' ? (
<Stack gap="1">
<HStack gap="2">