ATH-MaaS/Pixelle-Video · warning · HTTPException
Video workflow used. Please use /media/generate endpoint for
Error message
Video workflow used. Please use /media/generate endpoint for video generation.
What it means
The /image/generate endpoint intentionally rejects requests whose selected workflow produces video. The pixelle media service returns a result flagged is_video, and the router raises 400 telling the caller to switch to /media/generate. This is a deliberate backward-compatibility guard, not a bug: the old /image endpoint now only supports image workflows.
Source
Thrown at api/routers/image.py:56
- **height**: Image height (512-2048)
- **workflow**: Optional custom workflow filename
Returns path to generated image.
"""
try:
logger.info(f"Image generation request: {request.prompt[:50]}...")
# Call media service (backward compatible with image API)
media_result = await pixelle_video.media(
prompt=request.prompt,
width=request.width,
height=request.height,
workflow=request.workflow
)
# For backward compatibility, only support image results in /image endpoint
if media_result.is_video:
raise HTTPException(
status_code=400,
detail="Video workflow used. Please use /media/generate endpoint for video generation."
)
return ImageGenerateResponse(
image_path=media_result.url
)
except HTTPException:
raise
except Exception as e:
logger.error(f"Image generation error: {e}")
raise HTTPException(status_code=500, detail=str(e))
View on GitHub (pinned to 848b054e4f)
Solutions
- Change the workflow field in the request to an image workflow, or
- Send the same request to POST /media/generate instead, which accepts both image and video workflows
- Update client code/docs that still route video workflows to /image/generate
Example fix
// before
POST /image/generate {"workflow": "text_to_video", ...}
// after
POST /media/generate {"workflow": "text_to_video", ...} Defensive patterns
Strategy: validation
Validate before calling
// client-side guard before calling /image/generate
const IMAGE_WORKFLOWS = new Set(['image_default', 'text_to_image' /* keep in sync with GET /workflows/image */]);
if (!IMAGE_WORKFLOWS.has(request.workflow)) {
return callMediaGenerate(request); // route video workflows elsewhere
} Try / catch
try {
return await imageGenerate(request);
} catch (err) {
if (err.status === 400 && /media\/generate/.test(err.message)) {
return await mediaGenerate(request); // auto-migrate to correct endpoint
}
throw err;
} Prevention
- Fetch GET /workflows/image (or /workflows/media) at startup and route by workflow type
- Never hardcode video workflow names into image requests
- Update old integration code that predates the /media/generate endpoint
- Check HTTP 400 detail for the redirect hint instead of retrying blindly
When it happens
Trigger: POST /image/generate with a request whose 'workflow' field names a video workflow (or one that resolves to a video pipeline), so media_result.is_video is True.
Common situations: Clients upgraded from older API versions where /image accepted any workflow; copying a video-generation payload into the image endpoint; workflow name typo that maps to a video template; following outdated documentation.
Related errors
AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30).
Data as JSON: /api/errors/642e9cc9fced85de.
Report an issue: GitHub.