SillyTavern/SillyTavern · error
Video generation failed
Error message
Video generation failed
What it means
Returned (HTTP 500) when the Z.AI async-result poll returns pollResult.task_status === 'FAIL'. The upstream Z.AI job was accepted but later reported failure; the server logs the full pollResult via console.warn and sends the generic string 'Video generation failed'. The real failure reason lives in the logged pollResult, not in the response body.
Source
Thrown at src/endpoints/stable-diffusion.js:2022
method: 'GET',
headers: {
'Authorization': `Bearer ${key}`,
},
});
if (!pollResponse.ok) {
const text = await pollResponse.text();
console.warn('Z.AI video job polling failed', pollResponse.statusText, text);
return response.status(500).send(text);
}
/** @type {any} */
const pollResult = await pollResponse.json();
console.debug(`Z.AI video job status: ${pollResult.task_status}`);
if (pollResult.task_status === 'FAIL') {
console.warn('Z.AI video generation failed', pollResult);
return response.status(500).send('Video generation failed');
}
if (pollResult.task_status === 'SUCCESS') {
console.debug('Z.AI video generation succeeded', pollResult);
const url = pollResult?.video_result?.[0]?.url;
if (!url || !isValidUrl(url)) {
console.warn('Z.AI returned an invalid video URL.');
return response.sendStatus(500);
}
const contentResponse = await fetch(url);
if (!contentResponse.ok) {
const text = await contentResponse.text();
console.warn('Z.AI video content fetch failed', contentResponse.statusText, text);
return response.status(500).send(text);
}
View on GitHub (pinned to 8172dcd0ee)
Solutions
- Read the server console: the console.warn('Z.AI video generation failed', pollResult) line contains the upstream failure detail — match its error code/message.
- Simplify the prompt (remove policy-sensitive terms) and retry.
- Reduce requested size/aspect_ratio/quality to values the video model supports.
- Verify Z.AI account quota/balance and API key validity.
- Retry with a different seed; FAIL can be transient under load.
Example fix
// before
if (pollResult.task_status === 'FAIL') {
console.warn('Z.AI video generation failed', pollResult);
return response.status(500).send('Video generation failed');
}
// after
if (pollResult.task_status === 'FAIL') {
console.warn('Z.AI video generation failed', pollResult);
return response.status(500).send(pollResult?.error?.message || 'Video generation failed');
} Defensive patterns
Strategy: retry
Validate before calling
// Validate request shape before sending to reduce upstream FAIL causes
const validSizes = ['480p','720p','1080p'];
if (!payload.model || !validSizes.includes(payload.quality)) {
throw new Error('Invalid video request parameters');
} Try / catch
// Retry once on FAIL — it can be transient under upstream load
for (let attempt = 0; attempt < 2; attempt++) {
const r = await fetch('/api/stable-diffusion/zai/video', opts);
const body = await r.text();
if (r.ok) break;
if (body.includes('Video generation failed') && attempt === 0) continue;
throw new Error(body);
} Prevention
- Keep prompts within policy and model length limits.
- Use only documented size/aspect_ratio/quality values for the video model.
- Watch the server console (pollResult) for the upstream failure code before retrying blindly.
- Confirm Z.AI quota/balance before retrying a FAIL that may be quota-related.
When it happens
Trigger: The GET to https://api.z.ai/api/paas/v4/async-result/<id> succeeds (HTTP 200) but the JSON body has task_status 'FAIL'. Common upstream causes: content-policy/NSFW rejection, prompt too long, unsupported resolution/aspect_ratio, model overload, or quota exhaustion after submission.
Common situations: Prompt triggers Z.AI safety filter; requested size/aspect_ratio unsupported by the video model; account balance hit zero mid-job; transient upstream GPU failure; quality param incompatible with chosen model.
Related errors
- Video generation aborted by client
- Video generation aborted by client
- OpenAI video job polling failed: {upstream_response_text}
- Video generation failed
- Z.AI API key is not set.
AI-assisted analysis of SillyTavern/SillyTavern@8172dcd0ee (2026-08-13).
Data as JSON: /api/errors/010005c6b42f1b80.
Report an issue: GitHub.