1
This commit is contained in:
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user