This commit is contained in:
2026-04-18 13:05:29 +08:00
parent 09d4c0c31b
commit 5032701c38
77 changed files with 8538 additions and 2413 deletions

View File

@@ -405,6 +405,7 @@ export default function QwenSpriteSheetTool() {
setSheetStatus(null);
try {
if (actionGenerationMode === 'image-to-video') {
const isLoopAction = actionTemplate.loop;
const result = await generateCharacterAnimationDraft({
characterId: assetKey || 'qwen-sprite-tool',
strategy: 'image-to-video',
@@ -413,20 +414,21 @@ export default function QwenSpriteSheetTool() {
visualSource: selectedMasterSource,
referenceImageDataUrls: [],
referenceVideoDataUrls: [],
lastFrameImageDataUrl: isLoopAction ? undefined : selectedMasterSource,
frameCount: 16,
fps: actionTemplate.defaultFps,
durationSeconds: FIXED_IMAGE_TO_VIDEO_DURATION_SECONDS,
loop: actionTemplate.loop,
useChromaKey,
resolution: FIXED_IMAGE_TO_VIDEO_RESOLUTION,
resolution: isLoopAction ? '720P' : FIXED_IMAGE_TO_VIDEO_RESOLUTION,
imageSequenceModel: 'wan2.7-image-pro',
videoModel: FIXED_IMAGE_TO_VIDEO_MODEL,
videoModel: isLoopAction ? 'wan2.6-i2v-flash' : FIXED_IMAGE_TO_VIDEO_MODEL,
referenceVideoModel: 'wan2.7-r2v',
motionTransferModel: 'wan2.2-animate-move',
});
if (result.strategy !== 'image-to-video') {
throw new Error('图生视频接口返回了非预期结果。');
throw new Error('动作生成接口返回了非预期结果。');
}
const clip = await buildAnimationClipFromVideoSource(
@@ -439,6 +441,8 @@ export default function QwenSpriteSheetTool() {
frameWidth: GENERATED_FRAME_WIDTH,
frameHeight: GENERATED_FRAME_HEIGHT,
applyChromaKey: useChromaKey,
sampleStartRatio: actionTemplate.loop ? 0.12 : 0,
sampleEndRatio: actionTemplate.loop ? 0.94 : 1,
},
);
const composedSheet = await composeSpriteSheetFromFrames(clip.frames, {