分镜支持视频功能

This commit is contained in:
puke
2025-11-11 20:38:31 +08:00
parent cf9321feac
commit 0e2b6b17d0
17 changed files with 1225 additions and 321 deletions

View File

@@ -43,18 +43,27 @@ async def image_generate(
try:
logger.info(f"Image generation request: {request.prompt[:50]}...")
# Call image service
image_path = await pixelle_video.image(
# 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=image_path
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))