"; // YAHAN NAYA TOKEN DALO
async function gen(){
const prompt = document.getElementById('prompt').value;
const status = document.getElementById('status');
const videoEl = document.getElementById('vid');
status.style.color="orange";
status.innerText="⏳ 30-40 sec wait karo...";
try{
const res = await fetch("https://api-inference.huggingface.co/models/damo-vilab/modelscope-text-to-video-synth", {
method: "POST",
headers: { "Authorization": "Bearer "+HF_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({inputs: prompt})
});
if(!res.ok){ const t = await res.text(); throw new Error(t); }
const blob = await res.blob();
videoEl.src = URL.createObjectURL(blob);
videoEl.style.display="block";
status.style.color="green";
status.innerText="✅ Ban gayi!";
}catch(e){
status.style.color="red";
status.innerText="❌ Error: "+e.message.slice(0,300);
console.error(e);
}
}