mirror of
https://github.com/Anil-matcha/Open-Generative-AI.git
synced 2026-05-07 01:17:18 +00:00
Video generation fix
This commit is contained in:
parent
ade8e20fe8
commit
a85089c607
1 changed files with 29 additions and 6 deletions
|
|
@ -877,12 +877,35 @@ export function VideoStudio() {
|
|||
}
|
||||
|
||||
if (imageMode) {
|
||||
await new Promise(resolve => setTimeout(resolve, 2500));
|
||||
const genId = Date.now().toString();
|
||||
lastGenerationId = genId;
|
||||
lastGenerationModel = selectedModel;
|
||||
addToHistory({ id: genId, url: 'https://cdn.muapi.ai/outputs/96bbb7e2df3241c5a27971726a615ef1.mp4', prompt, model: selectedModel, aspect_ratio: selectedAr, duration: selectedDuration, timestamp: new Date().toISOString() });
|
||||
showVideoInCanvas('https://cdn.muapi.ai/outputs/96bbb7e2df3241c5a27971726a615ef1.mp4', selectedModel);
|
||||
const i2vParams = {
|
||||
model: selectedModel,
|
||||
image_url: uploadedImageUrl,
|
||||
};
|
||||
if (prompt) i2vParams.prompt = prompt;
|
||||
i2vParams.aspect_ratio = selectedAr;
|
||||
const durations = getCurrentDurations(selectedModel);
|
||||
if (durations.length > 0) i2vParams.duration = selectedDuration;
|
||||
const resolutions = getCurrentResolutions(selectedModel);
|
||||
if (resolutions.length > 0) i2vParams.resolution = selectedResolution;
|
||||
if (selectedQuality) i2vParams.quality = selectedQuality;
|
||||
|
||||
const res = await muapi.generateI2V(i2vParams);
|
||||
console.log('[VideoStudio] I2V response:', res);
|
||||
|
||||
if (res && res.url) {
|
||||
const genId = res.id || res.request_id || Date.now().toString();
|
||||
if (selectedModel === 'seedance-v2.0-i2v') {
|
||||
lastGenerationId = genId;
|
||||
lastGenerationModel = selectedModel;
|
||||
} else {
|
||||
lastGenerationId = null;
|
||||
lastGenerationModel = null;
|
||||
}
|
||||
addToHistory({ id: genId, url: res.url, prompt, model: selectedModel, aspect_ratio: selectedAr, duration: selectedDuration, timestamp: new Date().toISOString() });
|
||||
showVideoInCanvas(res.url, selectedModel);
|
||||
} else {
|
||||
throw new Error('No video URL returned by API');
|
||||
}
|
||||
generateBtn.disabled = false;
|
||||
generateBtn.innerHTML = `Generate ✨`;
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue