mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-18 07:35:19 +00:00
update when resolution is changed
This commit is contained in:
1 parent
ec879c7041
commit
880846d901
1 file changed
+5
@@ -12,6 +12,7 @@ import {
|
||||
videoModelToCommonVideoModel,
|
||||
videoAspectRatioToCommonAspectRatio,
|
||||
videoStoreToGenerationMode,
|
||||
imageResolutionToCommonVideoResolution,
|
||||
} from "./convert/index.js";
|
||||
|
||||
export function useVideoCostEstimate(
|
||||
@@ -26,6 +27,7 @@ export function useVideoCostEstimate(
|
||||
|
||||
const duration = usePromptVideoStore((s) => s.duration);
|
||||
const aspectRatio = usePromptVideoStore((s) => s.aspectRatio);
|
||||
const resolution = usePromptVideoStore((s) => s.resolution);
|
||||
const inputMode = usePromptVideoStore((s) => s.inputMode);
|
||||
const referenceImages = usePromptVideoStore((s) => s.referenceImages);
|
||||
const endFrameImage = usePromptVideoStore((s) => s.endFrameImage);
|
||||
@@ -47,6 +49,7 @@ export function useVideoCostEstimate(
|
||||
aspectRatio,
|
||||
videoModel.sizeOptions,
|
||||
);
|
||||
const commonResolution = imageResolutionToCommonVideoResolution(resolution);
|
||||
const generationMode = videoStoreToGenerationMode(
|
||||
inputMode,
|
||||
referenceImages,
|
||||
@@ -65,6 +68,7 @@ export function useVideoCostEstimate(
|
||||
provider,
|
||||
generation_mode: generationMode,
|
||||
aspect_ratio: commonAspectRatio ?? undefined,
|
||||
resolution: commonResolution ?? undefined,
|
||||
duration_seconds: duration ?? undefined,
|
||||
generate_audio: generateWithSound,
|
||||
})
|
||||
@@ -88,6 +92,7 @@ export function useVideoCostEstimate(
|
||||
selectedProvider,
|
||||
duration,
|
||||
aspectRatio,
|
||||
resolution,
|
||||
inputMode,
|
||||
referenceImages.length,
|
||||
!!endFrameImage,
|
||||
|
||||
Reference in new issue
Block a user